public final class Iterators
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static <T> java.util.Iterator<T> |
arrayIterator(T[] values,
int from,
int to)
Returns an iterator for elements of an array of
values . |
static <T> java.util.Iterator<T> |
empty()
Returns an empty iterator of type
T . |
static <T> java.util.Iterator<T> |
filterIterator(java.util.Iterator<? extends T> iterator,
Predicate<? super T> predicate)
Returns an iterator with elements from an original
iterator where the
given predicate matches removed. |
static <T> java.util.Iterator<T> |
iteratorChain(java.util.Collection<? extends T> iterators)
Returns an iterator for the concatenation of all the given
iterators . |
static <T> java.util.Iterator<T> |
iteratorChain(java.util.Iterator<? extends T>[] iterators)
Returns an iterator for the concatenation of all the given
iterators . |
static <T> java.util.Iterator<T> |
iteratorChain(java.util.Iterator<? extends T> iterator1,
java.util.Iterator<? extends T> iterator2)
Returns an iterator for the concatenation of
iterator1 and
iterator2 . |
static java.util.Iterator<Node> |
nodes(NodeIterator nodeIterator)
Returns an iterator of
Node from a NodeIterator . |
static java.util.Iterator<Property> |
properties(PropertyIterator propertyIterator)
Returns an iterator of
Property from a PropertyIterator . |
static <T> java.util.Iterator<T> |
singleton(T element)
Returns an iterator containing the single element
element of
type T . |
static <T,R,S extends T> |
transformIterator(java.util.Iterator<? extends T> iterator,
Transformer<S,? super R> transformer)
Returns an iterator with elements of an original
iterator transformed by
a transformer . |
public static <T> java.util.Iterator<T> singleton(T element)
element
of
type T
.T
- element
- public static <T> java.util.Iterator<T> empty()
T
.T
- public static <T> java.util.Iterator<T> iteratorChain(java.util.Iterator<? extends T> iterator1, java.util.Iterator<? extends T> iterator2)
iterator1
and
iterator2
.T
- iterator1
- iterator2
- public static <T> java.util.Iterator<T> iteratorChain(java.util.Iterator<? extends T>[] iterators)
iterators
.T
- iterators
- public static <T> java.util.Iterator<T> iteratorChain(java.util.Collection<? extends T> iterators)
iterators
.T
- iterators
- public static <T> java.util.Iterator<T> arrayIterator(T[] values, int from, int to)
values
.T
- values
- the array to iterate over.from
- the index to start iterating at.to
- the index to finish iterating at.public static <T> java.util.Iterator<T> filterIterator(java.util.Iterator<? extends T> iterator, Predicate<? super T> predicate)
iterator
where the
given predicate
matches removed.T
- iterator
- predicate
- public static <T,R,S extends T> java.util.Iterator<R> transformIterator(java.util.Iterator<? extends T> iterator, Transformer<S,? super R> transformer)
iterator
transformed by
a transformer
.T
- R
- S
- iterator
- transformer
- public static java.util.Iterator<Property> properties(PropertyIterator propertyIterator)
Property
from a PropertyIterator
.propertyIterator
- public static java.util.Iterator<Node> nodes(NodeIterator nodeIterator)
Node
from a NodeIterator
.nodeIterator
- "Copyright © 2010 - 2020 Adobe Systems Incorporated. All Rights Reserved"