net.sf.saxon.tinytree
Class AttributeEnumeration

java.lang.Object
  extended by net.sf.saxon.om.AxisIteratorImpl
      extended by net.sf.saxon.tinytree.AttributeEnumeration
All Implemented Interfaces:
AxisIterator, SequenceIterator, 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.om.AxisIteratorImpl
current, position
 
Fields inherited from interface net.sf.saxon.om.SequenceIterator
GROUNDED, LAST_POSITION_FINDER, LOOKAHEAD
 
Constructor Summary
AttributeEnumeration(TinyTree tree, int element, NodeTest nodeTest)
          Constructor.
 
Method Summary
 Value atomize()
          Return the atomized value of the current node.
 Item current()
          Get the current node in the sequence.
 SequenceIterator getAnother()
          Get another iteration over the same nodes
 CharSequence getStringValue()
          Return the string value of the current node.
 boolean moveNext()
          Move to the next node in the iteration.
 Item next()
          Get the next item in the sequence.
 
Methods inherited from class net.sf.saxon.om.AxisIteratorImpl
close, getProperties, iterateAxis, position
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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 TinyTree
element: - the node number of the element whose attributes are required
nodeTest: - 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 interface AxisIterator
Overrides:
moveNext in class AxisIteratorImpl

next

public Item next()
Get the next item in the sequence.

Returns:
the next Item. If there are no more nodes, return null.

current

public Item current()
Get the current node in the sequence.

Specified by:
current in interface SequenceIterator
Specified by:
current in interface UnfailingIterator
Overrides:
current in class AxisIteratorImpl
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 interface AxisIterator
Overrides:
atomize in class AxisIteratorImpl
Returns:
the atomized value.
Throws:
NullPointerException - if there is no current node
XPathException

getStringValue

public CharSequence getStringValue()
Return the string value of the current node.

Specified by:
getStringValue in interface AxisIterator
Overrides:
getStringValue in class AxisIteratorImpl
Returns:
the string value, as an instance of CharSequence.
Throws:
NullPointerException - if there is no current node

getAnother

public SequenceIterator getAnother()
Get another iteration over the same nodes

Returns:
a SequenceIterator that iterates over the same items, positioned before the first item