org.apache.xpath.axes

Class NodeSequence

Implemented Interfaces:
Cloneable, DTMIterator, ExpressionNode, PathComponent, Serializable, SourceLocator, XPathVisitable
Known Direct Subclasses:
XNodeSet

public class NodeSequence
extends XObject
implements DTMIterator, Cloneable, PathComponent

This class is the dynamic wrapper for a Xalan DTMIterator instance, and provides random access capabilities.
See Also:
Serialized Form

Field Summary

Fields inherited from class org.apache.xpath.objects.XObject

CLASS_BOOLEAN, CLASS_NODESET, CLASS_NULL, CLASS_NUMBER, CLASS_RTREEFRAG, CLASS_STRING, CLASS_UNKNOWN, CLASS_UNRESOLVEDVARIABLE

Fields inherited from interface org.apache.xml.dtm.DTMIterator

FILTER_ACCEPT, FILTER_REJECT, FILTER_SKIP

Constructor Summary

NodeSequence()
Create a new NodeSequence in an invalid (null) state.
NodeSequence(Object nodeVector)
Create a new NodeSequence from a (already cloned) iterator.

Method Summary

void
allowDetachToRelease(boolean allowRelease)
Calling this with a value of false will cause the nodeset to be cached.
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.
DTMIterator
cloneWithReset()
Note: Not a deep clone.
void
detach()
void
fixupVariables(Vector vars, int globalsSize)
int
getAnalysisBits()
int
getAxis()
DTMIterator
getContainedIter()
Get the functional iterator that fetches nodes.
int
getCurrentNode()
int
getCurrentPos()
DTM
getDTM(int nodeHandle)
DTMManager
getDTMManager()
boolean
getExpandEntityReferences()
int
getLength()
int
getRoot()
int
getWhatToShow()
boolean
hasCache()
If the iterator needs to cache nodes as they are fetched, then this method returns true.
boolean
isDocOrdered()
boolean
isFresh()
boolean
isMutable()
int
item(int index)
int
nextNode()
int
previousNode()
void
reset()
void
runTo(int index)
void
setCurrentPos(int i)
void
setItem(int node, int index)
void
setIter(DTMIterator iter)
Set the functional iterator that fetches nodes.
void
setRoot(int nodeHandle, Object environment)
void
setShouldCacheNodes(boolean b)

Methods inherited from class org.apache.xpath.objects.XObject

allowDetachToRelease, appendToFsb, bool, boolWithSideEffects, callVisitors, castToType, create, create, deepEquals, destruct, detach, dispatchCharactersEvents, equals, execute, fixupVariables, getFresh, getType, getTypeString, greaterThan, greaterThanOrEqual, iter, lessThan, lessThanOrEqual, mutableNodeset, nodelist, nodeset, notEquals, num, numWithSideEffects, object, reset, rtf, rtf, rtree, rtree, str, toString, xstr

Methods inherited from class org.apache.xpath.Expression

asIterator, asIteratorRaw, asNode, assertion, bool, canTraverseOutsideSubtree, deepEquals, error, execute, execute, execute, execute, executeCharsToContentHandler, exprAddChild, exprGetChild, exprGetNumChildren, exprGetParent, exprSetParent, fixupVariables, getColumnNumber, getExpressionOwner, getLineNumber, getPublicId, getSystemId, isNodesetExpr, isStableNumber, num, warn, xstr

Constructor Details

NodeSequence

public NodeSequence()
Create a new NodeSequence in an invalid (null) state.

NodeSequence

public NodeSequence(Object nodeVector)
Create a new NodeSequence from a (already cloned) iterator.
Parameters:
nodeVector -

Method Details

allowDetachToRelease

public void allowDetachToRelease(boolean allowRelease)
Calling this with a value of false will cause the nodeset to be cached.
Specified by:
allowDetachToRelease in interface DTMIterator
Overrides:
allowDetachToRelease in interface XObject

clone

public Object clone()
            throws CloneNotSupportedException
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. Note: Not a deep clone.
Specified by:
clone in interface DTMIterator
Returns:
A clone of this object.

cloneWithReset

public DTMIterator cloneWithReset()
            throws CloneNotSupportedException
Note: Not a deep clone.
Specified by:
cloneWithReset in interface DTMIterator

detach

public void detach()
Specified by:
detach in interface DTMIterator
Overrides:
detach in interface XObject

fixupVariables

public void fixupVariables(Vector vars,
                           int globalsSize)
See Also:
org.apache.xpath.Expression.fixupVariables(Vector, int)

getAnalysisBits

public int getAnalysisBits()
Specified by:
getAnalysisBits in interface PathComponent

getAxis

public int getAxis()
Specified by:
getAxis in interface DTMIterator

getContainedIter

public final DTMIterator getContainedIter()
Get the functional iterator that fetches nodes.
Returns:
The contained iterator.

getCurrentNode

public int getCurrentNode()
Specified by:
getCurrentNode in interface DTMIterator

getCurrentPos

public int getCurrentPos()
Specified by:
getCurrentPos in interface DTMIterator

getDTM

public DTM getDTM(int nodeHandle)
Specified by:
getDTM in interface DTMIterator

getDTMManager

public DTMManager getDTMManager()
Specified by:
getDTMManager in interface DTMIterator

getExpandEntityReferences

public boolean getExpandEntityReferences()
Specified by:
getExpandEntityReferences in interface DTMIterator

getLength

public int getLength()
Specified by:
getLength in interface DTMIterator

getRoot

public int getRoot()
Specified by:
getRoot in interface DTMIterator

getWhatToShow

public int getWhatToShow()
Specified by:
getWhatToShow in interface DTMIterator

hasCache

public boolean hasCache()
If the iterator needs to cache nodes as they are fetched, then this method returns true.

isDocOrdered

public boolean isDocOrdered()
Specified by:
isDocOrdered in interface DTMIterator

isFresh

public boolean isFresh()
Specified by:
isFresh in interface DTMIterator

isMutable

public boolean isMutable()
Specified by:
isMutable in interface DTMIterator

item

public int item(int index)
Specified by:
item in interface DTMIterator

nextNode

public int nextNode()
Specified by:
nextNode in interface DTMIterator

previousNode

public int previousNode()
Specified by:
previousNode in interface DTMIterator

reset

public void reset()
Specified by:
reset in interface DTMIterator
Overrides:
reset in interface XObject

runTo

public void runTo(int index)
Specified by:
runTo in interface DTMIterator

setCurrentPos

public void setCurrentPos(int i)
Specified by:
setCurrentPos in interface DTMIterator

setItem

public void setItem(int node,
                    int index)
Specified by:
setItem in interface DTMIterator

setIter

public final void setIter(DTMIterator iter)
Set the functional iterator that fetches nodes.
Parameters:
iter - The iterator that is to be contained.

setRoot

public void setRoot(int nodeHandle,
                    Object environment)
Specified by:
setRoot in interface DTMIterator

setShouldCacheNodes

public void setShouldCacheNodes(boolean b)
Specified by:
setShouldCacheNodes in interface DTMIterator

Copyright © 2006 Apache XML Project. All Rights Reserved.