Class FilteringNodeIterator
- java.lang.Object
-
- org.apache.jackrabbit.commons.iterator.FilteringNodeIterator
-
- All Implemented Interfaces:
java.util.Iterator
,NodeIterator
,RangeIterator
public class FilteringNodeIterator extends java.lang.Object implements NodeIterator
-
-
Constructor Summary
Constructors Constructor Description FilteringNodeIterator(NodeIterator base, Predicate filter)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
getPosition()
Returns the current position within the iterator.long
getSize()
Returns the total number of of items available through this iterator.boolean
hasNext()
java.lang.Object
next()
Node
nextNode()
Returns the nextNode
in the iteration.void
remove()
void
skip(long skipNum)
Skip a number of elements in the iterator.
-
-
-
Constructor Detail
-
FilteringNodeIterator
public FilteringNodeIterator(NodeIterator base, Predicate filter)
-
-
Method Detail
-
hasNext
public boolean hasNext()
- Specified by:
hasNext
in interfacejava.util.Iterator
- See Also:
Iterator.hasNext()
-
next
public java.lang.Object next()
- Specified by:
next
in interfacejava.util.Iterator
- See Also:
Iterator.next()
-
remove
public void remove()
- Specified by:
remove
in interfacejava.util.Iterator
- See Also:
Iterator.remove()
-
nextNode
public Node nextNode()
Description copied from interface:NodeIterator
Returns the nextNode
in the iteration.- Specified by:
nextNode
in interfaceNodeIterator
- Returns:
- the next
Node
in the iteration. - See Also:
NodeIterator.nextNode()
-
skip
public void skip(long skipNum)
Description copied from interface:RangeIterator
Skip a number of elements in the iterator.- Specified by:
skip
in interfaceRangeIterator
- Parameters:
skipNum
- the non-negative number of elements to skip- See Also:
RangeIterator.skip(long)
-
getSize
public long getSize()
Description copied from interface:RangeIterator
Returns the total number of of items available through this iterator. For example, for some nodeN
,N.getNodes().getSize()
returns the number of child nodes ofN
visible through the currentSession
. In some implementations precise information about the number of elements may not be available. In such cases this method must return -1. API clients will then be able to useRangeIterator.getNumberRemaining
to get an estimate on the number of elements.- Specified by:
getSize
in interfaceRangeIterator
- Returns:
- a long
- See Also:
RangeIterator.getSize()
-
getPosition
public long getPosition()
Description copied from interface:RangeIterator
Returns the current position within the iterator. The number returned is the 0-based index of the next element in the iterator, i.e. the one that will be returned on the subsequentnext
call.Note that this method does not check if there is a next element, i.e. an empty iterator will always return 0.
- Specified by:
getPosition
in interfaceRangeIterator
- Returns:
- a long
- See Also:
RangeIterator.getPosition()
-
-