Example usage for Java com.google.common.collect Iterators fields, constructors, methods, implement or subclass
The text is from its open source code.
boolean | addAll(Collection Adds all elements in iterator to collection . |
int | advance(Iterator> iterator, int numberToAdvance) Calls next() on iterator , either numberToAdvance times or until hasNext() returns false , whichever comes first. |
boolean | all(Iterator Returns true if every element returned by iterator satisfies the given predicate. |
boolean | any(Iterator Returns true if one or more elements returned by iterator satisfy the given predicate. |
Enumeration | asEnumeration(final Iterator Adapts an Iterator to the Enumeration interface. |
Iterator | concat(Iterator extends T> a, Iterator extends T> b) Combines two iterators into a single iterator. |
Iterator | concat(Iterator extends T>... inputs) Combines multiple iterators into a single iterator. |
Iterator | concat(final Iterator extends Iterator extends T>> inputs) Combines multiple iterators into a single iterator. |
Iterator | concat(Iterator extends T> a, Iterator extends T> b, Iterator extends T> c, Iterator extends T> d) Combines four iterators into a single iterator. |
Iterator | concat(Iterator extends T> a, Iterator extends T> b, Iterator extends T> c) Combines three iterators into a single iterator. |
Iterator | consumingIterator(final Iterator Returns a view of the supplied iterator that removes each element from the supplied iterator as it is returned. |
boolean | contains(Iterator> iterator, @Nullable Object element) Returns true if iterator contains element . |
Iterator | cycle(final Iterable Returns an iterator that cycles indefinitely over the elements of iterable . |
Iterator | cycle(T... elements) Returns an iterator that cycles indefinitely over the provided elements. |
boolean | elementsEqual(Iterator> iterator1, Iterator> iterator2) Determines whether two iterators contain equal elements in the same order. |
UnmodifiableIterator | emptyIterator() Returns the empty iterator. |
UnmodifiableIterator | filter(final Iterator Returns the elements of unfiltered that satisfy the input predicate retainIfTrue . |
UnmodifiableIterator | filter(Iterator> unfiltered, Class Returns all elements in unfiltered that are of the type desiredType . |
T | find(Iterator Returns the first element in iterator that satisfies the given predicate; use this method only when such an element is known to exist. |
T | find(Iterator extends T> iterator, Predicate super T> predicate, @Nullable T defaultValue) Returns the first element in iterator that satisfies the given predicate. |
UnmodifiableIterator | forArray(final T... array) Returns an iterator containing the elements of array in order. |
UnmodifiableListIterator | forArray(final T[] array, final int offset, int length, int index) Returns a list iterator containing the elements in the specified range of array in order, starting at the specified index. |
UnmodifiableIterator | forEnumeration(final Enumeration Adapts an Enumeration to the Iterator interface. |
T | get(Iterator Advances iterator position + 1 times, returning the element at the position th position. |
T | get(Iterator extends T> iterator, int position, @Nullable T defaultValue) Advances iterator position + 1 times, returning the element at the position th position or defaultValue otherwise. |
T | getLast(Iterator Advances iterator to the end, returning the last element. |
T | getLast(Iterator extends T> iterator, @Nullable T defaultValue) Advances iterator to the end, returning the last element or defaultValue if the iterator is empty. |
T | getNext(Iterator extends T> iterator, @Nullable T defaultValue) Returns the next element in iterator or defaultValue if the iterator is empty. |
T | getOnlyElement(Iterator extends T> iterator, @Nullable T defaultValue) Returns the single element contained in iterator , or defaultValue if the iterator is empty. |
T | getOnlyElement(Iterator Returns the single element contained in iterator . |
int | indexOf(Iterator Returns the index in iterator of the first element that satisfies the provided predicate , or -1 if the Iterator has no such elements. |
Iterator | limit(final Iterator Creates an iterator returning the first limitSize elements of the given iterator. |
UnmodifiableIterator | mergeSorted(Iterable extends Iterator extends T>> iterators, Comparator super T> comparator) Returns an iterator over the merged contents of all given iterators , traversing every element of the input iterators. |
UnmodifiableIterator
| paddedPartition(Iterator Divides an iterator into unmodifiable sublists of the given size, padding the final iterator with null values if necessary. |
UnmodifiableIterator
| partition(Iterator Divides an iterator into unmodifiable sublists of the given size (the final list may be smaller). |
PeekingIterator | peekingIterator(Iterator extends T> iterator) Returns a PeekingIterator backed by the given iterator. |
PeekingIterator | peekingIterator(PeekingIterator Simply returns its argument. |
boolean | removeAll(Iterator> removeFrom, Collection> elementsToRemove) Traverses an iterator and removes every element that belongs to the provided collection. |
boolean | removeIf(Iterator Removes every element that satisfies the provided predicate from the iterator. |
UnmodifiableIterator | singletonIterator(@Nullable final T value) Returns an iterator containing only value . |
int | size(Iterator> iterator) Returns the number of elements remaining in iterator . |
T[] | toArray(Iterator extends T> iterator, Class Copies an iterator's elements into an array. |
String | toString(Iterator> iterator) Returns a string representation of iterator , with the format [e1, e2, ..., en] . |
Iterator | transform(final Iterator Returns an iterator that applies function to each element of fromIterator . |
Optional | tryFind(Iterator Returns an Optional containing the first element in iterator that satisfies the given predicate, if such an element exists. |
UnmodifiableIterator | unmodifiableIterator(final Iterator Returns an unmodifiable view of iterator . |
UnmodifiableIterator | unmodifiableIterator(UnmodifiableIterator Simply returns its argument. |