org.apache.xalan.xsltc.dom

Class KeyIndex

public class KeyIndex extends DTMAxisIteratorBase

Author: Morten Jorgensen Santiago Pericas-Geertsen

Constructor Summary
KeyIndex(int dummy)
Method Summary
voidadd(Object value, int node)
Adds a node to the node list for a given value.
DTMAxisIteratorcloneIterator()
Returns a deep copy of this iterator.
intcontainsID(int node, Object value)
intcontainsKey(int node, Object value)
IntegerArraygetDOMNodeById(String id)
Return an IntegerArray for the DOM Node which has the given id.
intgetLast()
Returns the number of elements in this iterator.
intgetPosition()
Returns the position of the current node in the set.
intgetStartNode()
Get start to END should 'close' the iterator, i.e. subsequent call to next() should return END.
voidgotoMark()
Restores the current node remembered by setMark().
booleanisReverse()
True if this iterator has a reversed axis.
voidlookupId(Object value)
This method must be called by the code generated by the id() function prior to returning the node iterator.
voidlookupKey(Object value)
This method must be called by the code generated by the key() function prior to returning the node iterator.
voidmerge(KeyIndex other)
Merge the current value's nodeset set by lookupKey() with _nodes.
intnext()
Callers should not call next() after it returns END.
DTMAxisIteratorreset()
Resets the iterator to the last start node.
voidsetDom(DOM dom)
voidsetMark()
Remembers the current node for the next call to gotoMark().
voidsetRestartable(boolean flag)
DTMAxisIteratorsetStartNode(int start)
Set start to END should 'close' the iterator, i.e. subsequent call to next() should return END.

Constructor Detail

KeyIndex

public KeyIndex(int dummy)

Method Detail

add

public void add(Object value, int node)
Adds a node to the node list for a given value. Nodes will always be added in document order.

cloneIterator

public DTMAxisIterator cloneIterator()
Returns a deep copy of this iterator.

containsID

public int containsID(int node, Object value)

containsKey

public int containsKey(int node, Object value)

getDOMNodeById

public IntegerArray getDOMNodeById(String id)
Return an IntegerArray for the DOM Node which has the given id.

Parameters: id The id

Returns: A IntegerArray representing the Node whose id is the given value.

getLast

public int getLast()
Returns the number of elements in this iterator.

getPosition

public int getPosition()
Returns the position of the current node in the set.

getStartNode

public int getStartNode()
Get start to END should 'close' the iterator, i.e. subsequent call to next() should return END.

gotoMark

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

isReverse

public boolean isReverse()
True if this iterator has a reversed axis.

lookupId

public void lookupId(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(Object value)
This method must be called by the code generated by the key() function prior to returning the node iterator.

merge

public void merge(KeyIndex other)
Merge the current value's nodeset set by lookupKey() with _nodes.

next

public int next()
Callers should not call next() after it returns END.

reset

public DTMAxisIterator reset()
Resets the iterator to the last start node.

setDom

public void setDom(DOM dom)

setMark

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

setRestartable

public void setRestartable(boolean flag)

setStartNode

public DTMAxisIterator setStartNode(int start)
Set start to END should 'close' the iterator, i.e. subsequent call to next() should return END.
Copyright © 2005 Apache XML Project. All Rights Reserved.