public class SimpleHistory extends Object implements History
CappedHistory| Constructor and Description |
|---|
SimpleHistory(int slots)
This constructor creates a simple history with limited memory.
|
SimpleHistory(int slots,
boolean allowShift,
boolean allowShrink,
boolean allowExpand)
This constructor creates a simple history with limited memory.
|
SimpleHistory(StringBuffer xml)
This is the constructor for the interface
Storable. |
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
This method clears the history, i.e.
|
SimpleHistory |
clone()
This method returns a deep copy of the instance
|
boolean |
operationAllowed(int... operation)
Returns
true if the specified operation is allowed, i.e. |
void |
operationPerfomed(int... operation)
This method puts an operation to the history.
|
StringBuffer |
toXML()
This method returns an XML representation as
StringBuffer of an
instance of the implementing class. |
public SimpleHistory(int slots)
slots - the number of memory slotsSimpleHistory(int, boolean, boolean, boolean)public SimpleHistory(int slots,
boolean allowShift,
boolean allowShrink,
boolean allowExpand)
slots - the number of memory slotsallowShift - if true shifts are allowallowShrink - if true shrinks are allowallowExpand - if true expands are allowpublic SimpleHistory(StringBuffer xml) throws NonParsableException
Storable.xml - the XML representation as StringBufferNonParsableException - if the XML representation could not be parsedpublic StringBuffer toXML()
StorableStringBuffer of an
instance of the implementing class.public boolean operationAllowed(int... operation)
Historytrue if the specified operation is allowed, i.e. it does not conflict with any operation from the history.operationAllowed in interface Historyoperation - the operation to be testedtrue if the specified operation is allowedpublic void operationPerfomed(int... operation)
HistoryoperationPerfomed in interface Historyoperation - the performed operationpublic void clear()
Historypublic SimpleHistory clone() throws CloneNotSupportedException
Historyclone in interface Historyclone in class ObjectCloneNotSupportedException - if not possibleCloneable,
Object.clone()