public class NodeIteratorImpl extends Object implements ScoreNodeIterator
NodeIterator returned by
QueryResult.getNodes().| Constructor and Description |
|---|
NodeIteratorImpl(ItemManager itemMgr,
HierarchyManager hierarchyMgr,
QueryInfo queryInfo)
Creates a new
NodeIteratorImpl instance. |
| Modifier and Type | Method and Description |
|---|---|
long |
getPosition()
Returns the current position in this
NodeIterator. |
double |
getScore()
Returns the score of the node returned by
nextNode(). |
long |
getSize()
Returns the number of nodes in this iterator.
|
boolean |
hasNext()
Returns
true if there is another Node
available; false otherwise. |
Object |
next()
Returns the next
Node in the result set. |
Node |
nextNode()
Returns the next
Node in the result set. |
void |
remove() |
void |
skip(long skipNum)
Skip a number of
Nodes in this iterator. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEachRemainingpublic NodeIteratorImpl(ItemManager itemMgr, HierarchyManager hierarchyMgr, QueryInfo queryInfo)
NodeIteratorImpl instance.itemMgr - The ItemManager to build Node instances.hierarchyMgr - The HierarchyManager used to retrieve the
HierarchyEntry objects from the ids returned by the query.queryInfo - the query result.public double getScore()
throws NoSuchElementException
nextNode(). In other
words, this method returns the score value of the next Node.getScore in interface ScoreNodeIteratornextNode().NoSuchElementException - if there is no next node.ScoreNodeIterator.getScore()public Node nextNode() throws NoSuchElementException
Node in the result set.nextNode in interface NodeIteratorNode in the result set.NoSuchElementException - if iteration has no more Nodes.NodeIterator.nextNode()public void skip(long skipNum)
throws NoSuchElementException
Nodes in this iterator.skip in interface RangeIteratorskipNum - the non-negative number of Nodes to skipNoSuchElementException - if skipped past the last Node
in this iterator.RangeIterator.skip(long)public long getSize()
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.
getSize in interface RangeIteratorRangeIterator.getSize()public long getPosition()
NodeIterator.getPosition in interface RangeIteratorNodeIterator.RangeIterator.getPosition()public Object next() throws NoSuchElementException
Node in the result set.next in interface IteratorNode in the result set.NoSuchElementException - if iteration has no more Nodes.Iterator.next()public boolean hasNext()
true if there is another Node
available; false otherwise.hasNext in interface Iteratortrue if there is another Node
available; false otherwise.Iterator.hasNext()public void remove()
remove in interface IteratorUnsupportedOperationException - always.Iterator.remove()Copyright © 2004–2022 The Apache Software Foundation. All rights reserved.