Class NodeIteratorImpl
- java.lang.Object
- 
- org.apache.jackrabbit.jcr2spi.query.NodeIteratorImpl
 
- 
- All Implemented Interfaces:
- Iterator,- NodeIterator,- RangeIterator,- ScoreNodeIterator
 
 public class NodeIteratorImpl extends Object implements ScoreNodeIterator Implements aNodeIteratorreturned byQueryResult.getNodes().
- 
- 
Constructor SummaryConstructors Constructor Description NodeIteratorImpl(ItemManager itemMgr, HierarchyManager hierarchyMgr, QueryInfo queryInfo)Creates a newNodeIteratorImplinstance.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description longgetPosition()Returns the current position in thisNodeIterator.doublegetScore()Returns the score of the node returned bynextNode().longgetSize()Returns the number of nodes in this iterator.booleanhasNext()Returnstrueif there is anotherNodeavailable;falseotherwise.Objectnext()Returns the nextNodein the result set.NodenextNode()Returns the nextNodein the result set.voidremove()voidskip(long skipNum)Skip a number ofNodes in this iterator.- 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface java.util.IteratorforEachRemaining
 
- 
 
- 
- 
- 
Constructor Detail- 
NodeIteratorImplpublic NodeIteratorImpl(ItemManager itemMgr, HierarchyManager hierarchyMgr, QueryInfo queryInfo) Creates a newNodeIteratorImplinstance.- Parameters:
- itemMgr- The- ItemManagerto build- Nodeinstances.
- hierarchyMgr- The- HierarchyManagerused to retrieve the HierarchyEntry objects from the ids returned by the query.
- queryInfo- the query result.
 
 
- 
 - 
Method Detail- 
getScorepublic double getScore() throws NoSuchElementExceptionReturns the score of the node returned bynextNode(). In other words, this method returns the score value of the nextNode.- Specified by:
- getScorein interface- ScoreNodeIterator
- Returns:
- the score of the node returned by nextNode().
- Throws:
- NoSuchElementException- if there is no next node.
- See Also:
- ScoreNodeIterator.getScore()
 
 - 
nextNodepublic Node nextNode() throws NoSuchElementException Returns the nextNodein the result set.- Specified by:
- nextNodein interface- NodeIterator
- Returns:
- the next Nodein the result set.
- Throws:
- NoSuchElementException- if iteration has no more- Nodes.
- See Also:
- NodeIterator.nextNode()
 
 - 
skippublic void skip(long skipNum) throws NoSuchElementExceptionSkip a number ofNodes in this iterator.- Specified by:
- skipin interface- RangeIterator
- Parameters:
- skipNum- the non-negative number of- Nodes to skip
- Throws:
- NoSuchElementException- if skipped past the last- Nodein this iterator.
- See Also:
- RangeIterator.skip(long)
 
 - 
getSizepublic long getSize() Returns the number of nodes in this iterator.Note: The number returned by this method may differ from the number of nodes actually returned by calls to hasNext() / getNextNode()! This is because this iterator works on a lazy instantiation basis and while iterating over the nodes some of them might have been deleted in the meantime. Those will not be returned by getNextNode(). As soon as an invalid node is detected, the size of this iterator is adjusted. - Specified by:
- getSizein interface- RangeIterator
- Returns:
- the number of node in this iterator.
- See Also:
- RangeIterator.getSize()
 
 - 
getPositionpublic long getPosition() Returns the current position in thisNodeIterator.- Specified by:
- getPositionin interface- RangeIterator
- Returns:
- the current position in this NodeIterator.
- See Also:
- RangeIterator.getPosition()
 
 - 
nextpublic Object next() throws NoSuchElementException Returns the nextNodein the result set.- Specified by:
- nextin interface- Iterator
- Returns:
- the next Nodein the result set.
- Throws:
- NoSuchElementException- if iteration has no more- Nodes.
- See Also:
- Iterator.next()
 
 - 
hasNextpublic boolean hasNext() Returnstrueif there is anotherNodeavailable;falseotherwise.- Specified by:
- hasNextin interface- Iterator
- Returns:
- trueif there is another- Nodeavailable;- falseotherwise.
- See Also:
- Iterator.hasNext()
 
 - 
removepublic void remove() - Specified by:
- removein interface- Iterator
- Throws:
- UnsupportedOperationException- always.
- See Also:
- Iterator.remove()
 
 
- 
 
-