Package javax.jcr
Interface RangeIterator
-
- All Superinterfaces:
java.util.Iterator
- All Known Subinterfaces:
AccessControlPolicyIterator
,EventIterator
,EventJournal
,EventListenerIterator
,NodeIterator
,NodeTypeIterator
,PrincipalIterator
,PropertyIterator
,RowIterator
,VersionIterator
- All Known Implementing Classes:
AccessControlPolicyIteratorAdapter
,EventIteratorAdapter
,EventListenerIteratorAdapter
,FilteredRangeIterator
,FilteringNodeIterator
,FrozenNodeIteratorAdapter
,NodeIteratorAdapter
,NodeTypeIteratorAdapter
,PrincipalIteratorAdapter
,PropertyIteratorAdapter
,RangeIteratorAdapter
,RangeIteratorDecorator
,RowIteratorAdapter
,VersionIteratorAdapter
public interface RangeIterator extends java.util.Iterator
ExtendsIterator
with theskip
,getSize
andgetPosition
methods. The base interface of all type-specific iterators in thejavax.jcr
and its sub packages.
-
-
Method Summary
All Methods Instance Methods Abstract 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.void
skip(long skipNum)
Skip a number of elements in the iterator.
-
-
-
Method Detail
-
skip
void skip(long skipNum)
Skip a number of elements in the iterator.- Parameters:
skipNum
- the non-negative number of elements to skip- Throws:
java.util.NoSuchElementException
- if skipped past the last element in the iterator.
-
getSize
long getSize()
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.- Returns:
- a long
-
getPosition
long getPosition()
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.
- Returns:
- a long
-
-