org.exist.storage.dom
Class DOMFileIterator

java.lang.Object
  extended by org.exist.storage.dom.DOMFileIterator
All Implemented Interfaces:
java.util.Iterator

public final class DOMFileIterator
extends java.lang.Object
implements java.util.Iterator

Iterate through all nodes of a document in the DOM storage. Returns the raw data of the node in a Value. Use class NodeIterator to get node objects instead of raw data. The DOM file is locked to locate the data and released afterwards. Before working with the returned data, you should get a copy by calling value.getData().

Author:
wolf

Constructor Summary
DOMFileIterator(java.lang.Object lock, DOMFile db, long address)
           
DOMFileIterator(java.lang.Object lock, DOMFile db, NodeProxy node)
           
 
Method Summary
 long currentAddress()
          Returns the internal virtual address of the node at the iterator's current position.
 boolean hasNext()
          Are there more nodes to be read?
 java.lang.Object next()
          Returns the raw data of the next node in the sequence.
 void remove()
           
 void setTo(long address)
          Reposition the iterate at a given address.
 void setTo(NodeProxy node)
          Reposition the iterator at the address of the proxy node.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DOMFileIterator

public DOMFileIterator(java.lang.Object lock,
                       DOMFile db,
                       NodeProxy node)
                throws BTreeException,
                       java.io.IOException
Throws:
BTreeException
java.io.IOException

DOMFileIterator

public DOMFileIterator(java.lang.Object lock,
                       DOMFile db,
                       long address)
                throws BTreeException,
                       java.io.IOException
Throws:
BTreeException
java.io.IOException
Method Detail

currentAddress

public long currentAddress()
Returns the internal virtual address of the node at the iterator's current position.

Returns:
The currentAddress value

hasNext

public boolean hasNext()
Are there more nodes to be read?

Specified by:
hasNext in interface java.util.Iterator
Returns:
Description of the Return Value

next

public java.lang.Object next()
Returns the raw data of the next node in the sequence.

Specified by:
next in interface java.util.Iterator
Returns:
Description of the Return Value

remove

public void remove()
Specified by:
remove in interface java.util.Iterator

setTo

public void setTo(NodeProxy node)
Reposition the iterator at the address of the proxy node.

Parameters:
node - The new to value

setTo

public void setTo(long address)
Reposition the iterate at a given address.

Parameters:
address - The new to value


Copyright (C) Wolfgang Meier. All rights reserved.