public final class Iterators extends Object
Modifier and Type | Method and Description |
---|---|
static <T> Iterator<T> |
arrayIterator(T[] values,
int from,
int to)
Returns an iterator for elements of an array of
values . |
static <T> Iterator<T> |
empty()
Returns an empty iterator of type
T . |
static <T> Iterator<T> |
filterIterator(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> Iterator<T> |
iteratorChain(Collection<? extends T> iterators)
Returns an iterator for the concatenation of all the given
iterators . |
static <T> Iterator<T> |
iteratorChain(Iterator<? extends T>[] iterators)
Returns an iterator for the concatenation of all the given
iterators . |
static <T> Iterator<T> |
iteratorChain(Iterator<? extends T> iterator1,
Iterator<? extends T> iterator2)
Returns an iterator for the concatenation of
iterator1 and
iterator2 . |
static Iterator<javax.jcr.Node> |
nodes(javax.jcr.NodeIterator nodeIterator)
Returns an iterator of
Node from a NodeIterator . |
static Iterator<javax.jcr.Property> |
properties(javax.jcr.PropertyIterator propertyIterator)
Returns an iterator of
Property from a PropertyIterator . |
static <T> Iterator<T> |
singleton(T element)
Returns an iterator containing the single element
element of
type T . |
static <T,R,S extends T> |
transformIterator(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> Iterator<T> singleton(T element)
element
of
type T
.T
- element
- public static <T> Iterator<T> empty()
T
.T
- public static <T> Iterator<T> iteratorChain(Iterator<? extends T> iterator1, Iterator<? extends T> iterator2)
iterator1
and
iterator2
.T
- iterator1
- iterator2
- public static <T> Iterator<T> iteratorChain(Iterator<? extends T>[] iterators)
iterators
.T
- iterators
- public static <T> Iterator<T> iteratorChain(Collection<? extends T> iterators)
iterators
.T
- iterators
- public static <T> 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> Iterator<T> filterIterator(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> Iterator<R> transformIterator(Iterator<? extends T> iterator, Transformer<S,? super R> transformer)
iterator
transformed by
a transformer
.T
- R
- S
- iterator
- transformer
- public static Iterator<javax.jcr.Property> properties(javax.jcr.PropertyIterator propertyIterator)
Property
from a PropertyIterator
.propertyIterator
- public static Iterator<javax.jcr.Node> nodes(javax.jcr.NodeIterator nodeIterator)
Node
from a NodeIterator
.nodeIterator
- Copyright © 2004-2020 The Apache Software Foundation. All Rights Reserved.