com.ximpleware
Class NodeRecorder

java.lang.Object
  extended by com.ximpleware.NodeRecorder

public class NodeRecorder
extends java.lang.Object

Node record allows one to record the node position of VTDNav. You can store/load multiple node position using NodeRecorder, which is also more spatially efficient than . However, the internal representation of node is variable in length and recording a large number of nodes could consume much memory. It is a bad idea to record every node of an document. So be careful when using it.


Field Summary
static int BUF_SZ_EXPO
           
 
Constructor Summary
NodeRecorder()
          The parameter-less constructor
NodeRecorder(VTDNav vn1)
           
 
Method Summary
 void bind(VTDNav vn1)
           
 void clear()
          Clear will erase all the nodes, internal buffers are reused
 int iterate()
          This method set the cursor in VTDNav to the nodes as recorded in NodeRecorder, and return the output of "getCurrentIndex()" It is important to notice that you can only go forward, not backward
 void record()
          This function records the position of VN into an internal buffer
 void resetPointer()
          resetPointer() will set the pointer to the first node in NodeRecorder This method is called when one wants to read the nodes in the nodeRecorder
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BUF_SZ_EXPO

public static final int BUF_SZ_EXPO
See Also:
Constant Field Values
Constructor Detail

NodeRecorder

public NodeRecorder()
The parameter-less constructor


NodeRecorder

public NodeRecorder(VTDNav vn1)
Parameters:
vn1 -
Method Detail

bind

public void bind(VTDNav vn1)

clear

public void clear()
Clear will erase all the nodes, internal buffers are reused


iterate

public int iterate()
This method set the cursor in VTDNav to the nodes as recorded in NodeRecorder, and return the output of "getCurrentIndex()" It is important to notice that you can only go forward, not backward

Returns:
int

record

public void record()
This function records the position of VN into an internal buffer


resetPointer

public void resetPointer()
resetPointer() will set the pointer to the first node in NodeRecorder This method is called when one wants to read the nodes in the nodeRecorder