|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.xml.dtm.ref.DTMAxisIteratorBase org.apache.xalan.xsltc.dom.KeyIndex
public class KeyIndex
Stores mappings of key values or IDs to DTM nodes.
Use of an instance of this class as a DTMAxisIterator
is
deprecated.
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. |
Field Summary | |
---|---|
private int |
_currentDocumentNode
The document node currently being processed. |
private DOM |
_dom
The XSLTC DOM object if this KeyIndex is being used to implement the id() function. |
private DOMEnhancedForDTM |
_enhancedDOM
|
private Hashtable |
_index
A mapping between values and nodesets for the current document. |
private int |
_markedPosition
Store position after call to setMark() |
private IntegerArray |
_nodes
The node set associated to the current value passed to lookupKey(); |
private Hashtable |
_rootToIndexMap
A mapping from a document node to the mapping between values and nodesets |
private static IntegerArray |
EMPTY_NODES
Used to represent an empty node set. |
Fields inherited from class org.apache.xml.dtm.ref.DTMAxisIteratorBase |
---|
_includeSelf, _isRestartable, _last, _markedNode, _position, _startNode |
Fields inherited from interface org.apache.xml.dtm.DTMAxisIterator |
---|
END |
Constructor Summary | |
---|---|
KeyIndex(int dummy)
|
Method Summary | |
---|---|
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 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,
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 the key
function. |
IntegerArray |
getDOMNodeById(java.lang.String id)
Return an IntegerArray for the DOM Node which has the given id. |
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. |
KeyIndex.KeyIndexIterator |
getKeyIndexIterator(java.lang.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(java.lang.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. |
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, resetPosition, returnNode |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private Hashtable _index
private int _currentDocumentNode
private Hashtable _rootToIndexMap
private IntegerArray _nodes
private DOM _dom
private DOMEnhancedForDTM _enhancedDOM
private int _markedPosition
private static final IntegerArray EMPTY_NODES
Constructor Detail |
---|
public KeyIndex(int dummy)
Method Detail |
---|
public void setRestartable(boolean flag)
DTMAxisIterator
setRestartable
in interface DTMAxisIterator
setRestartable
in class DTMAxisIteratorBase
public void add(java.lang.Object value, int node, int rootNode)
public void merge(KeyIndex other)
public void lookupId(java.lang.Object value)
public IntegerArray getDOMNodeById(java.lang.String id)
id
- The id
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.
Use of an instance of this class as a DTMAxisIterator
is
deprecated.
public int next()
Callers should not call next() after it returns END.
Use of an instance of this class as a DTMAxisIterator
is
deprecated.
public int containsID(int node, java.lang.Object value)
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.
node
- The context nodevalue
- The argument to the id
function
1
if the context node is in the set of nodes
returned by the reference to the id
function;
0
, otherwisepublic 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 the key
function. This is used in the implementation of key patterns.
This particular KeyIndex
object is the result evaluating the
first argument to the key
function, so it's not taken into
any further account.
node
- The context nodevalue
- The second argument to the key
function
1
if and only if the context node is in the set of
nodes returned by the reference to the key
function;
0
, otherwisepublic DTMAxisIterator reset()
Resets the iterator to the last start node.
Use of an instance of this class as a DTMAxisIterator
is
deprecated.
reset
in interface DTMAxisIterator
reset
in class DTMAxisIteratorBase
public int getLast()
Returns the number of elements in this iterator.
Use of an instance of this class as a DTMAxisIterator
is
deprecated.
getLast
in interface DTMAxisIterator
getLast
in class DTMAxisIteratorBase
public int getPosition()
Returns the position of the current node in the set.
Use of an instance of this class as a DTMAxisIterator
is
deprecated.
getPosition
in interface DTMAxisIterator
getPosition
in class DTMAxisIteratorBase
public void setMark()
Remembers the current node for the next call to gotoMark().
Use of an instance of this class as a DTMAxisIterator
is
deprecated.
public void gotoMark()
Restores the current node remembered by setMark().
Use of an instance of this class as a DTMAxisIterator
is
deprecated.
public DTMAxisIterator setStartNode(int start)
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.
start
- Sets the root of the iteration.
public int getStartNode()
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.
getStartNode
in interface DTMAxisIterator
getStartNode
in class DTMAxisIteratorBase
public boolean isReverse()
True if this iterator has a reversed axis.
Use of an instance of this class as a DTMAxisIterator
is
deprecated.
isReverse
in interface DTMAxisIterator
isReverse
in class DTMAxisIteratorBase
public DTMAxisIterator cloneIterator()
Returns a deep copy of this iterator.
Use of an instance of this class as a DTMAxisIterator
is
deprecated.
cloneIterator
in interface DTMAxisIterator
cloneIterator
in class DTMAxisIteratorBase
public void setDom(DOM dom)
public KeyIndex.KeyIndexIterator getKeyIndexIterator(java.lang.Object keyValue, boolean isKeyCall)
KeyIndex.KeyIndexIterator
that iterates over the nodes that
result from a reference to the XSLT key
function or
XPath id
function.
keyValue
- A string or iterator representing the key values or id
referencesisKeyCall
- A boolean
indicating whether the iterator
is being created for a reference key
or
id
public KeyIndex.KeyIndexIterator getKeyIndexIterator(java.lang.String keyValue, boolean isKeyCall)
KeyIndex.KeyIndexIterator
that iterates over the nodes that
result from a reference to the XSLT key
function or
XPath id
function.
keyValue
- A string representing the key values or id
referencesisKeyCall
- A boolean
indicating whether the iterator
is being created for a reference key
or
id
public KeyIndex.KeyIndexIterator getKeyIndexIterator(DTMAxisIterator keyValue, boolean isKeyCall)
KeyIndex.KeyIndexIterator
that iterates over the nodes that
result from a reference to the XSLT key
function or
XPath id
function.
keyValue
- An iterator representing the key values or id
referencesisKeyCall
- A boolean
indicating whether the iterator
is being created for a reference key
or
id
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |