com.icl.saxon.tinytree

Class PrecedingEnumeration

Implemented Interfaces:
AxisEnumeration, LastPositionFinder, NodeEnumeration

(package private) final class PrecedingEnumeration
extends Object
implements AxisEnumeration

Enumerate all the nodes on the preceding axis from a given start node. The calling code ensures that the start node is not a root, attribute, or namespace node. As well as the standard XPath preceding axis, this class also implements a Saxon-specific "preceding-or-ancestor" axis which returns ancestor nodes as well as preceding nodes. This is used when performing xsl:number level="any".

Field Summary

(package private) TinyDocumentImpl
document
(package private) boolean
includeAncestors
(package private) int
last
(package private) int
nextAncestorDepth
(package private) int
nextNodeNr
(package private) TinyNodeImpl
startNode
(package private) NodeTest
test

Constructor Summary

PrecedingEnumeration(TinyDocumentImpl doc, TinyNodeImpl node, NodeTest nodeTest, boolean includeAncestors)

Method Summary

int
getLastPosition()
Get the last position, that is the number of nodes in the enumeration
boolean
hasMoreElements()
Determine whether there are more nodes to come.
boolean
isPeer()
boolean
isReverseSorted()
boolean
isSorted()
NodeInfo
nextElement()
Get the next node in sequence.

Field Details

document

(package private)  TinyDocumentImpl document

includeAncestors

(package private)  boolean includeAncestors

last

(package private)  int last

nextAncestorDepth

(package private)  int nextAncestorDepth

nextNodeNr

(package private)  int nextNodeNr

startNode

(package private)  TinyNodeImpl startNode

test

(package private)  NodeTest test

Constructor Details

PrecedingEnumeration

public PrecedingEnumeration(TinyDocumentImpl doc,
                            TinyNodeImpl node,
                            NodeTest nodeTest,
                            boolean includeAncestors)

Method Details

getLastPosition

public int getLastPosition()
Get the last position, that is the number of nodes in the enumeration
Specified by:
getLastPosition in interface AxisEnumeration
getLastPosition in interface LastPositionFinder

hasMoreElements

public boolean hasMoreElements()
Determine whether there are more nodes to come.
(Note the term "Element" is used here in the sense of the standard Java Enumeration class, it has nothing to do with XML elements).
Specified by:
hasMoreElements in interface AxisEnumeration
hasMoreElements in interface NodeEnumeration
Returns:
true if there are more nodes

isPeer

public boolean isPeer()
Specified by:
isPeer in interface NodeEnumeration

isReverseSorted

public boolean isReverseSorted()
Specified by:
isReverseSorted in interface NodeEnumeration

isSorted

public boolean isSorted()
Specified by:
isSorted in interface NodeEnumeration

nextElement

public NodeInfo nextElement()
Get the next node in sequence.
(Note the term "Element" is used here in the sense of the standard Java Enumeration class, it has nothing to do with XML elements).
Specified by:
nextElement in interface AxisEnumeration
nextElement in interface NodeEnumeration
Returns:
the next NodeInfo