Class KeyIndex
- java.lang.Object
-
- org.apache.xml.dtm.ref.DTMAxisIteratorBase
-
- org.apache.xalan.xsltc.dom.KeyIndex
-
- All Implemented Interfaces:
java.lang.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 aDTMAxisIterator
is deprecated.- Author:
- Morten Jorgensen, Santiago Pericas-Geertsen
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
KeyIndex.KeyIndexIterator
An iterator representing the result of a reference to either the XSLTkey
function or the XPathid
function.
-
Field Summary
-
Fields inherited from interface org.apache.xml.dtm.DTMAxisIterator
END
-
-
Constructor Summary
Constructors Constructor Description KeyIndex(int dummy)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
add(java.lang.Object value, int node, int rootNode)
Adds a node to the node list for a given value.DTMAxisIterator
cloneIterator()
Deprecated.int
containsID(int node, java.lang.Object value)
Given a context node and the argument to the XPathid
function, checks whether the context node is in the set of nodes that results from that reference to theid
function.int
containsKey(int node, java.lang.Object value)
Given a context node and the second argument to the XSLTkey
function, checks whether the context node is in the set of nodes that results from that reference to thekey
function.IntegerArray
getDOMNodeById(java.lang.String id)
Return an IntegerArray for the DOM Node which has the given id.KeyIndex.KeyIndexIterator
getKeyIndexIterator(java.lang.Object keyValue, boolean isKeyCall)
Create aKeyIndex.KeyIndexIterator
that iterates over the nodes that result from a reference to the XSLTkey
function or XPathid
function.KeyIndex.KeyIndexIterator
getKeyIndexIterator(java.lang.String keyValue, boolean isKeyCall)
Create aKeyIndex.KeyIndexIterator
that iterates over the nodes that result from a reference to the XSLTkey
function or XPathid
function.KeyIndex.KeyIndexIterator
getKeyIndexIterator(DTMAxisIterator keyValue, boolean isKeyCall)
Create aKeyIndex.KeyIndexIterator
that iterates over the nodes that result from a reference to the XSLTkey
function or XPathid
function.int
getLast()
Deprecated.int
getPosition()
Deprecated.int
getStartNode()
Deprecated.void
gotoMark()
Deprecated.boolean
isReverse()
Deprecated.void
lookupId(java.lang.Object value)
Deprecated.void
lookupKey(java.lang.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
getAxis, getNodeByPosition, includeSelf, isDocOrdered
-
-
-
-
Method Detail
-
setRestartable
public void setRestartable(boolean flag)
Description copied from interface:DTMAxisIterator
Set if restartable.- Specified by:
setRestartable
in interfaceDTMAxisIterator
- Overrides:
setRestartable
in classDTMAxisIteratorBase
-
add
public void add(java.lang.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.
-
merge
public void merge(KeyIndex other)
Deprecated.Merge the current value's nodeset set by lookupKey() with _nodes.
-
lookupId
public void lookupId(java.lang.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.
-
getDOMNodeById
public IntegerArray getDOMNodeById(java.lang.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.
-
lookupKey
public void lookupKey(java.lang.Object value)
Deprecated.This method must be called by the code generated by the key() function prior to returning the node iterator.
Use of an instance of this class as a
DTMAxisIterator
is deprecated.
-
next
public int next()
Deprecated.Callers should not call next() after it returns END.
Use of an instance of this class as a
DTMAxisIterator
is deprecated.- Returns:
- The next node handle in the iteration, or END.
-
containsID
public int containsID(int node, java.lang.Object value)
Given a context node and the argument to the XPathid
function, checks whether the context node is in the set of nodes that results from that reference to theid
function. This is used in the implementation ofid
patterns.- Parameters:
node
- The context nodevalue
- The argument to theid
function- Returns:
1
if the context node is in the set of nodes returned by the reference to theid
function;0
, otherwise
-
containsKey
public int containsKey(int node, java.lang.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 thekey
function. This is used in the implementation of key patterns.This particular
KeyIndex
object is the result evaluating the first argument to thekey
function, so it's not taken into any further account.- Parameters:
node
- The context nodevalue
- The second argument to thekey
function- Returns:
1
if and only if the context node is in the set of nodes returned by the reference to thekey
function;0
, otherwise
-
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 interfaceDTMAxisIterator
- Overrides:
reset
in classDTMAxisIteratorBase
- Returns:
- A DTMAxisIterator which has been reset to the start node, which may or may not be the same as this iterator.
-
getLast
public int getLast()
Deprecated.Returns the number of elements in this iterator.
Use of an instance of this class as a
DTMAxisIterator
is deprecated.- Specified by:
getLast
in interfaceDTMAxisIterator
- Overrides:
getLast
in classDTMAxisIteratorBase
- Returns:
- The number of nodes in this iterator (forward) or 1 (reverse).
-
getPosition
public int getPosition()
Deprecated.Returns the position of the current node in the set.
Use of an instance of this class as a
DTMAxisIterator
is deprecated.- Specified by:
getPosition
in interfaceDTMAxisIterator
- Overrides:
getPosition
in classDTMAxisIteratorBase
- Returns:
- The position of the current node within the set, as defined by XPath. Note that this is one-based, not zero-based.
-
setMark
public void setMark()
Deprecated.Remembers the current node for the next call to gotoMark().
Use of an instance of this class as a
DTMAxisIterator
is deprecated.
-
gotoMark
public void gotoMark()
Deprecated.Restores the current node remembered by setMark().
Use of an instance of this class as a
DTMAxisIterator
is deprecated.
-
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.- Parameters:
start
- Sets the root of the iteration.- Returns:
- A DTMAxisIterator set to the start of the iteration.
-
getStartNode
public int getStartNode()
Deprecated.Get 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:
getStartNode
in interfaceDTMAxisIterator
- Overrides:
getStartNode
in classDTMAxisIteratorBase
- Returns:
- The root node of the iteration.
-
isReverse
public boolean isReverse()
Deprecated.True if this iterator has a reversed axis.
Use of an instance of this class as a
DTMAxisIterator
is deprecated.- Specified by:
isReverse
in interfaceDTMAxisIterator
- Overrides:
isReverse
in classDTMAxisIteratorBase
- Returns:
- true if this iterator has a reversed axis, else false
-
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 interfaceDTMAxisIterator
- Overrides:
cloneIterator
in classDTMAxisIteratorBase
- Returns:
- a deep copy of this iterator.
-
setDom
public void setDom(DOM dom)
-
getKeyIndexIterator
public KeyIndex.KeyIndexIterator getKeyIndexIterator(java.lang.Object keyValue, boolean isKeyCall)
Create aKeyIndex.KeyIndexIterator
that iterates over the nodes that result from a reference to the XSLTkey
function or XPathid
function.- Parameters:
keyValue
- A string or iterator representing the key values or id referencesisKeyCall
- Aboolean
indicating whether the iterator is being created for a referencekey
orid
-
getKeyIndexIterator
public KeyIndex.KeyIndexIterator getKeyIndexIterator(java.lang.String keyValue, boolean isKeyCall)
Create aKeyIndex.KeyIndexIterator
that iterates over the nodes that result from a reference to the XSLTkey
function or XPathid
function.- Parameters:
keyValue
- A string representing the key values or id referencesisKeyCall
- Aboolean
indicating whether the iterator is being created for a referencekey
orid
-
getKeyIndexIterator
public KeyIndex.KeyIndexIterator getKeyIndexIterator(DTMAxisIterator keyValue, boolean isKeyCall)
Create aKeyIndex.KeyIndexIterator
that iterates over the nodes that result from a reference to the XSLTkey
function or XPathid
function.- Parameters:
keyValue
- An iterator representing the key values or id referencesisKeyCall
- Aboolean
indicating whether the iterator is being created for a referencekey
orid
-
-