Constructor and Description |
---|
CappedHistory(int t,
History h)
This constructor creates an instance that allows at most
t steps using the history h . |
CappedHistory(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.
|
CappedHistory |
clone()
This method returns a deep copy of the instance
|
boolean |
operationAllowed(int... op)
Returns
true if the specified operation is allowed, i.e. |
void |
operationPerfomed(int... op)
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 CappedHistory(int t, History h) throws CloneNotSupportedException
t
steps using the history h
.t
- the maximal number of steps/operationsh
- the underlying historyCloneNotSupportedException
- is the history h
could not be clonedpublic CappedHistory(StringBuffer xml) throws NonParsableException
Storable
.xml
- the XML representation as StringBuffer
NonParsableException
- if the XML representation could not be parsedpublic StringBuffer toXML()
Storable
StringBuffer
of an
instance of the implementing class.public CappedHistory clone() throws CloneNotSupportedException
History
clone
in interface History
clone
in class Object
CloneNotSupportedException
- if not possibleCloneable
,
Object.clone()
public void clear()
History
public boolean operationAllowed(int... op)
History
true
if the specified operation is allowed, i.e. it does not conflict with any operation from the history.operationAllowed
in interface History
op
- the operation to be testedtrue
if the specified operation is allowedpublic void operationPerfomed(int... op)
History
operationPerfomed
in interface History
op
- the performed operation