Class UnlimitedChangeQueue<C>

java.lang.Object
org.fxmisc.undo.impl.UnlimitedChangeQueue<C>
All Implemented Interfaces:
ChangeQueue<C>

public class UnlimitedChangeQueue<C> extends Object implements ChangeQueue<C>
  • Field Details

    • changes

      private final ArrayList<RevisionedChange<C>> changes
    • currentPosition

      private int currentPosition
    • revision

      private long revision
    • zeroPositionRevision

      private long zeroPositionRevision
    • forgottenCount

      private int forgottenCount
  • Constructor Details

    • UnlimitedChangeQueue

      public UnlimitedChangeQueue()
  • Method Details

    • hasNext

      public final boolean hasNext()
      Specified by:
      hasNext in interface ChangeQueue<C>
    • hasPrev

      public final boolean hasPrev()
      Specified by:
      hasPrev in interface ChangeQueue<C>
    • peekNext

      public final C peekNext()
      Description copied from interface: ChangeQueue
      Returns the next item. Current position stays unchanged.
      Specified by:
      peekNext in interface ChangeQueue<C>
    • next

      public final C next()
      Description copied from interface: ChangeQueue
      Returns the next item and increases the current position by 1.
      Specified by:
      next in interface ChangeQueue<C>
    • peekPrev

      public final C peekPrev()
      Description copied from interface: ChangeQueue
      Returns the previous item. Current position stays unchanged.
      Specified by:
      peekPrev in interface ChangeQueue<C>
    • prev

      public final C prev()
      Description copied from interface: ChangeQueue
      Returns the previous item and decreases the current position by 1.
      Specified by:
      prev in interface ChangeQueue<C>
    • forgetHistory

      public void forgetHistory()
      Specified by:
      forgetHistory in interface ChangeQueue<C>
    • push

      @SafeVarargs public final void push(C... changes)
      Specified by:
      push in interface ChangeQueue<C>
    • getCurrentPosition

      public ChangeQueue.QueuePosition getCurrentPosition()
      Specified by:
      getCurrentPosition in interface ChangeQueue<C>
    • revisionForPosition

      private long revisionForPosition(int position)