Methods Summary |
---|
public void | allowDetachToRelease(boolean allowRelease)Specify if it's OK for detach to release the iterator for reuse.
|
public java.lang.Object | clone()Get a clone of this iterator, but don't reset the iteration in the
process, so that it may be used from the current position.
|
public com.sun.org.apache.xml.internal.dtm.DTMIterator | cloneWithReset()Get a cloned Iterator that is reset to the start of the iteration.
|
public void | detach()Detaches the DTMIterator from the set which it iterated
over, releasing any computational resources and placing the iterator
in the INVALID state. After detach has been invoked,
calls to nextNode or previousNode will
raise a runtime exception.
|
public int | getAxis()Returns the axis being iterated, if it is known.
|
public int | getCurrentNode()Get the current node in the iterator. Note that this differs from
the DOM's NodeIterator, where the current position lies between two
nodes (as part of the maintain-relative-position semantic).
|
public int | getCurrentPos()Get the current position within the cached list, which is one
less than the next nextNode() call will retrieve. i.e. if you
call getCurrentPos() and the return is 0, the next fetch will
take place at index 1.
|
public com.sun.org.apache.xml.internal.dtm.DTM | getDTM(int nodeHandle)Get an instance of a DTM that "owns" a node handle. Since a node
iterator may be passed without a DTMManager, this allows the
caller to easily get the DTM using just the iterator.
|
public com.sun.org.apache.xml.internal.dtm.DTMManager | getDTMManager()Get an instance of the DTMManager. Since a node
iterator may be passed without a DTMManager, this allows the
caller to easily get the DTMManager using just the iterator.
|
public boolean | getExpandEntityReferences()The value of this flag determines whether the children of entity
reference nodes are visible to the iterator. If false, they and
their descendants will be rejected. Note that this rejection takes
precedence over whatToShow and the filter.
To produce a view of the document that has entity references
expanded and does not expose the entity reference node itself, use
the whatToShow flags to hide the entity reference node
and set expandEntityReferences to true when creating the
iterator. To produce a view of the document that has entity reference
nodes but no entity expansion, use the whatToShow flags
to show the entity reference node and set
expandEntityReferences to false.
NOTE: In Xalan's use of DTM we will generally have fully expanded
entity references when the document tree was built, and thus this
flag will have no effect.
|
public int | getLength()The number of nodes in the list. The range of valid child node indices
is 0 to length-1 inclusive. Note that this requires running
the iterator to completion, and presumably filling the cache.
|
public int | getRoot()The root node of the DTMIterator , as specified when it
was created. Note the root node is not the root node of the
document tree, but the context node from where the iteration
begins and ends.
|
public int | getWhatToShow()This attribute determines which node types are presented via the
iterator. The available set of constants is defined above.
Nodes not accepted by
whatToShow will be skipped, but their children may still
be considered.
|
public boolean | isDocOrdered()Returns true if all the nodes in the iteration well be returned in document
order.
|
public boolean | isFresh()Tells if this NodeSetDTM is "fresh", in other words, if
the first nextNode() that is called will return the
first node in the set.
|
public boolean | isMutable()Tells if this iterator can have nodes added to it or set via
the setItem(int node, int index) method.
|
public int | item(int index)Returns the node handle of an item in the collection. If
index is greater than or equal to the number of nodes in
the list, this returns null .
|
public int | nextNode()Returns the next node in the set and advances the position of the
iterator in the set. After a DTMIterator has setRoot called,
the first call to nextNode() returns that root or (if it
is rejected by the filters) the first node within its subtree which is
not filtered out.
|
public int | previousNode()Returns the previous node in the set and moves the position of the
DTMIterator backwards in the set.
|
public void | reset()Reset the iterator to the start. After resetting, the next node returned
will be the root node -- or, if that's filtered out, the first node
within the root's subtree which is _not_ skipped by the filters.
|
public void | runTo(int index)If an index is requested, NodeSetDTM will call this method
to run the iterator to the index. By default this sets
m_next to the index. If the index argument is -1, this
signals that the iterator should be run to the end and
completely fill the cache.
|
public void | setCurrentPos(int i)Set the current position in the node set.
|
public void | setItem(int node, int index)Sets the node at the specified index of this vector to be the
specified node. The previous component at that position is discarded.
The index must be a value greater than or equal to 0 and less
than the current size of the vector.
The iterator must be in cached mode.
Meant to be used for sorted iterators.
|
public void | setRoot(int nodeHandle, java.lang.Object environment)Reset the root node of the DTMIterator , overriding
the value specified when it was created. Note the root node is
not the root node of the document tree, but the context node from
where the iteration begins.
|
public void | setShouldCacheNodes(boolean b)If setShouldCacheNodes(true) is called, then nodes will
be cached, enabling random access, and giving the ability to do
sorts and the like. They are not cached by default.
%REVIEW% Shouldn't the other random-access methods throw an exception
if they're called on a DTMIterator with this flag set false?
|