Questions tagged [lambdaj]

LambdaJ is a library to manipulate a collections without any iterations.

LambdaJ is a library to manipulate a collections without any iterations. It allows to manipulate collections in a pseudo-functional and statically typed way.

The purpose of this library is to alleviate these problems employing some functional programming techniques but without losing the static typing of java. LambdaJ team imposes this last constraint to make refactoring easier and safer and allow the compiler to do its job.

For more information refer this : http://code.google.com/p/lambdaj/

84 questions
1
vote
1 answer

Hibernate and Lambdaj issue with grouping

I want to perform a tree-grouping from query result set using Lambdaj. Results come from Hibernate. I can do aggregation successfully, but then code fails on grouping: List list = myDao.findByProperty(value); Integer intAvg = avg(list,…
usr-local-ΕΨΗΕΛΩΝ
  • 23,317
  • 27
  • 132
  • 255
1
vote
1 answer

Filtering items which are contained in sample string

I want to use Lambdaj and hamcrest matchers to simply check if sample string contains at least one of the list's item. private static List FIELDS=Arrays.asList("one","two","three","four"); String myString="This string may contain 'one' word…
Rafal
  • 25
  • 1
  • 3
1
vote
1 answer

How to create Map in LambdaJ where value is Collection?

I know how to make Map but how to make Map> in lambdaj? This is code I want to write in LambdaJ: Map> driverCarsMap = new HashMap>(); for (Car car : cars) { String driver =…
Roman
  • 1,041
  • 4
  • 23
  • 38
1
vote
1 answer

How can I use lambdaj groups for default case scenario

I have this case where I am filtering list into multiple lists based on criteria. for(SomeObj someObj : someObjs) { if(StringUtils.equalsIgnoreCase(someObj.getIndicator(), "Y")) { beansWithY.add(someObj); } else…
would_like_to_be_anon
  • 1,399
  • 2
  • 25
  • 45
1
vote
3 answers

Select object from ARRAYLIST WITHOUT LOOP - ANDROID

I am looking for a library which can select object from ArrayList like SQL "where" command. I have huge arraylists (between 2000 and 20000) in my project and i don't want to write for,while loops every time.. I found lambdaj and it is for Java. I…
Emre Koç
  • 1,283
  • 1
  • 21
  • 41
1
vote
1 answer

How to set field for objects in list by field name with LambdaJ?

Code: class MyClass { private String field1; private Long field2; //getters and setters also here } List myClassList = new ArrayList<>(); //getting my list filled Now I need to set e.g. field1 for all objects in list to…
Jack
  • 405
  • 1
  • 5
  • 16
1
vote
2 answers

Filter by more than one criteria using lambdaj

I am using lamdaj expressions to filter the lists based on certain criteria. Inorder to find matches hamcrest matcher is being used. My question is, I would like to filter the list based on more than one condition using AND and OR operator and i do…
prabu
  • 1,117
  • 6
  • 19
  • 31
1
vote
1 answer

Can I pass an arg to a custom Lambdaj Predicate?

Is it possible to pass an argument to a lambdaj Predicate? public static Matcher isSpecialObject = new Predicate() { public boolean apply(SomeObject specialObj) { return…
HellishHeat
  • 1,920
  • 4
  • 23
  • 35
1
vote
1 answer

How to use lambdaJ's extract() on method returning generic type without explicit casting

I'm using generics to store reference to arbitrary object. class Option{ TypeT o; Option(TypeT t){ this.o = o; } TypeT getReferencedObject(){ return o; } } I want to use lambdaJ to extract those objects…
Mariusz Jamro
  • 27,234
  • 22
  • 104
  • 144
1
vote
1 answer

Lambdaj NoClassDefFoundError on android

I'm trying out lambdaj in my android app but even the simplest filtering operations fail with the exception listed. For example: Group groupedPersons= group(people,by(on(Person.class).getAge())); and any other select or filter ends up with…
Peterdeka
  • 379
  • 5
  • 16
1
vote
2 answers

LambdaJ index() and key type conversion

I just started looking at LambdaJ, and immediately ran into a problem. I don't think I am doing anything weird, yet I can't figure out how to do this. I have a List of Administrators: List allAdmins; I have a map I want these…
Val Blant
  • 1,456
  • 2
  • 22
  • 31
1
vote
1 answer

Multiple sort conditions with lambdaj

How can I use multiple sort conditions with lambdaj? e.g. to obtain a List ordered first by name, then by age: Name Age nameA 14 nameB 12 nameB 15 nameC 10 nameC 11 Thanks for you help.
rodtakular
  • 193
  • 1
  • 8
1
vote
1 answer

Lambdaj: Loop through Map and get the values and put in other Map

I'm new to lambdaj so trying to get more used to it. I want to update this code using lambdaj: Passed in parameter Map devices; final Map resultHash = new HashMap(); for (Device device :…
daverocks
  • 2,033
  • 4
  • 18
  • 22
1
vote
1 answer

Sort a Map / EntrySet using Lambdaj

I'm wondering if its possible to sort an EntrySet< K, V > based on some property of K using lambdaj ? I dont think Lambdaj will let me I just wanted to confirm. For example if I have a Map< A, B > where A has the following structure: public class…
MikePatel
  • 2,435
  • 20
  • 36
0
votes
2 answers

Using Lambdaj to Navigate Through Dom4j Elements

For anyone familiar with lambdaj (not I) you will have seen this stacktrace, or some variation, before: ch.lambdaj.function.argument.ArgumentConversionException: Unable to convert the placeholder org.dom4j.tree.AbstractAttribute in a valid …
HellishHeat
  • 1,920
  • 4
  • 23
  • 35