org.apache.xalan.xsltc.dom

Class KeyIndex

Implemented Interfaces:
Cloneable, DTMAxisIterator

public class KeyIndex
extends DTMAxisIteratorBase

Stores mappings of key values or IDs to DTM nodes. Use of an instance of this class as a DTMAxisIterator is deprecated.
Authors:
Morten Jorgensen
Santiago Pericas-Geertsen

Nested Class Summary

class
KeyIndex.KeyIndexIterator
An iterator representing the result of a reference to either the XSLT key function or the XPath id function.

Fields inherited from interface org.apache.xml.dtm.DTMAxisIterator

END

Constructor Summary

KeyIndex(int dummy)

Method Summary

void
add(Object value, int node, int rootNode)
Adds a node to the node list for a given value.
DTMAxisIterator
cloneIterator()
Deprecated.
int
containsID(int node, Object value)
Given a context node and the argument to the XPath id function, checks whether the context node is in the set of nodes that results from that reference to the id function.
int
containsKey(int node, Object value)
Given a context node and the second argument to the XSLT key function, checks whether the context node is in the set of nodes that results from that reference to the key function.
IntegerArray
getDOMNodeById(String id)
Return an IntegerArray for the DOM Node which has the given id.
KeyIndex.KeyIndexIterator
getKeyIndexIterator(Object keyValue, boolean isKeyCall)
Create a KeyIndex.KeyIndexIterator that iterates over the nodes that result from a reference to the XSLT key function or XPath id function.
KeyIndex.KeyIndexIterator
getKeyIndexIterator(String keyValue, boolean isKeyCall)
Create a KeyIndex.KeyIndexIterator that iterates over the nodes that result from a reference to the XSLT key function or XPath id function.
KeyIndex.KeyIndexIterator
getKeyIndexIterator(DTMAxisIterator keyValue, boolean isKeyCall)
Create a KeyIndex.KeyIndexIterator that iterates over the nodes that result from a reference to the XSLT key function or XPath id function.
int
getLast()
Deprecated.
int
getPosition()
Deprecated.
int
getStartNode()
Deprecated.
void
gotoMark()
Deprecated.
boolean
isReverse()
Deprecated.
void
lookupId(Object value)
Deprecated.
void
lookupKey(Object value)
Deprecated.
void
merge(KeyIndex other)
Deprecated.
int
next()
Deprecated.
DTMAxisIterator
reset()
Deprecated.
void
setDom(DOM dom)
void
setMark()
Deprecated.
void
setRestartable(boolean flag)
Set if restartable.
DTMAxisIterator
setStartNode(int start)
Deprecated.

Methods inherited from class org.apache.xml.dtm.ref.DTMAxisIteratorBase

cloneIterator, getAxis, getLast, getNodeByPosition, getPosition, getStartNode, includeSelf, isDocOrdered, isReverse, reset, setRestartable

Constructor Details

KeyIndex

public KeyIndex(int dummy)

Method Details

add

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

cloneIterator

public DTMAxisIterator cloneIterator()

Deprecated.

Returns a deep copy of this iterator.

Use of an instance of this class as a DTMAxisIterator is deprecated.

Specified by:
cloneIterator in interface DTMAxisIterator
Overrides:
cloneIterator in interface DTMAxisIteratorBase

containsID

public int containsID(int node,
                      Object value)
Given a context node and the argument to the XPath id function, checks whether the context node is in the set of nodes that results from that reference to the id function. This is used in the implementation of id patterns.
Parameters:
node - The context node
value - The argument to the id function
Returns:
1 if the context node is in the set of nodes returned by the reference to the id function; 0, otherwise

containsKey

public int containsKey(int node,
                       Object value)
Parameters:
node - The context node
value - The second argument to the key function
Returns:
1 if and only if the context node is in the set of nodes returned by the reference to the key function; 0, otherwise

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.

getKeyIndexIterator

public KeyIndex.KeyIndexIterator getKeyIndexIterator(Object keyValue,
                                                     boolean isKeyCall)
Create a KeyIndex.KeyIndexIterator that iterates over the nodes that result from a reference to the XSLT key function or XPath id function.
Parameters:
keyValue - A string or iterator representing the key values or id references
isKeyCall - A boolean indicating whether the iterator is being created for a reference key or id

getKeyIndexIterator

public KeyIndex.KeyIndexIterator getKeyIndexIterator(String keyValue,
                                                     boolean isKeyCall)
Create a KeyIndex.KeyIndexIterator that iterates over the nodes that result from a reference to the XSLT key function or XPath id function.
Parameters:
keyValue - A string representing the key values or id references
isKeyCall - A boolean indicating whether the iterator is being created for a reference key or id

getKeyIndexIterator

public KeyIndex.KeyIndexIterator getKeyIndexIterator(DTMAxisIterator keyValue,
                                                     boolean isKeyCall)
Create a KeyIndex.KeyIndexIterator that iterates over the nodes that result from a reference to the XSLT key function or XPath id function.
Parameters:
keyValue - An iterator representing the key values or id references
isKeyCall - A boolean indicating whether the iterator is being created for a reference key or id

getLast

public int getLast()

Deprecated.

Specified by:
getLast in interface DTMAxisIterator
Overrides:
getLast in interface DTMAxisIteratorBase

getPosition

public int getPosition()

Deprecated.

Specified by:
getPosition in interface DTMAxisIterator
Overrides:
getPosition in interface DTMAxisIteratorBase

getStartNode

public int getStartNode()

Deprecated.

Specified by:
getStartNode in interface DTMAxisIterator
Overrides:
getStartNode in interface DTMAxisIteratorBase

gotoMark

public void gotoMark()

Deprecated.

Specified by:
gotoMark in interface DTMAxisIterator

isReverse

public boolean isReverse()

Deprecated.

Specified by:
isReverse in interface DTMAxisIterator
Overrides:
isReverse in interface DTMAxisIteratorBase

lookupId

public void lookupId(Object value)

Deprecated.

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)

Deprecated.


merge

public void merge(KeyIndex other)

Deprecated.

Merge the current value's nodeset set by lookupKey() with _nodes.

next

public int next()

Deprecated.

Specified by:
next in interface DTMAxisIterator

reset

public DTMAxisIterator reset()

Deprecated.

Resets the iterator to the last start node.

Use of an instance of this class as a DTMAxisIterator is deprecated.

Specified by:
reset in interface DTMAxisIterator
Overrides:
reset in interface DTMAxisIteratorBase

setDom

public void setDom(DOM dom)

setMark

public void setMark()

Deprecated.

Specified by:
setMark in interface DTMAxisIterator

setRestartable

public void setRestartable(boolean flag)
Set if restartable.
Specified by:
setRestartable in interface DTMAxisIterator
Overrides:
setRestartable in interface DTMAxisIteratorBase

setStartNode

public DTMAxisIterator setStartNode(int start)

Deprecated.

Set start to END should 'close' the iterator, i.e. subsequent call to next() should return END.

Use of an instance of this class as a DTMAxisIterator is deprecated.

Specified by:
setStartNode in interface DTMAxisIterator

Copyright B) 2006 Apache XML Project. All Rights Reserved.