public class HugeNodeListIterator extends Object implements NodeIterator
CachePolicy.NEVER.| Modifier and Type | Field and Description |
|---|---|
protected int |
batchSize |
static int |
DEFAULT_BATCH_SIZE |
protected int |
nextIndex |
protected Node |
nextNode |
protected NodeIterator |
nodeIterator |
protected Query |
originalQuery |
protected Node |
previousNode |
| Constructor and Description |
|---|
HugeNodeListIterator(Query query)
Constructor for this Iterator.
|
HugeNodeListIterator(Query query,
int batchSize)
Constructor for this Iterator.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(Node o) |
protected int |
compares(Node node1,
Node node2)
Used by nextNode and previousNode.
|
protected void |
executeNextQuery(Query q)
Executes the given query, and prepares to do 'next', so setting 'nextNode' and 'previousNode'.
|
protected void |
executePreviousQuery(Query q)
Executes the given query, and prepares to do 'previous', so setting 'nextNode' and
'previousNode', and winds the new nodeIterator to the end.
|
protected void |
executeQuery(Query currentQuery)
Executes the given query, taking into account the fact wether it is NodeQuery or not, and
applying the 'batchSize'.
|
boolean |
hasNext() |
boolean |
hasPrevious() |
static void |
main(String[] args)
Main only for testing.
|
Node |
next() |
int |
nextIndex() |
Node |
nextNode()
Returns the next element in the iterator as a Node
|
Node |
previous() |
int |
previousIndex() |
Node |
previousNode()
Returns the previous element in the iterator as a Node
|
void |
remove() |
void |
set(Node o) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEachRemainingpublic static final int DEFAULT_BATCH_SIZE
protected NodeIterator nodeIterator
protected Node nextNode
protected Node previousNode
protected Query originalQuery
protected int batchSize
protected int nextIndex
public HugeNodeListIterator(Query query, int batchSize)
query - The query which is used as a base for the querie(s) to be executed.batchSize - The (approximate) size of the sub-queries, should be a reasonably large
number, like 10000 or so.public HugeNodeListIterator(Query query)
query - The query which is used as a base for the querie(s) to be executed.protected void executeQuery(Query currentQuery)
protected void executeNextQuery(Query q)
protected void executePreviousQuery(Query q)
public boolean hasNext()
public boolean hasPrevious()
hasPrevious in interface ListIterator<Node>public Node next()
public Node previous()
previous in interface ListIterator<Node>public int previousIndex()
previousIndex in interface ListIterator<Node>public int nextIndex()
nextIndex in interface ListIterator<Node>protected int compares(Node node1, Node node2)
public Node nextNode()
nextNode in interface NodeIteratorpublic Node previousNode()
previousNode in interface NodeIteratorpublic void remove()
remove in interface Iterator<Node>remove in interface ListIterator<Node>UnsupportedOperationExceptionpublic void add(Node o)
add in interface ListIterator<Node>UnsupportedOperationExceptionpublic void set(Node o)
set in interface ListIterator<Node>UnsupportedOperationExceptionpublic static void main(String[] args)
MMBase 1.9-SNAPSHOT - ${javadoctimestamp}