Class OutputStack.Sequence

java.lang.Object
org.simpleframework.xml.stream.OutputStack.Sequence
All Implemented Interfaces:
Iterator<OutputNode>
Enclosing class:
OutputStack

private class OutputStack.Sequence extends Object implements Iterator<OutputNode>
The is used to order the OutputNode objects from the top down. This is basically used to reverse the order of the linked list so that the stack can be iterated within a for each loop easily. This can also be used to remove a node.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private int
    The cursor used to acquire objects from the stack.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructor for the Sequence object.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    This is used to determine if the cursor has reached the start of the list.
    Returns the OutputNode object at the cursor position.
    void
    Removes the match from the cursor position.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface java.util.Iterator

    forEachRemaining
  • Field Details

    • cursor

      private int cursor
      The cursor used to acquire objects from the stack.
  • Constructor Details

    • Sequence

      public Sequence()
      Constructor for the Sequence object. This is used to position the cursor at the end of the list so the last inserted output node is the first returned from this.
  • Method Details

    • next

      public OutputNode next()
      Returns the OutputNode object at the cursor position. If the cursor has reached the start of the list then this returns null instead of the first output node.
      Specified by:
      next in interface Iterator<OutputNode>
      Returns:
      this returns the node from the cursor position
    • hasNext

      public boolean hasNext()
      This is used to determine if the cursor has reached the start of the list. When the cursor reaches the start of the list then this method returns false.
      Specified by:
      hasNext in interface Iterator<OutputNode>
      Returns:
      this returns true if there are more nodes left
    • remove

      public void remove()
      Removes the match from the cursor position. This also ensures that the node is removed from the active set so that it is not longer considered a relevant output node.
      Specified by:
      remove in interface Iterator<OutputNode>