Java com.google.common.collect Iterators fields, constructors, methods, implement or subclass

Example usage for Java com.google.common.collect Iterators fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for com.google.common.collect Iterators.

The text is from its open source code.

Method

booleanaddAll(Collection addTo, Iterator iterator)
Adds all elements in iterator to collection .
intadvance(Iterator iterator, int numberToAdvance)
Calls next() on iterator , either numberToAdvance times or until hasNext() returns false , whichever comes first.
booleanall(Iterator iterator, Predicate predicate)
Returns true if every element returned by iterator satisfies the given predicate.
booleanany(Iterator iterator, Predicate predicate)
Returns true if one or more elements returned by iterator satisfy the given predicate.
EnumerationasEnumeration(final Iterator iterator)
Adapts an Iterator to the Enumeration interface.
Iteratorconcat(Iterator a, Iterator b)
Combines two iterators into a single iterator.
Iteratorconcat(Iterator... inputs)
Combines multiple iterators into a single iterator.
Iteratorconcat(final Iterator> inputs)
Combines multiple iterators into a single iterator.
Iteratorconcat(Iterator a, Iterator b, Iterator c, Iterator d)
Combines four iterators into a single iterator.
Iteratorconcat(Iterator a, Iterator b, Iterator c)
Combines three iterators into a single iterator.
IteratorconsumingIterator(final Iterator iterator)
Returns a view of the supplied iterator that removes each element from the supplied iterator as it is returned.
booleancontains(Iterator iterator, @Nullable Object element)
Returns true if iterator contains element .
Iteratorcycle(final Iterable iterable)
Returns an iterator that cycles indefinitely over the elements of iterable .
Iteratorcycle(T... elements)
Returns an iterator that cycles indefinitely over the provided elements.
booleanelementsEqual(Iterator iterator1, Iterator iterator2)
Determines whether two iterators contain equal elements in the same order.
UnmodifiableIteratoremptyIterator()
Returns the empty iterator.
UnmodifiableIteratorfilter(final Iterator unfiltered, final Predicate retainIfTrue)
Returns the elements of unfiltered that satisfy the input predicate retainIfTrue .
UnmodifiableIteratorfilter(Iterator unfiltered, Class desiredType)
Returns all elements in unfiltered that are of the type desiredType .
Tfind(Iterator iterator, Predicate predicate)
Returns the first element in iterator that satisfies the given predicate; use this method only when such an element is known to exist.
Tfind(Iterator iterator, Predicate predicate, @Nullable T defaultValue)
Returns the first element in iterator that satisfies the given predicate.
UnmodifiableIteratorforArray(final T... array)
Returns an iterator containing the elements of array in order.
UnmodifiableListIteratorforArray(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.
UnmodifiableIteratorforEnumeration(final Enumeration enumeration)
Adapts an Enumeration to the Iterator interface.
Tget(Iterator iterator, int position)
Advances iterator position + 1 times, returning the element at the position th position.
Tget(Iterator iterator, int position, @Nullable T defaultValue)
Advances iterator position + 1 times, returning the element at the position th position or defaultValue otherwise.
TgetLast(Iterator iterator)
Advances iterator to the end, returning the last element.
TgetLast(Iterator iterator, @Nullable T defaultValue)
Advances iterator to the end, returning the last element or defaultValue if the iterator is empty.
TgetNext(Iterator iterator, @Nullable T defaultValue)
Returns the next element in iterator or defaultValue if the iterator is empty.
TgetOnlyElement(Iterator iterator, @Nullable T defaultValue)
Returns the single element contained in iterator , or defaultValue if the iterator is empty.
TgetOnlyElement(Iterator iterator)
Returns the single element contained in iterator .
intindexOf(Iterator iterator, Predicate predicate)
Returns the index in iterator of the first element that satisfies the provided predicate , or -1 if the Iterator has no such elements.
Iteratorlimit(final Iterator iterator, final int limitSize)
Creates an iterator returning the first limitSize elements of the given iterator.
UnmodifiableIteratormergeSorted(Iterable> iterators, Comparator comparator)
Returns an iterator over the merged contents of all given iterators , traversing every element of the input iterators.
UnmodifiableIterator>paddedPartition(Iterator iterator, int size)
Divides an iterator into unmodifiable sublists of the given size, padding the final iterator with null values if necessary.
UnmodifiableIterator>partition(Iterator iterator, int size)
Divides an iterator into unmodifiable sublists of the given size (the final list may be smaller).
PeekingIteratorpeekingIterator(Iterator iterator)
Returns a PeekingIterator backed by the given iterator.
PeekingIteratorpeekingIterator(PeekingIterator iterator)
Simply returns its argument.
booleanremoveAll(Iterator removeFrom, Collection elementsToRemove)
Traverses an iterator and removes every element that belongs to the provided collection.
booleanremoveIf(Iterator removeFrom, Predicate predicate)
Removes every element that satisfies the provided predicate from the iterator.
UnmodifiableIteratorsingletonIterator(@Nullable final T value)
Returns an iterator containing only value .
intsize(Iterator iterator)
Returns the number of elements remaining in iterator .
T[]toArray(Iterator iterator, Class type)
Copies an iterator's elements into an array.
StringtoString(Iterator iterator)
Returns a string representation of iterator , with the format [e1, e2, ..., en] .
Iteratortransform(final Iterator fromIterator, final Function function)
Returns an iterator that applies function to each element of fromIterator .
OptionaltryFind(Iterator iterator, Predicate predicate)
Returns an Optional containing the first element in iterator that satisfies the given predicate, if such an element exists.
UnmodifiableIteratorunmodifiableIterator(final Iterator iterator)
Returns an unmodifiable view of iterator .
UnmodifiableIteratorunmodifiableIterator(UnmodifiableIterator iterator)
Simply returns its argument.