Class AttributeIterator

java.lang.Object
com.saxonica.ee.stream.om.AttributeIterator
All Implemented Interfaces:
Closeable, AutoCloseable, SequenceIterator, AxisIterator, LookaheadIterator

public final class AttributeIterator extends Object implements AxisIterator, LookaheadIterator
AttributeIterator iterates over all the attribute nodes of a streamed Element node.
  • Constructor Details

    • AttributeIterator

      public AttributeIterator(FleetingElementNode element, AttributeMap attributes)
      Constructor
      Parameters:
      element - the element whose attributes are required.
  • Method Details

    • supportsHasNext

      public boolean supportsHasNext()
      Description copied from interface: LookaheadIterator
      Ask whether the hasNext() method can be called. This method must be called before calling hasNext(), because some iterators implement this interface, but only support look-ahead under particular circumstances (this is usually because they delegate to another iterator)
      Specified by:
      supportsHasNext in interface LookaheadIterator
      Returns:
      true if the LookaheadIterator.hasNext() method is available
    • hasNext

      public boolean hasNext()
      Test if there are more nodes still to come. ("elements" is used here in the sense of the Java enumeration class, not in the XML sense)
      Specified by:
      hasNext in interface LookaheadIterator
      Returns:
      true if there are more items in the sequence
    • next

      public NodeInfo next()
      Get the next node in the iteration, or null if there are no more.
      Specified by:
      next in interface AxisIterator
      Specified by:
      next in interface SequenceIterator
      Returns:
      the next item, or null if there are no more items. Once a call on next() has returned null, no further calls should be made. The preferred action for an iterator if subsequent calls on next() are made is to return null again, and all implementations within Saxon follow this rule.