org.apache.xalan.xsltc.dom
Class KeyIndex

java.lang.Object
  |
  +--org.apache.xalan.xsltc.dom.KeyIndex

public class KeyIndex
extends java.lang.Object
implements NodeIterator


Constructor Summary
KeyIndex(int size)
          Creates an index for a key defined by xsl:key
 
Method Summary
 void add(java.lang.Object value, int node)
          Adds a node to the node list for a given value.
 NodeIterator cloneIterator()
          Returns a deep copy of this iterator.
 int containsID(int node, java.lang.Object value)
           
 int containsKey(int node, java.lang.Object value)
           
 int getLast()
          Returns the number of elements in this iterator.
 int getPosition()
          Returns the position of the current node in the set.
 void gotoMark()
          Restores the current node remembered by setMark().
 boolean isReverse()
          True if this iterator has a reversed axis.
 void lookupId(java.lang.Object value)
          This method must be called by the code generated by the id() function prior to returning the node iterator.
 void lookupKey(java.lang.Object value)
          This method must be called by the code generated by the key() function prior to returning the node iterator.
 void merge(KeyIndex other)
          Merge this node set with nodes from another index
 int next()
          Callers should not call next() after it returns END.
 NodeIterator reset()
          Resets the iterator to the last start node.
 void setMark()
          Remembers the current node for the next call to gotoMark().
 void setRestartable(boolean flag)
           
 NodeIterator setStartNode(int start)
          Set start to END should 'close' the iterator, i.e.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KeyIndex

public KeyIndex(int size)
Creates an index for a key defined by xsl:key
Method Detail

setRestartable

public void setRestartable(boolean flag)
Specified by:
setRestartable in interface NodeIterator

add

public void add(java.lang.Object value,
                int node)
Adds a node to the node list for a given value. The BitArray object makes sure duplicate nodes are eliminated.

merge

public void merge(KeyIndex other)
Merge this node set with nodes from another index

lookupId

public void lookupId(java.lang.Object value)
This method must be called by the code generated by the id() function prior to returning the node iterator. The lookup code for key() and id() differ in the way the lookup value can be whitespace separated list of tokens for the id() function, but a single string for the key() function.

lookupKey

public void lookupKey(java.lang.Object value)
This method must be called by the code generated by the key() function prior to returning the node iterator.

next

public int next()
Callers should not call next() after it returns END.
Specified by:
next in interface NodeIterator

containsID

public int containsID(int node,
                      java.lang.Object value)

containsKey

public int containsKey(int node,
                       java.lang.Object value)

reset

public NodeIterator reset()
Resets the iterator to the last start node.
Specified by:
reset in interface NodeIterator

getLast

public int getLast()
Returns the number of elements in this iterator.
Specified by:
getLast in interface NodeIterator

getPosition

public int getPosition()
Returns the position of the current node in the set.
Specified by:
getPosition in interface NodeIterator

setMark

public void setMark()
Remembers the current node for the next call to gotoMark().
Specified by:
setMark in interface NodeIterator

gotoMark

public void gotoMark()
Restores the current node remembered by setMark().
Specified by:
gotoMark in interface NodeIterator

setStartNode

public NodeIterator setStartNode(int start)
Set start to END should 'close' the iterator, i.e. subsequent call to next() should return END.
Specified by:
setStartNode in interface NodeIterator

isReverse

public boolean isReverse()
True if this iterator has a reversed axis.
Specified by:
isReverse in interface NodeIterator

cloneIterator

public NodeIterator cloneIterator()
Returns a deep copy of this iterator.
Specified by:
cloneIterator in interface NodeIterator


Copyright © 2001 Apache XML Project. All Rights Reserved.