If setShouldCacheNodes(true) is called, as each node is iterated via nextNode(), the node is also stored in the NodeVector, so that previousNode() can easily be done, except in the case where the LocPathIterator is "owned" by a UnionPathIterator, in which case the UnionPathIterator will cache the nodes.
| Modifier and Type | Field and Description |
|---|---|
| protected boolean | m_allowDetach
Control over whether it is OK for detach to reset the iterator. |
| protected transient DTM | m_cdtm
The dtm of the context node. |
| protected transient IteratorPool | m_clones
The pool for cloned iterators. |
| protected transient int | m_context
The context node for this iterator, which doesn't change through the course of the iteration. |
| protected transient int | m_currentContextNode
The node context from where the expression is being executed from (i.e. for current() support). |
| protected transient XPathContext | m_execContext
The XPathContext reference, needed for execution of many operations. |
| private boolean | m_isTopLevel
Value determined at compile time, indicates that this is an iterator at the top level of the expression, rather than inside a predicate. |
| public transient int | m_lastFetched
The last node that was fetched, usually by nextNode. |
| protected transient int | |
| protected transient int | m_pos
The current position of the context node. |
| private PrefixResolver | m_prefixResolver
Fast access to the current prefix resolver. |
| pack-priv transient int | m_stackFrame
The stack frame index for this iterator. |
| pack-priv static final long |
| Access | Constructor and Description |
|---|---|
| protected | |
| protected | LocPathIterator(PrefixResolver
The namespace context for this iterator,
should be OK if null. nscontext)Create a LocPathIterator object. |
| protected | LocPathIterator(Compiler
The Compiler which is creating
this expression. compiler, int The position of this iterator in the
opcode list from the compiler. opPos, int analysis)Create a LocPathIterator object, including creation of step walkers from the opcode list, and call back into the Compiler to create predicate expressions. |
| protected | LocPathIterator(Compiler
The Compiler which is creating
this expression. compiler, int The position of this iterator in the
opcode list from the compiler. opPos, int analysis, boolean True if walkers should be
loaded, or false if this is a derived iterator and
it doesn't wish to load child walkers. shouldLoadWalkers)Create a LocPathIterator object, including creation of step walkers from the opcode list, and call back into the Compiler to create predicate expressions. |
| Modifier and Type | Method and Description |
|---|---|
| public void | allowDetachToRelease(boolean
true if it is OK for detach to release this iterator
for pooling. allowRelease)Implements com. Specify if it's OK for detach to release the iterator for reuse. |
| public DTMIterator | asIterator(XPathContext
The execution context. xctxt, int The node that "." expresses. contextNode)Overrides com. Given an select expression and a context, evaluate the XPath and return the resulting iterator. |
| public int | Returns: the first node out of the nodeset, or DTM.NULL.The XPath runtime context. xctxt)Overrides com. Return the first node out of the nodeset, if this expression is a nodeset expression. |
| public boolean | Returns: The result of the operation as a boolean.The runtime execution context. xctxt)Overrides com. Evaluate this operation directly to a boolean. |
| public void | callVisitors(ExpressionOwner owner, XPathVisitor visitor)
Overrides com. Implements com. This will traverse the heararchy, calling the visitor for each member. |
| public DTMIterator | Returns: A cloned NodeIterator set of the start of the query.Implements com. Get a cloned Iterator that is reset to the beginning of the query. |
| public void | detach()
Implements com. Detaches the iterator from the set which it iterated over, releasing any computational resources and placing the iterator in the INVALID state. |
| public XObject | Returns: An XNodeSet reference that holds this iterator.The XPath execution context. xctxt)Overrides com. Execute this iterator, meaning create a clone that can store state, and initialize it for fast execution from the current runtime state. |
| public void | Returns: The result of the expression in the form of aXObject.The XPath runtime context. xctxt, ContentHandler The target content handler. handler)Overrides com. Execute an expression in the XPath runtime context, and return the result of the expression. |
| public int | Returns: One of WalkerFactory#BIT_DESCENDANT, etc.Implements com. Get the analysis bits for this walker, as defined in the WalkerFactory. |
| public int | Returns: Axis.CHILD, etc., or -1 if the axis is not known or is of multiple types.Implements com. Returns the axis being iterated, if it is known. |
| public final int | |
| public final int | Returns: The top-level node context of the entire expression.The node context from where the expression is being executed from (i.e. for current() support). |
| public int | Returns: The last fetched node, or null if the last fetch was null.Implements com. Return the last fetched node. |
| public final int | Returns: A value greater than or equal to zero that indicates the next node position to fetch.Implements com. Get the current position, which is one less than the next nextNode() call will retrieve. |
| public DTM | Returns: a non-null DTM reference.the nodeHandle. nodeHandle)Implements com. Get an instance of a DTM that "owns" a node handle. |
| public DTMManager | Returns: a non-null DTMManager reference.Implements com. Get an instance of the DTMManager. |
| public boolean | Returns: Always true, since entity reference nodes are not visible in the XPath model.Implements com. The value of this flag determines whether the children of entity reference nodes are visible to the iterator. |
| public DTMFilter | |
| public final boolean | Returns: true if the last nextNode returned null.Tells if we've found the last node yet. |
| public boolean | Returns: true if this location path is at the top level of the expression.Get if this is an iterator at the upper level of the XPath. |
| public int | getLastPos(XPathContext xctxt)
Implements abstract com. Implements com. Get the index of the last node that can be itterated to. |
| public int | Returns: The number of nodes in the list, always greater or equal to zero.Implements com. The number of nodes in the list. |
| public final PrefixResolver | Returns: The prefix resolver or this iterator, which may be null.Return the saved reference to the prefix resolver that was in effect when this iterator was created. |
| public int | Returns: The "root" of this iterator, which, in XPath terms, is the node context for this iterator.Implements com. The root node of the Iterator, as specified when it was created. |
| public int | Returns: For now, always NodeFilter.SHOW_ALL & ~NodeFilter.SHOW_ENTITY_REFERENCE.Overrides com. Implements com. This attribute determines which node types are presented via the iterator. |
| public final XPathContext | Returns: XPath execution context this iterator is operating on, or null if setRoot has not been called.The XPath execution context we are operating on. |
| public void | |
| public boolean | Returns: true as a default.Implements com. Returns true if all the nodes in the iteration well be returned in document order. |
| public boolean | Returns: true of nextNode has not been called.Implements com. 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 | Returns: True if the nodelist can be mutated.Implements com. Tells if this iterator can have nodes added to it or set via
the |
| public boolean | Returns: true if the expression can be represented as a nodeset.Overrides com. Tell if the expression is a nodeset expression. |
| public int | Returns: The node at theindex th position in the
NodeList , or null if that is not a valid
index.Index into the collection. index)Implements com. Returns the |
| public abstract int | Returns: The nextNode in the set being iterated over, or
null if there are no more members in that set.Redeclares com. Returns the next node in the set and advances the position of the iterator in the set. |
| public int | Returns: The previousNode in the set being iterated over,
ornull if there are no more members in that set.Implements com. Returns the previous node in the set and moves the position of the iterator backwards in the set. |
| private void | readObject(ObjectInputStream
Input stream to read from stream)Hides com. Read the object from a serialization stream. |
| public void | |
| protected int | Returns: The same node that was passed as an argument.The next node found, may be null. nextNode)Bottleneck the return of a next node, to make returns easier from nextNode(). |
| public void | runTo(int
The index to run to, or -1 if the iterator
should run to the end. index)Implements com. If an index is requested, NodeSetDTM will call this method to run the iterator to the index. |
| public final void | setCurrentContextNode(int
Must be a non-null reference to the node context. n)Set the current context node for this iterator. |
| public void | setCurrentPos(int
Must be a valid index greater
than or equal to zero and less than m_cachedNodes.size(). i)Implements com. Set the current position in the node set. |
| public void | setEnvironment(Object
The environment object. environment)Set the environment in which this iterator operates, which should provide: a node (the context node... |
| public void | setIsTopLevel(boolean
true if this location path is at the top level of the
expression. b)Set if this is an iterator at the upper level of the XPath. |
| public void | setItem(int
Node to set node, int Index of where to set the node index)Implements com. Sets the node at the specified index of this vector to be the specified node. |
| protected void | setNextPosition(int
A value greater than or equal to zero that indicates the next
node position to fetch. next)Set the next position index of this iterator. |
| public void | setRoot(int
The XPath runtime context for this
transformation. context, Object environment)Implements com. Initialize the context values for this expression after it is cloned. |
| public void | setShouldCacheNodes(boolean
True if this iterator should cache nodes. b)Implements com. If setShouldCacheNodes(true) is called, then nodes will be cached. |
| public int |
| m_allowDetach | back to summary |
|---|---|
| protected boolean m_allowDetach Control over whether it is OK for detach to reset the iterator. | |
| m_cdtm | back to summary |
|---|---|
| protected transient DTM m_cdtm The dtm of the context node. Careful about using this... it may not be the dtm of the current node. | |
| m_clones | back to summary |
|---|---|
| protected transient IteratorPool m_clones The pool for cloned iterators. Iterators need to be cloned because the hold running state, and thus the original iterator expression from the stylesheet pool can not be used. | |
| m_context | back to summary |
|---|---|
| protected transient int m_context The context node for this iterator, which doesn't change through the course of the iteration. | |
| m_currentContextNode | back to summary |
|---|---|
| protected transient int m_currentContextNode The node context from where the expression is being executed from (i.e. for current() support). Different from m_context in that this is the context for the entire expression, rather than the context for the subexpression. | |
| m_execContext | back to summary |
|---|---|
| protected transient XPathContext m_execContext The XPathContext reference, needed for execution of many operations. | |
| m_isTopLevel | back to summary |
|---|---|
| private boolean m_isTopLevel Value determined at compile time, indicates that this is an iterator at the top level of the expression, rather than inside a predicate. | |
| m_lastFetched | back to summary |
|---|---|
| public transient int m_lastFetched The last node that was fetched, usually by nextNode. | |
| m_length | back to summary |
|---|---|
| protected transient int m_length | |
| m_pos | back to summary |
|---|---|
| protected transient int m_pos The current position of the context node. | |
| m_prefixResolver | back to summary |
|---|---|
| private PrefixResolver m_prefixResolver Fast access to the current prefix resolver. It isn't really clear that this is needed.
| |
| m_stackFrame | back to summary |
|---|---|
| pack-priv transient int m_stackFrame The stack frame index for this iterator. | |
| serialVersionUID | back to summary |
|---|---|
| pack-priv static final long serialVersionUID Hides com. | |
| LocPathIterator | back to summary |
|---|---|
| protected LocPathIterator() Create a LocPathIterator object. | |
| LocPathIterator | back to summary |
|---|---|
| protected LocPathIterator(PrefixResolver nscontext) Create a LocPathIterator object.
| |
| LocPathIterator | back to summary |
|---|---|
| protected LocPathIterator(Compiler compiler, int opPos, int analysis) throws TransformerException Create a LocPathIterator object, including creation of step walkers from the opcode list, and call back into the Compiler to create predicate expressions.
| |
| LocPathIterator | back to summary |
|---|---|
| protected LocPathIterator(Compiler compiler, int opPos, int analysis, boolean shouldLoadWalkers) throws TransformerException Create a LocPathIterator object, including creation of step walkers from the opcode list, and call back into the Compiler to create predicate expressions.
| |
| allowDetachToRelease | back to summary |
|---|---|
| public void allowDetachToRelease(boolean allowRelease) Implements com. Specify if it's OK for detach to release the iterator for reuse.
| |
| asIterator | back to summary |
|---|---|
| public DTMIterator asIterator(XPathContext xctxt, int contextNode) throws TransformerException Overrides com. Given an select expression and a context, evaluate the XPath and return the resulting iterator.
| |
| asNode | back to summary |
|---|---|
| public int asNode(XPathContext xctxt) throws TransformerException Overrides com. Return the first node out of the nodeset, if this expression is a nodeset expression. This is the default implementation for nodesets. Derived classes should try and override this and return a value without having to do a clone operation.
| |
| bool | back to summary |
|---|---|
| public boolean bool(XPathContext xctxt) throws TransformerException Overrides com. Evaluate this operation directly to a boolean.
| |
| callVisitors | back to summary |
|---|---|
| public void callVisitors(ExpressionOwner owner, XPathVisitor visitor) Overrides com. Implements com. Doc from com. This will traverse the heararchy, calling the visitor for each member. If the called visitor method returns false, the subtree should not be called. | |
| cloneWithReset | back to summary |
|---|---|
| public DTMIterator cloneWithReset() throws CloneNotSupportedException Implements com. Get a cloned Iterator that is reset to the beginning of the query.
| |
| detach | back to summary |
|---|---|
| public void detach() Implements com. Detaches the iterator from the set which it iterated over, releasing
any computational resources and placing the iterator in the INVALID
state. After | |
| execute | back to summary |
|---|---|
| public XObject execute(XPathContext xctxt) throws TransformerException Overrides com. Execute this iterator, meaning create a clone that can store state, and initialize it for fast execution from the current runtime state. When this is called, no actual query from the current context node is performed.
| |
| executeCharsToContentHandler | back to summary |
|---|---|
| public void executeCharsToContentHandler(XPathContext xctxt, ContentHandler handler) throws TransformerException, SAXException Overrides com. Execute an expression in the XPath runtime context, and return the result of the expression.
| |
| getAnalysisBits | back to summary |
|---|---|
| public int getAnalysisBits() Implements com. Get the analysis bits for this walker, as defined in the WalkerFactory.
| |
| getAxis | back to summary |
|---|---|
| public int getAxis() Implements com. Returns the axis being iterated, if it is known.
| |
| getContext | back to summary |
|---|---|
| public final int getContext() The node context for the iterator.
| |
| getCurrentContextNode | back to summary |
|---|---|
| public final int getCurrentContextNode() The node context from where the expression is being executed from (i.e. for current() support).
| |
| getCurrentNode | back to summary |
|---|---|
| public int getCurrentNode() Implements com. Return the last fetched node. Needed to support the UnionPathIterator.
| |
| getCurrentPos | back to summary |
|---|---|
| public final int getCurrentPos() Implements com. Get the current position, 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.
| |
| getDTM | back to summary |
|---|---|
| public DTM getDTM(int nodeHandle) Implements com. 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.
| |
| getDTMManager | back to summary |
|---|---|
| public DTMManager getDTMManager() Implements com. 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.
| |
| getExpandEntityReferences | back to summary |
|---|---|
| public boolean getExpandEntityReferences() Implements com. The value of this flag determines whether the children of entity
reference nodes are visible to the iterator. If false, they will be
skipped over.
| |
| getFilter | back to summary |
|---|---|
| public DTMFilter getFilter() The filter used to screen nodes. Not used at this time, this is here only to fullfill the DOM NodeIterator interface.
| |
| getFoundLast | back to summary |
|---|---|
| public final boolean getFoundLast() Tells if we've found the last node yet.
| |
| getIsTopLevel | back to summary |
|---|---|
| public boolean getIsTopLevel() Get if this is an iterator at the upper level of the XPath.
| |
| getLastPos | back to summary |
|---|---|
| public int getLastPos(XPathContext xctxt) Implements abstract com. Implements com. Doc from com. Get the index of the last node that can be itterated to. | |
| getLength | back to summary |
|---|---|
| public int getLength() Implements com. The number of nodes in the list. The range of valid child node indices
is 0 to
| |
| getPrefixResolver | back to summary |
|---|---|
| public final PrefixResolver getPrefixResolver() Return the saved reference to the prefix resolver that was in effect when this iterator was created.
| |
| getRoot | back to summary |
|---|---|
| public int getRoot() Implements com. The root node of the Iterator, as specified when it was created.
| |
| getWhatToShow | back to summary |
|---|---|
| public int getWhatToShow() Overrides com. Implements com. This attribute determines which node types are presented via the
iterator. The available set of constants is defined in the
This is somewhat useless at this time, since it doesn't really return information that tells what this iterator will show. It is here only to fullfill the DOM NodeIterator interface.
| |
| getXPathContext | back to summary |
|---|---|
| public final XPathContext getXPathContext() The XPath execution context we are operating on.
| |
| incrementCurrentPos | back to summary |
|---|---|
| public void incrementCurrentPos() Increment the current position in the node set. | |
| isDocOrdered | back to summary |
|---|---|
| public boolean isDocOrdered() Implements com. Returns true if all the nodes in the iteration well be returned in document order.
| |
| isFresh | back to summary |
|---|---|
| public boolean isFresh() Implements com. Tells if this NodeSetDTM is "fresh", in other words, if the first nextNode() that is called will return the first node in the set.
| |
| isMutable | back to summary |
|---|---|
| public boolean isMutable() Implements com. Tells if this iterator can have nodes added to it or set via
the
| |
| isNodesetExpr | back to summary |
|---|---|
| public boolean isNodesetExpr() Overrides com. Tell if the expression is a nodeset expression.
| |
| item | back to summary |
|---|---|
| public int item(int index) Implements com. Returns the
| |
| nextNode | back to summary |
|---|---|
| public abstract int nextNode() Redeclares com. Returns the next node in the set and advances the position of the iterator in the set. After a NodeIterator is created, the first call to nextNode() returns the first node in the set.
| |
| previousNode | back to summary |
|---|---|
| public int previousNode() Implements com. Returns the previous node in the set and moves the position of the iterator backwards in the set.
| |
| readObject | back to summary |
|---|---|
| private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException Hides com. Read the object from a serialization stream.
| |
| reset | back to summary |
|---|---|
| public void reset() Implements com. Reset the iterator. | |
| returnNextNode | back to summary |
|---|---|
| protected int returnNextNode(int nextNode) Bottleneck the return of a next node, to make returns easier from nextNode().
| |
| runTo | back to summary |
|---|---|
| public void runTo(int index) Implements com. 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.
| |
| setCurrentContextNode | back to summary |
|---|---|
| public final void setCurrentContextNode(int n) Set the current context node for this iterator.
| |
| setCurrentPos | back to summary |
|---|---|
| public void setCurrentPos(int i) Implements com. Set the current position in the node set.
| |
| setEnvironment | back to summary |
|---|---|
| public void setEnvironment(Object environment) Set the environment in which this iterator operates, which should provide: a node (the context node... same value as "root" defined below) a pair of non-zero positive integers (the context position and the context size) a set of variable bindings a function library the set of namespace declarations in scope for the expression. At this time the exact implementation of this environment is application dependent. Probably a proper interface will be created fairly soon.
| |
| setIsTopLevel | back to summary |
|---|---|
| public void setIsTopLevel(boolean b) Set if this is an iterator at the upper level of the XPath.
| |
| setItem | back to summary |
|---|---|
| public void setItem(int node, int index) Implements com. 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.
| |
| setNextPosition | back to summary |
|---|---|
| protected void setNextPosition(int next) Set the next position index of this iterator.
| |
| setRoot | back to summary |
|---|---|
| public void setRoot(int context, Object environment) Implements com. Initialize the context values for this expression after it is cloned.
| |
| setShouldCacheNodes | back to summary |
|---|---|
| public void setShouldCacheNodes(boolean b) Implements com. If setShouldCacheNodes(true) is called, then nodes will be cached. They are not cached by default.
| |
| size | back to summary |
|---|---|
| public int size() Get the length of the cached nodes. Note for the moment at least, this only returns the size of the nodes that have been fetched to date, it doesn't attempt to run to the end to make sure we have found everything. This should be reviewed.
| |