|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.jstacs.motifDiscovery.history.RestrictedRepeatHistory
public class RestrictedRepeatHistory
This class implements a history that allows operations (i.e. a pair of
int
), that are not a priorily forbidden and that are done before
less than a specified threshold. This enables the user for instance to allow
each operation exactly once. Furthermore, this class has a switch that allows
to forbid an operation for which the reverse operation has been performed in the
last step.
If shrink operations are allowed by the user then a shrink operation is allow anytime.
This helps to keep the motif short.
Constructor Summary | |
---|---|
RestrictedRepeatHistory()
This constructor creates an instance that allows to shift, shrink, and expand the motif, to do the reverse operation, and to do each operation at most once. |
|
RestrictedRepeatHistory(boolean allowReverse)
This constructor creates an instance that allows to shift, shrink, and expand the motif, and allows to do each operation at most once. |
|
RestrictedRepeatHistory(boolean allowShift,
boolean allowShrink,
boolean allowExpand)
This constructor creates an instance that allows to do each operation at most once. |
|
RestrictedRepeatHistory(boolean allowShift,
boolean allowShrink,
boolean allowExpand,
boolean allowReverse,
int threshold)
This constructor creates an instance with user specified allowed operations and threshold . |
|
RestrictedRepeatHistory(int threshold)
This constructor creates an instance that allows to shift shrink and expand the motif. |
|
RestrictedRepeatHistory(StringBuffer xml)
This is the constructor for the interface Storable . |
Method Summary | |
---|---|
void |
clear()
This method clears the history, i.e. it removes all operations from the history. |
RestrictedRepeatHistory |
clone()
This method returns a deep copy of the instance |
boolean |
operationAllowed(int... op)
Returns true if the specified operation is allowed, i.e. it does not conflict with any operation from the history. |
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. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RestrictedRepeatHistory()
public RestrictedRepeatHistory(boolean allowReverse)
allowReverse
- whether it is allowed to do the reverse operation as next operation or notpublic RestrictedRepeatHistory(int threshold)
threshold
- the number of times each operation can be done
IllegalArgumentException
- if the threshold
is below 1public RestrictedRepeatHistory(boolean allowShift, boolean allowShrink, boolean allowExpand)
allowShift
- whether it is allowed to shift the motifallowShrink
- whether it is allowed to shrink the motifallowExpand
- whether it is allowed to expand the motifpublic RestrictedRepeatHistory(boolean allowShift, boolean allowShrink, boolean allowExpand, boolean allowReverse, int threshold) throws IllegalArgumentException
threshold
.
allowShift
- whether it is allowed to shift the motifallowShrink
- whether it is allowed to shrink the motifallowExpand
- whether it is allowed to expand the motifallowReverse
- whether it is allowed to do the reverse operation as next operation or notthreshold
- the number of times each operation can be done
IllegalArgumentException
- if the threshold
is below 1public RestrictedRepeatHistory(StringBuffer xml) throws NonParsableException
Storable
.
xml
- the XML representation as StringBuffer
NonParsableException
- if the XML representation could not be parsedMethod Detail |
---|
public StringBuffer toXML()
Storable
StringBuffer
of an
instance of the implementing class.
toXML
in interface Storable
public RestrictedRepeatHistory clone() throws CloneNotSupportedException
History
clone
in interface History
clone
in class Object
CloneNotSupportedException
- if not possibleCloneable
,
Object.clone()
public void clear()
History
clear
in interface 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 tested
true
if the specified operation is allowedpublic void operationPerfomed(int... op)
History
operationPerfomed
in interface History
op
- the performed operation
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |