public class BlockOptimizedHistory extends ArrayListHistory
ArrayListHistory that stores BlockChanges
separately in two ArrayLists.
Whether this is a good idea or not is highly questionable, but this class exists because this is how history was implemented in WorldEdit for many years.
| Constructor and Description |
|---|
BlockOptimizedHistory() |
| Modifier and Type | Method and Description |
|---|---|
void |
add(Change change)
Add the given change to the history.
|
Iterator<Change> |
backwardIterator()
Get a backward directed iterator that can be used for undo.
|
Iterator<Change> |
forwardIterator()
Get a forward directed iterator that can be used for redo.
|
int |
size()
Get the number of stored changes.
|
public void add(Change change)
ChangeSetadd in interface ChangeSetadd in class ArrayListHistorychange - the changepublic Iterator<Change> forwardIterator()
ChangeSetThe iterator may return the changes out of order, as long as the final result after all changes have been applied is correct.
forwardIterator in interface ChangeSetforwardIterator in class ArrayListHistorypublic Iterator<Change> backwardIterator()
ChangeSetThe iterator may return the changes out of order, as long as the final result after all changes have been applied is correct.
backwardIterator in interface ChangeSetbackwardIterator in class ArrayListHistorypublic int size()
ChangeSetsize in interface ChangeSetsize in class ArrayListHistoryCopyright © 2010-2014. All Rights Reserved.