org.apache.xpath.axes

Class NodeSequence

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.
Constructor Summary
NodeSequence(DTMIterator iter, int context, XPathContext xctxt, boolean shouldCacheNodes)
Create a new NodeSequence from a (already cloned) iterator.
NodeSequence(Object nodeVector)
Create a new NodeSequence from a (already cloned) iterator.
NodeSequence(DTMManager dtmMgr)
Construct an empty XNodeSet object.
NodeSequence()
Create a new NodeSequence in an invalid (null) state.
Method Summary
voidallowDetachToRelease(boolean allowRelease)
Calling this with a value of false will cause the nodeset to be cached.
Objectclone()
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.
DTMIteratorcloneWithReset()
Note: Not a deep clone.
voiddetach()
voidfixupVariables(Vector vars, int globalsSize)
intgetAnalysisBits()
intgetAxis()
DTMIteratorgetContainedIter()
Get the functional iterator that fetches nodes.
intgetCurrentNode()
intgetCurrentPos()
DTMgetDTM(int nodeHandle)
DTMManagergetDTMManager()
booleangetExpandEntityReferences()
intgetLength()
intgetRoot()
intgetWhatToShow()
booleanhasCache()
If this iterator needs to cache nodes that are fetched, they are stored here.
booleanisDocOrdered()
booleanisFresh()
booleanisMutable()
intitem(int index)
intnextNode()
intpreviousNode()
voidreset()
voidrunTo(int index)
voidsetCurrentPos(int i)
voidsetItem(int node, int index)
voidsetIter(DTMIterator iter)
Set the functional iterator that fetches nodes.
voidsetRoot(int nodeHandle, Object environment)
voidsetShouldCacheNodes(boolean b)

Constructor Detail

NodeSequence

public NodeSequence(DTMIterator iter, int context, XPathContext xctxt, boolean shouldCacheNodes)
Create a new NodeSequence from a (already cloned) iterator.

Parameters: iter Cloned (not static) DTMIterator. context The initial context node. xctxt The execution context. shouldCacheNodes True if this sequence can random access.

NodeSequence

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

Parameters: nodeVector

NodeSequence

public NodeSequence(DTMManager dtmMgr)
Construct an empty XNodeSet object. This is used to create a mutable nodeset to which random nodes may be added.

NodeSequence

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

Method Detail

allowDetachToRelease

public void allowDetachToRelease(boolean allowRelease)
Calling this with a value of false will cause the nodeset to be cached.

See Also: DTMIterator

clone

public 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. Note: Not a deep clone.

Returns: A clone of this object.

Throws: CloneNotSupportedException

cloneWithReset

public DTMIterator cloneWithReset()
Note: Not a deep clone.

See Also: cloneWithReset

detach

public void detach()

See Also: detach

fixupVariables

public void fixupVariables(Vector vars, int globalsSize)

See Also: Expression

getAnalysisBits

public int getAnalysisBits()

See Also: getAnalysisBits

getAxis

public int getAxis()

See Also: getAxis

getContainedIter

public final DTMIterator getContainedIter()
Get the functional iterator that fetches nodes.

Returns: The contained iterator.

getCurrentNode

public int getCurrentNode()

See Also: getCurrentNode

getCurrentPos

public int getCurrentPos()

See Also: getCurrentPos

getDTM

public DTM getDTM(int nodeHandle)

See Also: DTMIterator

getDTMManager

public DTMManager getDTMManager()

See Also: getDTMManager

getExpandEntityReferences

public boolean getExpandEntityReferences()

See Also: getExpandEntityReferences

getLength

public int getLength()

See Also: getLength

getRoot

public int getRoot()

See Also: getRoot

getWhatToShow

public int getWhatToShow()

See Also: getWhatToShow

hasCache

public boolean hasCache()
If this iterator needs to cache nodes that are fetched, they are stored here.

isDocOrdered

public boolean isDocOrdered()

See Also: isDocOrdered

isFresh

public boolean isFresh()

See Also: isFresh

isMutable

public boolean isMutable()

See Also: isMutable

item

public int item(int index)

See Also: DTMIterator

nextNode

public int nextNode()

See Also: nextNode

previousNode

public int previousNode()

See Also: previousNode

reset

public void reset()

See Also: reset

runTo

public void runTo(int index)

See Also: DTMIterator

setCurrentPos

public void setCurrentPos(int i)

See Also: DTMIterator

setItem

public void setItem(int node, int index)

See Also: 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)

See Also: DTMIterator

setShouldCacheNodes

public void setShouldCacheNodes(boolean b)

See Also: DTMIterator

Copyright B) 2005 Apache XML Project. All Rights Reserved.