org.apache.xalan.xsltc.dom
Class KeyIndex.KeyIndexIterator.KeyIndexHeapNode

java.lang.Object
  extended by org.apache.xalan.xsltc.dom.MultiValuedNodeHeapIterator.HeapNode
      extended by org.apache.xalan.xsltc.dom.KeyIndex.KeyIndexIterator.KeyIndexHeapNode
All Implemented Interfaces:
java.lang.Cloneable
Enclosing class:
KeyIndex.KeyIndexIterator

protected class KeyIndex.KeyIndexIterator.KeyIndexHeapNode
extends MultiValuedNodeHeapIterator.HeapNode

Represents the DTM nodes retrieved for one key value or one string argument to id for use as one heap node in a MultiValuedNodeHeapIterator.


Field Summary
private  int _markPosition
          Marked position.
private  IntegerArray _nodes
          IntegerArray of DTM nodes retrieved for one key value.
private  int _position
          Position in _nodes array of next node to return from this heap node.
 
Fields inherited from class org.apache.xalan.xsltc.dom.MultiValuedNodeHeapIterator.HeapNode
_isStartSet, _markedNode, _node
 
Constructor Summary
KeyIndex.KeyIndexIterator.KeyIndexHeapNode(IntegerArray nodes)
          Create a heap node representing DTM nodes retrieved for one key value in a reference to the key function or string argument to the id function.
 
Method Summary
 MultiValuedNodeHeapIterator.HeapNode cloneHeapNode()
          Creates a deep copy of this KeyIndex.KeyIndexIterator.KeyIndexHeapNode.
 void gotoMark()
          Restores the current node remembered by setMark().
 boolean isLessThan(MultiValuedNodeHeapIterator.HeapNode heapNode)
          Performs a comparison of the two heap nodes
 MultiValuedNodeHeapIterator.HeapNode reset()
          Reset the heap node back to its beginning.
 void setMark()
          Remembers the current node for the next call to gotoMark().
 MultiValuedNodeHeapIterator.HeapNode setStartNode(int node)
          Sets context with respect to which this heap node is evaluated.
 int step()
          Advance to the next node represented by this KeyIndex.KeyIndexIterator.KeyIndexHeapNode
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_nodes

private IntegerArray _nodes
IntegerArray of DTM nodes retrieved for one key value. Must contain no duplicates and be stored in document order.


_position

private int _position
Position in _nodes array of next node to return from this heap node.


_markPosition

private int _markPosition
Marked position. Used by setMark() and gotoMark()

Constructor Detail

KeyIndex.KeyIndexIterator.KeyIndexHeapNode

KeyIndex.KeyIndexIterator.KeyIndexHeapNode(IntegerArray nodes)
Create a heap node representing DTM nodes retrieved for one key value in a reference to the key function or string argument to the id function.

Method Detail

step

public int step()
Advance to the next node represented by this KeyIndex.KeyIndexIterator.KeyIndexHeapNode

Specified by:
step in class MultiValuedNodeHeapIterator.HeapNode
Returns:
the next DTM node.

cloneHeapNode

public MultiValuedNodeHeapIterator.HeapNode cloneHeapNode()
Creates a deep copy of this KeyIndex.KeyIndexIterator.KeyIndexHeapNode. The clone is not reset from the current position of the original.

Overrides:
cloneHeapNode in class MultiValuedNodeHeapIterator.HeapNode
Returns:
the cloned heap node

setMark

public void setMark()
Remembers the current node for the next call to gotoMark().

Overrides:
setMark in class MultiValuedNodeHeapIterator.HeapNode

gotoMark

public void gotoMark()
Restores the current node remembered by setMark().

Overrides:
gotoMark in class MultiValuedNodeHeapIterator.HeapNode

isLessThan

public boolean isLessThan(MultiValuedNodeHeapIterator.HeapNode heapNode)
Performs a comparison of the two heap nodes

Specified by:
isLessThan in class MultiValuedNodeHeapIterator.HeapNode
Parameters:
heapNode - the heap node against which to compare
Returns:
true if and only if the current node for this heap node is before the current node of the argument heap node in document order.

setStartNode

public MultiValuedNodeHeapIterator.HeapNode setStartNode(int node)

Sets context with respect to which this heap node is evaluated.

This has no real effect on this kind of heap node. Instead, the KeyIndex.KeyIndexIterator.setStartNode(int) method should create new instances of this class to represent the effect of changing the context.

Specified by:
setStartNode in class MultiValuedNodeHeapIterator.HeapNode
Parameters:
node - The new context node
Returns:
a MultiValuedNodeHeapIterator.HeapNode which may or may not be the same as this HeapNode.

reset

public MultiValuedNodeHeapIterator.HeapNode reset()
Reset the heap node back to its beginning.

Specified by:
reset in class MultiValuedNodeHeapIterator.HeapNode
Returns:
a MultiValuedNodeHeapIterator.HeapNode which may or may not be the same as this HeapNode.