Package org.simpleframework.xml.stream
Class OutputStack.Sequence
- java.lang.Object
-
- org.simpleframework.xml.stream.OutputStack.Sequence
-
- All Implemented Interfaces:
java.util.Iterator<OutputNode>
- Enclosing class:
- OutputStack
private class OutputStack.Sequence extends java.lang.Object implements java.util.Iterator<OutputNode>
The is used to order theOutputNodeobjects 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 intcursorThe cursor used to acquire objects from the stack.
-
Constructor Summary
Constructors Constructor Description Sequence()Constructor for theSequenceobject.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanhasNext()This is used to determine if the cursor has reached the start of the list.OutputNodenext()Returns theOutputNodeobject at the cursor position.voidremove()Removes the match from the cursor position.
-
-
-
Method Detail
-
next
public OutputNode next()
Returns theOutputNodeobject 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:
nextin interfacejava.util.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:
hasNextin interfacejava.util.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:
removein interfacejava.util.Iterator<OutputNode>
-
-