public class History extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
History.Step<T> |
Constructor and Description |
---|
History()
New unlimited history list.
|
History(int max_size) |
Modifier and Type | Method and Description |
---|---|
List<History.Step<?>> |
add(History.Step<?> step)
Append a new step.
|
List<History.Step<?>> |
append(History.Step<?> step)
Appends a step at the end of the list, without modifying the current index.
|
boolean |
canRedo() |
boolean |
canUndo() |
List<History.Step<?>> |
clear()
Remove all steps from the list and return them.
|
List<History.Step<?>> |
clip()
Cut the list after the index, leaving from 0 to index, inclusive, inside.
|
History.Step<?> |
get(int i) |
List<History.Step<?>> |
getAll()
Returns a list with all undo steps.
|
History.Step<?> |
getCurrent() |
int |
index() |
boolean |
indexAtEnd() |
boolean |
indexAtStart() |
History.Step<?> |
redoOneStep()
Returns null if there aren't any more steps to redo.
|
List<?> |
remove(long id)
Empty all elements from each Step in the list that match the given id, and return them.
|
List<History.Step<?>> |
resize(int size)
Resize to maximum the given size, removing from the beginning.
|
int |
size() |
History.Step<?> |
undoOneStep()
Returns null if there aren't any more steps to undo.
|
public History()
public History(int max_size)
public List<History.Step<?>> add(History.Step<?> step)
public List<History.Step<?>> append(History.Step<?> step)
public History.Step<?> getCurrent()
public History.Step<?> undoOneStep()
public History.Step<?> redoOneStep()
public List<?> remove(long id)
public List<History.Step<?>> resize(int size)
public List<History.Step<?>> clear()
public List<History.Step<?>> getAll()
public History.Step<?> get(int i)
public List<History.Step<?>> clip()
public int size()
public int index()
public boolean indexAtStart()
public boolean indexAtEnd()
public boolean canUndo()
public boolean canRedo()
Copyright © 2015–2021 Fiji. All rights reserved.