Class ResultIterator<T>
- java.lang.Object
-
- org.apache.jackrabbit.oak.security.user.query.ResultIterator<T>
-
- Type Parameters:
T
- element type of the query results
- All Implemented Interfaces:
Iterator<T>
public final class ResultIterator<T> extends Object implements Iterator<T>
Implements a query result iterator which only returns a maximum number of element from an underlying iterator starting at a given offset.
-
-
Field Summary
Fields Modifier and Type Field Description static int
MAX_ALL
static int
OFFSET_NONE
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <T> Iterator<T>
create(long offset, long max, Iterator<T> iterator)
Returns an iterator respecting the specifiedoffset
andmax
.boolean
hasNext()
T
next()
void
remove()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Iterator
forEachRemaining
-
-
-
-
Field Detail
-
OFFSET_NONE
public static final int OFFSET_NONE
- See Also:
- Constant Field Values
-
MAX_ALL
public static final int MAX_ALL
- See Also:
- Constant Field Values
-
-
Method Detail
-
create
public static <T> Iterator<T> create(long offset, long max, Iterator<T> iterator)
Returns an iterator respecting the specifiedoffset
andmax
.- Type Parameters:
T
- element type- Parameters:
offset
- offset to start iteration at. Must be non negativemax
- maximum elements this iterator should return. Set toMAX_ALL
for alliterator
- the underlying iterator- Returns:
- an iterator which only returns the elements in the given bounds
-
-