KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
1 of the presentation says "These methods are LAZY!" Iterable transform(Iterable, Function)* Iterable filter(Iterable, Predicate)* T find(Iterable<T>, Predicate) Iterable concat(Iterable<Iterable>) Iterable cycle(Iterable) T getOnlyElement(Iterable<T>) Iterable<T> reverse(List<T>) Can someone help me understand what they mean by this, lets say I've a collection of Persons and I apply a filter to return only the persons whose last name is DOE. So does this mean that the "filtering happens only on the first call to doeOnly.next()?" List<Person> persons= .... Iterable doeOnly= Iterables.filter(persons,DOE_AS_LAST_NAME_PREDICATE);
Tags (comma-separated)
Save Edits
Cancel