|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.jackrabbit.spi.commons.iterator.Iterators
public final class Iterators
Utility class containing type safe adapters for some of the iterators of commons-collections.
Method Summary | ||
---|---|---|
static
|
arrayIterator(T[] values,
int from,
int to)
Returns an iterator for elements of an array of values . |
|
static
|
empty()
Returns an empty iterator of type T . |
|
static
|
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
|
iteratorChain(Collection<? extends T> iterators)
Returns an iterator for the concatenation of all the given iterators . |
|
static
|
iteratorChain(Iterator<? extends T>[] iterators)
Returns an iterator for the concatenation of all the given iterators . |
|
static
|
iteratorChain(Iterator<? extends T> iterator1,
Iterator<? extends T> iterator2)
Returns an iterator for the concatenation of iterator1 and
iterator2 . |
|
static Iterator<Node> |
nodes(NodeIterator nodeIterator)
Returns an iterator of Node from a NodeIterator . |
|
static Iterator<Property> |
properties(PropertyIterator propertyIterator)
Returns an iterator of Property from a PropertyIterator . |
|
static
|
singleton(T element)
Returns an iterator containing the single element element of
type T . |
|
static
|
transformIterator(Iterator<? extends T> iterator,
Transformer<S,? super R> transformer)
Returns an iterator with elements of an original iterator transformed by
a transformer . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
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<Property> properties(PropertyIterator propertyIterator)
Property
from a PropertyIterator
.
propertyIterator
-
public static Iterator<Node> nodes(NodeIterator nodeIterator)
Node
from a NodeIterator
.
nodeIterator
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |