public class History<T>
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private int |
pos |
private java.util.ArrayList<T> |
stack |
Constructor and Description |
---|
History() |
Modifier and Type | Method and Description |
---|---|
boolean |
canRedo() |
boolean |
canUndo() |
void |
clear() |
private void |
clearRedo()
Clear all entries in front of the current position.
|
T |
current() |
java.util.List<T> |
entries() |
T |
get(int position) |
int |
position() |
T |
redo() |
int |
size() |
void |
store(T state)
Store the current state of the model.
|
T |
undo() |
private int pos
private java.util.ArrayList<T> stack
public boolean canRedo()
public boolean canUndo()
public void clear()
private void clearRedo()
public T current()
public java.util.List<T> entries()
public T get(int position)
public int position()
public T redo()
public int size()
public void store(T state)
state
- The current state of the model.public T undo()