By immutable I mean two things:
- you cannot modify resulting collection,
- source collection is not modified too.
Currently to operate on immutable data structures one have to write something
like this:
public Set<Bills> howMuchIMustPayNextWeek(Set<Bill> myBills) {
// I don't want to modify myBills, so I use clone()
return with(myBills).clone().retain(dueInNextWeek);
}
As a collection API user (with functional programming background) I would like
to have possibility to easily operate on immutable data structures like this:
public Set<Bills> howMuchIMustPayNextWeek(Set<Bill> myBills) {
return from(myBills).filter(dueInNextWeek);
}
from(...) should return immutable collection
I am aware that support for immutable collections is a big task and I'll
understand if you decide it is out of LambdaJ's scope, but it would be great to
have decent immutable collections API in Java world...
Original issue reported on code.google.com by adamcze...@gmail.com on 9 Jan 2011 at 10:13
Original issue reported on code.google.com by
adamcze...@gmail.com
on 9 Jan 2011 at 10:13