|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.googlecode.concurrenttrees.common.Iterables
public class Iterables
Provides methods to convert Iterables to Lists and Sets.
| Method Summary | ||
|---|---|---|
static int |
count(Iterable<?> iterable)
Counts the number of elements returned by the given Iterable. |
|
static
|
toList(Iterable<T> iterable)
Copies elements from the given Iterable into a new List. |
|
static
|
toSet(Iterable<T> iterable)
Copies elements from the given Iterable into a new Set. |
|
static String |
toString(Iterable<?> iterable)
Returns a string representation of elements returned by the given Iterable. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static <T> List<T> toList(Iterable<T> iterable)
Iterable into a new List.
The iteration order of the list returned, will be the same as that of the iterable.
Be aware of the memory implications of copying objects from a lazy iterable into a collection;
usually it's better to just work with the iterable directly (i.e. by iterating it).
T - The type of elements returned by the iterableiterable - Provides elements to be copied into a new list
List which contains the elements which were returned by the iterablepublic static <T> Set<T> toSet(Iterable<T> iterable)
Iterable into a new Set.
The iteration order of the set returned, will be the same as that of the iterable.
Be aware of the memory implications of copying objects from a lazy iterable into a collection;
usually it's better to just work with the iterable directly (i.e. by iterating it).
T - The type of elements returned by the iterableiterable - Provides elements to be copied into a new set
Set which contains the elements which were returned by the iterablepublic static String toString(Iterable<?> iterable)
Iterable.
iterable - Provides elements whose toString representations should be included in the string
Iterablepublic static int count(Iterable<?> iterable)
Iterable.
iterable - Provides elements to be counted
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||