Package org.simpleframework.xml.util
Class Resolver.Stack
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- java.util.AbstractSequentialList<E>
-
- java.util.LinkedList<M>
-
- org.simpleframework.xml.util.Resolver.Stack
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,java.lang.Iterable<M>
,java.util.Collection<M>
,java.util.Deque<M>
,java.util.List<M>
,java.util.Queue<M>
private class Resolver.Stack extends java.util.LinkedList<M>
This is used to store theMatch
implementations in resolution order. Resolving the match objects is performed so that the last inserted match object is the first used in the resolution process. This gives priority to the last inserted.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private class
Resolver.Stack.Sequence
The is used to order theMatch
objects in the insertion order.
-
Constructor Summary
Constructors Modifier Constructor Description private
Stack()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
purge(int index)
Thepurge
method is used to purge a match from the provided position.void
push(M match)
Thepush
method is used to push the match to the top of the stack.java.util.Iterator<M>
sequence()
This is returned from theResolver.iterator
so that matches can be iterated in insertion order.-
Methods inherited from class java.util.LinkedList
add, add, addAll, addAll, addFirst, addLast, clear, clone, contains, descendingIterator, element, get, getFirst, getLast, indexOf, lastIndexOf, listIterator, offer, offerFirst, offerLast, peek, peekFirst, peekLast, poll, pollFirst, pollLast, pop, remove, remove, remove, removeFirst, removeFirstOccurrence, removeLast, removeLastOccurrence, set, size, spliterator, toArray, toArray
-
Methods inherited from class java.util.AbstractList
equals, hashCode, listIterator, removeRange, subList
-
Methods inherited from class java.util.AbstractCollection
containsAll, isEmpty, removeAll, retainAll, toString
-
-
-
-
Method Detail
-
push
public void push(M match)
Thepush
method is used to push the match to the top of the stack. This also ensures that the cache is cleared so the semantics of the resolver are not affected.
-
purge
public void purge(int index)
Thepurge
method is used to purge a match from the provided position. This also ensures that the cache is cleared so that the semantics of the resolver do not change.- Parameters:
index
- the index of the match that is to be removed
-
sequence
public java.util.Iterator<M> sequence()
This is returned from theResolver.iterator
so that matches can be iterated in insertion order. When a match is removed from this iterator then it clears the cache and removed the match from theStack
object.- Returns:
- returns an iterator to iterate in insertion order
-
-