Package org.fxmisc.undo.impl
Class FixedSizeChangeQueue<C>
java.lang.Object
org.fxmisc.undo.impl.FixedSizeChangeQueue<C>
- All Implemented Interfaces:
ChangeQueue<C>
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface org.fxmisc.undo.impl.ChangeQueue
ChangeQueue.QueuePosition -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final intprivate final RevisionedChange<C>[]private intprivate longprivate intprivate intprivate long -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate intarrayIndex(int queuePosition) private RevisionedChange<C> fetch(int position) private longfetchRevisionForPosition(int position) voidbooleanhasNext()booleanhasPrev()next()Returns the next item and increases the current position by 1.peekNext()Returns the next item.peekPrev()Returns the previous item.prev()Returns the previous item and decreases the current position by 1.final voidprivate RevisionedChange<C> put(int position, RevisionedChange<C> c) private intrelativize(int arrayPos)
-
Field Details
-
changes
-
capacity
private final int capacity -
start
private int start -
size
private int size -
currentPosition
private int currentPosition -
revision
private long revision -
zeroPositionRevision
private long zeroPositionRevision
-
-
Constructor Details
-
FixedSizeChangeQueue
public FixedSizeChangeQueue(int capacity)
-
-
Method Details
-
hasNext
public boolean hasNext()- Specified by:
hasNextin interfaceChangeQueue<C>
-
hasPrev
public boolean hasPrev()- Specified by:
hasPrevin interfaceChangeQueue<C>
-
peekNext
Description copied from interface:ChangeQueueReturns the next item. Current position stays unchanged.- Specified by:
peekNextin interfaceChangeQueue<C>
-
next
Description copied from interface:ChangeQueueReturns the next item and increases the current position by 1.- Specified by:
nextin interfaceChangeQueue<C>
-
peekPrev
Description copied from interface:ChangeQueueReturns the previous item. Current position stays unchanged.- Specified by:
peekPrevin interfaceChangeQueue<C>
-
prev
Description copied from interface:ChangeQueueReturns the previous item and decreases the current position by 1.- Specified by:
previn interfaceChangeQueue<C>
-
forgetHistory
public void forgetHistory()- Specified by:
forgetHistoryin interfaceChangeQueue<C>
-
push
- Specified by:
pushin interfaceChangeQueue<C>
-
getCurrentPosition
- Specified by:
getCurrentPositionin interfaceChangeQueue<C>
-
fetchRevisionForPosition
private long fetchRevisionForPosition(int position) -
fetch
-
put
-
arrayIndex
private int arrayIndex(int queuePosition) -
relativize
private int relativize(int arrayPos)
-