Class KeyIndex
- All Implemented Interfaces:
Cloneable,DTMAxisIterator
DTMAxisIterator is
deprecated.- Author:
- Morten Jorgensen, Santiago Pericas-Geertsen
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassAn iterator representing the result of a reference to either the XSLTkeyfunction or the XPathidfunction. -
Field Summary
Fields inherited from interface org.apache.xml.dtm.DTMAxisIterator
END -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a node to the node list for a given value.Deprecated.intcontainsID(int node, Object value) Given a context node and the argument to the XPathidfunction, checks whether the context node is in the set of nodes that results from that reference to theidfunction.intcontainsKey(int node, Object value) Given a context node and the second argument to the XSLTkeyfunction, checks whether the context node is in the set of nodes that results from that reference to thekeyfunction.getDOMNodeById(String id) Return an IntegerArray for the DOM Node which has the given id.getKeyIndexIterator(Object keyValue, boolean isKeyCall) Create aKeyIndex.KeyIndexIteratorthat iterates over the nodes that result from a reference to the XSLTkeyfunction or XPathidfunction.getKeyIndexIterator(String keyValue, boolean isKeyCall) Create aKeyIndex.KeyIndexIteratorthat iterates over the nodes that result from a reference to the XSLTkeyfunction or XPathidfunction.getKeyIndexIterator(DTMAxisIterator keyValue, boolean isKeyCall) Create aKeyIndex.KeyIndexIteratorthat iterates over the nodes that result from a reference to the XSLTkeyfunction or XPathidfunction.intgetLast()Deprecated.intDeprecated.intDeprecated.voidgotoMark()Deprecated.booleanDeprecated.voidDeprecated.voidDeprecated.voidDeprecated.intnext()Deprecated.reset()Deprecated.voidvoidsetMark()Deprecated.voidsetRestartable(boolean flag) Set if restartable.setStartNode(int start) Deprecated.Methods inherited from class org.apache.xml.dtm.ref.DTMAxisIteratorBase
getAxis, getNodeByPosition, includeSelf, isDocOrdered
-
Constructor Details
-
KeyIndex
public KeyIndex(int dummy)
-
-
Method Details
-
setRestartable
public void setRestartable(boolean flag) Description copied from interface:DTMAxisIteratorSet if restartable.- Specified by:
setRestartablein interfaceDTMAxisIterator- Overrides:
setRestartablein classDTMAxisIteratorBase
-
add
Adds a node to the node list for a given value. Nodes will always be added in document order. -
merge
Deprecated.Merge the current value's nodeset set by lookupKey() with _nodes. -
lookupId
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
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
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
DTMAxisIteratoris deprecated. -
next
public int next()Deprecated.Callers should not call next() after it returns END.
Use of an instance of this class as a
DTMAxisIteratoris deprecated.- Returns:
- The next node handle in the iteration, or END.
-
containsID
Given a context node and the argument to the XPathidfunction, checks whether the context node is in the set of nodes that results from that reference to theidfunction. This is used in the implementation ofidpatterns.- Parameters:
node- The context nodevalue- The argument to theidfunction- Returns:
1if the context node is in the set of nodes returned by the reference to theidfunction;0, otherwise
-
containsKey
Given a context node and the second argument to the XSLT
keyfunction, checks whether the context node is in the set of nodes that results from that reference to thekeyfunction. This is used in the implementation of key patterns.This particular
KeyIndexobject is the result evaluating the first argument to thekeyfunction, so it's not taken into any further account.- Parameters:
node- The context nodevalue- The second argument to thekeyfunction- Returns:
1if and only if the context node is in the set of nodes returned by the reference to thekeyfunction;0, otherwise
-
reset
Deprecated.Resets the iterator to the last start node.
Use of an instance of this class as a
DTMAxisIteratoris deprecated.- Specified by:
resetin interfaceDTMAxisIterator- Overrides:
resetin 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
DTMAxisIteratoris deprecated.- Specified by:
getLastin interfaceDTMAxisIterator- Overrides:
getLastin 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
DTMAxisIteratoris deprecated.- Specified by:
getPositionin interfaceDTMAxisIterator- Overrides:
getPositionin 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
DTMAxisIteratoris deprecated. -
gotoMark
public void gotoMark()Deprecated.Restores the current node remembered by setMark().
Use of an instance of this class as a
DTMAxisIteratoris deprecated. -
setStartNode
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
DTMAxisIteratoris 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
DTMAxisIteratoris deprecated.- Specified by:
getStartNodein interfaceDTMAxisIterator- Overrides:
getStartNodein 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
DTMAxisIteratoris deprecated.- Specified by:
isReversein interfaceDTMAxisIterator- Overrides:
isReversein classDTMAxisIteratorBase- Returns:
- true if this iterator has a reversed axis, else false
-
cloneIterator
Deprecated.Returns a deep copy of this iterator.
Use of an instance of this class as a
DTMAxisIteratoris deprecated.- Specified by:
cloneIteratorin interfaceDTMAxisIterator- Overrides:
cloneIteratorin classDTMAxisIteratorBase- Returns:
- a deep copy of this iterator.
-
setDom
-
getKeyIndexIterator
Create aKeyIndex.KeyIndexIteratorthat iterates over the nodes that result from a reference to the XSLTkeyfunction or XPathidfunction.- Parameters:
keyValue- A string or iterator representing the key values or id referencesisKeyCall- Abooleanindicating whether the iterator is being created for a referencekeyorid
-
getKeyIndexIterator
Create aKeyIndex.KeyIndexIteratorthat iterates over the nodes that result from a reference to the XSLTkeyfunction or XPathidfunction.- Parameters:
keyValue- A string representing the key values or id referencesisKeyCall- Abooleanindicating whether the iterator is being created for a referencekeyorid
-
getKeyIndexIterator
Create aKeyIndex.KeyIndexIteratorthat iterates over the nodes that result from a reference to the XSLTkeyfunction or XPathidfunction.- Parameters:
keyValue- An iterator representing the key values or id referencesisKeyCall- Abooleanindicating whether the iterator is being created for a referencekeyorid
-