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
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, positionFields inherited from interface net.sf.saxon.om.SequenceIterator
GROUNDED, LAST_POSITION_FINDER, LOOKAHEAD -
Constructor Summary
ConstructorsConstructorDescriptionAttributeEnumeration(TinyTree tree, int element, NodeTest nodeTest) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionatomize()Return the atomized value of the current node.current()Get the current node in the sequence.Get another iteration over the same nodesReturn the string value of the current node.booleanmoveNext()Move to the next node in the iteration.next()Get the next item in the sequence.Methods inherited from class net.sf.saxon.tree.iter.AxisIteratorImpl
close, getProperties, iterateAxis, position
-
Constructor Details
-
AttributeEnumeration
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 Details
-
moveNext
public boolean moveNext()Move to the next node in the iteration.- Specified by:
moveNextin interfaceAxisIterator- Overrides:
moveNextin classAxisIteratorImpl- Returns:
- true if there is a next node, false if the end of the sequence has been reached
-
next
Get the next item in the sequence.- Returns:
- the next Item. If there are no more nodes, return null.
-
current
Get the current node in the sequence.- Specified by:
currentin interfaceAxisIterator- Specified by:
currentin interfaceSequenceIterator- Specified by:
currentin interfaceUnfailingIterator- Overrides:
currentin classAxisIteratorImpl- Returns:
- the node returned by the most recent call on next(), or the node on which we positioned using moveNext()
-
atomize
Return the atomized value of the current node.- Specified by:
atomizein interfaceAxisIterator- Overrides:
atomizein classAxisIteratorImpl- Returns:
- the atomized value.
- Throws:
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
Return the string value of the current node.- Specified by:
getStringValuein interfaceAxisIterator- Overrides:
getStringValuein classAxisIteratorImpl- Returns:
- the string value, as an instance of CharSequence.
- Throws:
NullPointerException- if there is no current node
-
getAnother
Get another iteration over the same nodes- Returns:
- a new iterator over the same sequence
-