Package net.sf.saxon.tree.tiny
Class AttributeEnumeration
- java.lang.Object
-
- net.sf.saxon.tree.iter.AxisIteratorImpl
-
- net.sf.saxon.tree.tiny.AttributeEnumeration
-
- All Implemented Interfaces:
SequenceIterator
,AxisIterator
,UnfailingIterator
final class AttributeEnumeration extends AxisIteratorImpl
AttributeEnumeration is an iterator over all the attribute nodes of an Element.
-
-
Field Summary
-
Fields inherited from class net.sf.saxon.tree.iter.AxisIteratorImpl
current, position
-
Fields inherited from interface net.sf.saxon.om.SequenceIterator
GROUNDED, LAST_POSITION_FINDER, LOOKAHEAD
-
-
Constructor Summary
Constructors Constructor Description AttributeEnumeration(TinyTree tree, int element, NodeTest nodeTest)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Value
atomize()
Return the atomized value of the current node.NodeInfo
current()
Get the current node in the sequence.AxisIterator
getAnother()
Get another iteration over the same nodesjava.lang.CharSequence
getStringValue()
Return the string value of the current node.boolean
moveNext()
Move to the next node in the iteration.NodeInfo
next()
Get the next item in the sequence.-
Methods inherited from class net.sf.saxon.tree.iter.AxisIteratorImpl
close, getProperties, iterateAxis, position
-
-
-
-
Constructor Detail
-
AttributeEnumeration
AttributeEnumeration(TinyTree tree, int element, NodeTest nodeTest)
Constructor. Note: this constructor will only be called if the relevant node is an element and if it has one or more attributes. Otherwise an EmptyEnumeration will be constructed instead.- Parameters:
tree
- : the containing TinyTreeelement
- : the node number of the element whose attributes are requirednodeTest
- : condition to be applied to the names of the attributes selected
-
-
Method Detail
-
moveNext
public boolean moveNext()
Move to the next node in the iteration.- Specified by:
moveNext
in interfaceAxisIterator
- Overrides:
moveNext
in classAxisIteratorImpl
- Returns:
- true if there is a next node, false if the end of the sequence has been reached
-
next
public NodeInfo next()
Get the next item in the sequence.- Returns:
- the next Item. If there are no more nodes, return null.
-
current
public NodeInfo current()
Get the current node in the sequence.- Specified by:
current
in interfaceAxisIterator
- Specified by:
current
in interfaceSequenceIterator
- Specified by:
current
in interfaceUnfailingIterator
- Overrides:
current
in classAxisIteratorImpl
- Returns:
- the node returned by the most recent call on next(), or the node on which we positioned using moveNext()
-
atomize
public Value atomize() throws XPathException
Return the atomized value of the current node.- Specified by:
atomize
in interfaceAxisIterator
- Overrides:
atomize
in classAxisIteratorImpl
- Returns:
- the atomized value.
- Throws:
java.lang.NullPointerException
- if there is no current nodeXPathException
- if the current node cannot be atomized, for example because it is an element node with element-only content.
-
getStringValue
public java.lang.CharSequence getStringValue()
Return the string value of the current node.- Specified by:
getStringValue
in interfaceAxisIterator
- Overrides:
getStringValue
in classAxisIteratorImpl
- Returns:
- the string value, as an instance of CharSequence.
- Throws:
java.lang.NullPointerException
- if there is no current node
-
getAnother
public AxisIterator getAnother()
Get another iteration over the same nodes- Returns:
- a new iterator over the same sequence
-
-