Example usage for Java com.google.common.collect Iterables fields, constructors, methods, implement or subclass
The text is from its open source code.
boolean | addAll(Collection Adds all elements in iterable to collection . |
boolean | all(Iterable Returns true if every element in iterable satisfies the predicate. |
boolean | any(Iterable Returns true if any element in iterable satisfies the predicate. |
Iterable | concat(Iterable extends T> a, Iterable extends T> b) Combines two iterables into a single iterable. |
Iterable | concat(Iterable extends T> a, Iterable extends T> b, Iterable extends T> c) Combines three iterables into a single iterable. |
Iterable | concat(Iterable extends T>... inputs) Combines multiple iterables into a single iterable. |
Iterable | concat(final Iterable extends Iterable extends T>> inputs) Combines multiple iterables into a single iterable. |
Iterable | concat(Iterable extends T> a, Iterable extends T> b, Iterable extends T> c, Iterable extends T> d) Combines four iterables into a single iterable. |
Iterable | consumingIterable(final Iterable Returns a view of the supplied iterable that wraps each generated Iterator through Iterators#consumingIterator(Iterator) . |
boolean | contains(Iterable> iterable, @Nullable Object element) Returns true if iterable contains any object for which equals(element) is true. |
Iterable | cycle(final Iterable Returns an iterable whose iterators cycle indefinitely over the elements of iterable . |
Iterable | cycle(T... elements) Returns an iterable whose iterators cycle indefinitely over the provided elements. |
boolean | elementsEqual(Iterable> iterable1, Iterable> iterable2) Determines whether two iterables contain equal elements in the same order. |
Iterable | filter(final Iterable Returns the elements of unfiltered that satisfy the input predicate retainIfTrue . |
Iterable | filter(final Iterable> unfiltered, final Class Returns all elements in unfiltered that are of the type desiredType . |
T | find(Iterable Returns the first element in iterable that satisfies the given predicate; use this method only when such an element is known to exist. |
T | find(Iterable extends T> iterable, Predicate super T> predicate, @Nullable T defaultValue) Returns the first element in iterable that satisfies the given predicate, or defaultValue if none found. |
int | frequency(Iterable> iterable, @Nullable Object element) Returns the number of elements in the specified iterable that equal the specified object. |
T | get(Iterable Returns the element at the specified position in an iterable. |
T | get(Iterable extends T> iterable, int position, @Nullable T defaultValue) Returns the element at the specified position in an iterable or a default value otherwise. |
T | getFirst(Iterable extends T> iterable, @Nullable T defaultValue) Returns the first element in iterable or defaultValue if the iterable is empty. |
T | getLast(Iterable Returns the last element of iterable . |
T | getLast(Iterable extends T> iterable, @Nullable T defaultValue) Returns the last element of iterable or defaultValue if the iterable is empty. |
T | getOnlyElement(Iterable Returns the single element contained in iterable . |
T | getOnlyElement(Iterable extends T> iterable, @Nullable T defaultValue) Returns the single element contained in iterable , or defaultValue if the iterable is empty. |
int | indexOf(Iterable Returns the index in iterable of the first element that satisfies the provided predicate , or -1 if the Iterable has no such elements. |
boolean | isEmpty(Iterable> iterable) Determines if the given iterable contains no elements. |
Iterable | limit(final Iterable Creates an iterable with the first limitSize elements of the given iterable. |
Iterable | mergeSorted(final Iterable extends Iterable extends T>> iterables, final Comparator super T> comparator) Returns an iterable over the merged contents of all given iterables . |
Iterable
| paddedPartition(final Iterable Divides an iterable into unmodifiable sublists of the given size, padding the final iterable with null values if necessary. |
Iterable
| partition(final Iterable Divides an iterable into unmodifiable sublists of the given size (the final iterable may be smaller). |
boolean | removeAll(Iterable> removeFrom, Collection> elementsToRemove) Removes, from an iterable, every element that belongs to the provided collection. |
boolean | removeIf(Iterable Removes, from an iterable, every element that satisfies the provided predicate. |
boolean | retainAll(Iterable> removeFrom, Collection> elementsToRetain) Removes, from an iterable, every element that does not belong to the provided collection. |
int | size(Iterable> iterable) Returns the number of elements in iterable . |
Iterable | skip(final Iterable Returns a view of iterable that skips its first numberToSkip elements. |
T[] | toArray(Iterable extends T> iterable, Class Copies an iterable's elements into an array. |
T[] | toArray(Iterable extends T> iterable, T[] array) |
String | toString(Iterable> iterable) Returns a string representation of iterable , with the format [e1, e2, ..., en] (that is, identical to java.util.Arrays Arrays .toString(Iterables.toArray(iterable)) ). |
Iterable | transform(final Iterable Returns an iterable that applies function to each element of fromIterable . |
Optional | tryFind(Iterable Returns an Optional containing the first element in iterable that satisfies the given predicate, if such an element exists. |
Iterable | unmodifiableIterable(final Iterable Returns an unmodifiable view of iterable . |
Iterable | unmodifiableIterable(ImmutableCollection Simply returns its argument. |