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
0
votes
1 answer

What is the lambdaj code for the following iteration

The following is the code which normally write to iterate and based on some condtion,i am adding to some other list.How can i write the same in the Lambdaj. Thanks in advance and your suggestion is appreciable. List authorizedPerson = new…
srini
  • 5,799
  • 7
  • 29
  • 34
0
votes
1 answer

Select top 3 items of a List using lambdaj

I want to select the top 3 items of a java List. I know how to sort the List (please see the code), but I don't know how to select the top 3 entries of this list having the highest values ([3.0, 5.5, 7.2]). I guess I could use subList(), but I want…
m.s.
  • 15,040
  • 6
  • 49
  • 79
0
votes
0 answers

Migrate from lambdaj to Java 8

With lambdaj I can do something like this to get the name of a property in a refactoring-safe way. import static ch.lambdaj.Lambda.on; import static…
baymon
  • 359
  • 1
  • 3
  • 19
0
votes
1 answer

Lambdaj group by flatten list

I have a list of objects, let's call it Model public class Model { String modelId; List PropertyA; List PropertyB; List PropertyC; String modelCol1; String modelCol2; String modelCol3; String modelCol4; } Sample data…
user777
  • 3
  • 2
0
votes
2 answers

Avoid this for loop with Lambdaj

How can avoid this loop with lambdaj, I want to add all elements from List personas into another list String tipo = "type_1"; for (Person person : personas) { lista.add(new SimpleResultForm(tipo, person)); } I'm using Java 7 so, Java 8 lambda…
Raider
  • 382
  • 2
  • 25
0
votes
1 answer

Compare sets inside a set

I have a set like this : Set> NestedSet = new HashSet>(); [[Node[0], Node[1], Node[2]], [Node[0], Node[2], Node[6]], [Node[3], Node[4], Node[5]]] I want to compare and merge sets that are inside the nested set. [0,1,2] and…
priya
  • 325
  • 4
  • 19
0
votes
1 answer

How to import lambdaj in the Eclipse projects?

I would like to use lamdaj in a Eclipse project and needs to make this import, import static ch.lamdaj.Lambda.*; I downloaded and added the lambdaj-2.4-with-dependencies.jar inside a jar folder in the Eclipse as following, and then, added the…
Arefe
  • 891
  • 5
  • 14
  • 29
0
votes
0 answers

In Java, what are the reasons for Higher Order Functions (via lambdaj) over for (x:y) loops?

I'm working on a large team of programmers on a Java System. The library LamdbaJ is in the working library, but many of the developers are skeptical of the benefits of functional programming. (My background is that I'm a big fan of Clojure). I…
hawkeye
  • 31,052
  • 27
  • 133
  • 271
0
votes
4 answers

Find intersection between collections with different objects

I have list of custom objects like below: List existingValues And another collection with ids that has been sent from client and contains ids of CustomObject mentoioned above Set ids. My goal is to return collection with…
fashuser
  • 1,972
  • 24
  • 44
0
votes
1 answer

Multiple condition under select in LambdaJ

I'm looking to select using two conditions in LambdaJ select, i've tried to use and() function but i can't figure out how to use it.the above code selects using one condition. how i could add another condition? select(filteredPB, …
geogeek
  • 1,155
  • 3
  • 22
  • 40
0
votes
1 answer

Is there a way to determine at runtime if an object was created using Lambdaj.on() method?

I want to write a method that takes as a parameter either result of Lambdaj.on() call or a string. public static void method(T arg) { } T can be String here. Is it possible to determine if arg was created using Lambdaj.on() method?
alkedr
  • 694
  • 6
  • 16
0
votes
1 answer

LambdaJ: matching on fields of the same object

Can someone get me out of LambdaJ pit I fell into please? let's assume I have a list of objects of this class: private class TestObject { private String A; private String B; //gettters and setters } Let's say I want to select the…
artur
  • 1,088
  • 1
  • 9
  • 20
0
votes
1 answer

Is asList Function Part of Lamdaj library

I'm trying to understand lambdaj library in order to use functional style programming in java. Their wiki page example uses a function called asList which I don't see in any of the lambda packages. I'm using lambdaj 2.4 version and I'm referring…
user378101
  • 639
  • 3
  • 11
  • 19
0
votes
2 answers

Gross Lack of efficacy in using LambdaJ over iteration

In a java ee application with JSF and JPA,I have to calculate totals of attributes in lists of objects. I have used LambdaJ library to achieve the calculation of sums. As I use this sort of summations in several places of the application with…
Buddhika Ariyaratne
  • 1,902
  • 3
  • 44
  • 79
0
votes
3 answers

Java : How to do aggregation over a list supporting min, max, avg, last kind of aggregations in each group

I have done this earlier in MySQL itself, as that seems the proper way, but I have to do some business logic calculations and then need to apply the group by on the resulting list, any suggestions to do this in Java without compromising performance…
Sandeep
  • 199
  • 1
  • 4
  • 12