APIdia Launch Partner
Top Description Fields Constructors Methods
com.sun.org.apache.xalan.internal.xsltc.dom

public final Class CurrentNodeListIterator

extends DTMAxisIteratorBase
Class Inheritance
Imports
com.sun.org.apache.xalan.internal.xsltc.runtime.AbstractTranslet, .BasisLibrary, com.sun.org.apache.xalan.internal.xsltc.util.IntegerArray, com.sun.org.apache.xml.internal.dtm.DTMAxisIterator, com.sun.org.apache.xml.internal.dtm.ref.DTMAxisIteratorBase

Iterators of this kind use a CurrentNodeListFilter to filter a subset of nodes from a source iterator. For each node from the source, the boolean method CurrentNodeListFilter.test() is called. All nodes from the source are read into an array upon calling setStartNode() (this is needed to determine the value of last, a parameter to CurrentNodeListFilter.test()). The method getLast() returns the last element after applying the filter.
Authors
Jacek Ambroziak, Santiago Pericas-Geertsen, Morten Jorgensen

Field Summary

Modifier and TypeField and Description
private int
_currentIndex

Index in _nodes of the next node to filter.

private final int
_currentNode

The current node in the stylesheet at the time of evaluation.

private boolean
_docOrder

A flag indicating if nodes are returned in document order.

private final CurrentNodeListFilter
_filter

A reference to a filter object.

private IntegerArray
_nodes

An integer array to store nodes from source iterator.

private DTMAxisIterator
_source

The source for this iterator.

private AbstractTranslet
_translet

A reference to the translet.

Inherited from com.sun.org.apache.xml.internal.dtm.ref.DTMAxisIteratorBase:
_includeSelf_isRestartable_last_markedNode_position_startNode

Constructor Summary

AccessConstructor and Description
public
public
CurrentNodeListIterator(DTMAxisIterator source, boolean docOrder, CurrentNodeListFilter filter, int currentNode, AbstractTranslet translet)

Method Summary

Modifier and TypeMethod and Description
public DTMAxisIterator
private int
public DTMAxisIterator
public int
getLast()

Overrides com.sun.org.apache.xml.internal.dtm.ref.DTMAxisIteratorBase.getLast.

Implements com.sun.org.apache.xml.internal.dtm.DTMAxisIterator.getLast.

Returns the position of the last node within the iteration, as defined by XPath.

public void
gotoMark()

Implements com.sun.org.apache.xml.internal.dtm.DTMAxisIterator.gotoMark.

Restores the current node remembered by setMark().

public boolean
public int
next()

Implements com.sun.org.apache.xml.internal.dtm.DTMAxisIterator.next.

Get the next node in the iteration.

public DTMAxisIterator
public void
setMark()

Implements com.sun.org.apache.xml.internal.dtm.DTMAxisIterator.setMark.

Remembers the current node for the next call to gotoMark().

public void
public DTMAxisIterator
setStartNode(int node)

Implements com.sun.org.apache.xml.internal.dtm.DTMAxisIterator.setStartNode.

Set start to END should 'close' the iterator, i.e. subsequent call to next() should return END.

Inherited from com.sun.org.apache.xml.internal.dtm.ref.DTMAxisIteratorBase:
getAxisgetNodeByPositiongetPositiongetStartNodeincludeSelfisDocOrderedresetPositionreturnNode

Field Detail

_currentIndexback to summary
private int _currentIndex

Index in _nodes of the next node to filter.

_currentNodeback to summary
private final int _currentNode

The current node in the stylesheet at the time of evaluation.

_docOrderback to summary
private boolean _docOrder

A flag indicating if nodes are returned in document order.

_filterback to summary
private final CurrentNodeListFilter _filter

A reference to a filter object.

_nodesback to summary
private IntegerArray _nodes

An integer array to store nodes from source iterator.

_sourceback to summary
private DTMAxisIterator _source

The source for this iterator.

_transletback to summary
private AbstractTranslet _translet

A reference to the translet.

Constructor Detail

CurrentNodeListIteratorback to summary
public CurrentNodeListIterator(DTMAxisIterator source, CurrentNodeListFilter filter, int currentNode, AbstractTranslet translet)
CurrentNodeListIteratorback to summary
public CurrentNodeListIterator(DTMAxisIterator source, boolean docOrder, CurrentNodeListFilter filter, int currentNode, AbstractTranslet translet)

Method Detail

cloneIteratorback to summary
public DTMAxisIterator cloneIterator()

Overrides com.sun.org.apache.xml.internal.dtm.ref.DTMAxisIteratorBase.cloneIterator.

Implements com.sun.org.apache.xml.internal.dtm.DTMAxisIterator.cloneIterator.

Doc from com.sun.org.apache.xml.internal.dtm.ref.DTMAxisIteratorBase.cloneIterator.

Returns a deep copy of this iterator. Cloned iterators may not be restartable. The iterator being cloned may or may not become non-restartable as a side effect of this operation.

computePositionOfLastback to summary
private int computePositionOfLast()
forceNaturalOrderback to summary
public DTMAxisIterator forceNaturalOrder()
getLastback to summary
public int getLast()

Overrides com.sun.org.apache.xml.internal.dtm.ref.DTMAxisIteratorBase.getLast.

Implements com.sun.org.apache.xml.internal.dtm.DTMAxisIterator.getLast.

Doc from com.sun.org.apache.xml.internal.dtm.ref.DTMAxisIteratorBase.getLast.

Returns the position of the last node within the iteration, as defined by XPath. In a forward iterator, I believe this equals the number of nodes which this iterator will yield. In a reverse iterator, I believe it should return 1 (since the "last" is the first produced.) This may be an expensive operation when called the first time, since it may have to iterate through a large part of the document to produce its answer.

gotoMarkback to summary
public void gotoMark()

Implements com.sun.org.apache.xml.internal.dtm.DTMAxisIterator.gotoMark.

Doc from com.sun.org.apache.xml.internal.dtm.DTMAxisIterator.gotoMark.

Restores the current node remembered by setMark().

isReverseback to summary
public boolean isReverse()

Overrides com.sun.org.apache.xml.internal.dtm.ref.DTMAxisIteratorBase.isReverse.

Implements com.sun.org.apache.xml.internal.dtm.DTMAxisIterator.isReverse.

nextback to summary
public int next()

Implements com.sun.org.apache.xml.internal.dtm.DTMAxisIterator.next.

Doc from com.sun.org.apache.xml.internal.dtm.DTMAxisIterator.next.

Get the next node in the iteration.

resetback to summary
public DTMAxisIterator reset()

Overrides com.sun.org.apache.xml.internal.dtm.ref.DTMAxisIteratorBase.reset.

Implements com.sun.org.apache.xml.internal.dtm.DTMAxisIterator.reset.

Doc from com.sun.org.apache.xml.internal.dtm.DTMAxisIterator.reset.

Resets the iterator to the last start node.

setMarkback to summary
public void setMark()

Implements com.sun.org.apache.xml.internal.dtm.DTMAxisIterator.setMark.

Doc from com.sun.org.apache.xml.internal.dtm.DTMAxisIterator.setMark.

Remembers the current node for the next call to gotoMark().

setRestartableback to summary
public void setRestartable(boolean isRestartable)

Overrides com.sun.org.apache.xml.internal.dtm.ref.DTMAxisIteratorBase.setRestartable.

Implements com.sun.org.apache.xml.internal.dtm.DTMAxisIterator.setRestartable.

Doc from com.sun.org.apache.xml.internal.dtm.DTMAxisIterator.setRestartable.

Set if restartable.

setStartNodeback to summary
public DTMAxisIterator setStartNode(int node)

Implements com.sun.org.apache.xml.internal.dtm.DTMAxisIterator.setStartNode.

Doc from com.sun.org.apache.xml.internal.dtm.DTMAxisIterator.setStartNode.

Set start to END should 'close' the iterator, i.e. subsequent call to next() should return END.