Class Resolver.Stack

All Implemented Interfaces:
Serializable, Cloneable, Iterable<M>, Collection<M>, Deque<M>, List<M>, Queue<M>, SequencedCollection<M>
Enclosing class:
Resolver<M extends Match>

private class Resolver.Stack extends LinkedList<M>
This is used to store the Match 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.
  • Constructor Details

    • Stack

      private Stack()
  • Method Details

    • push

      public void push(M match)
      The push 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.
      Specified by:
      push in interface Deque<M extends Match>
      Overrides:
      push in class LinkedList<M extends Match>
      Parameters:
      match - this is the match to be inserted to the stack
    • purge

      public void purge(int index)
      The purge 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 Iterator<M> sequence()
      This is returned from the Resolver.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 the Stack object.
      Returns:
      returns an iterator to iterate in insertion order