Class SymbolCounterObservableSUL<S,I,O>
- java.lang.Object
-
- de.learnlib.filter.statistic.sul.SymbolCounterSUL<I,O>
-
- de.learnlib.filter.statistic.sul.SymbolCounterObservableSUL<S,I,O>
-
- All Implemented Interfaces:
StatisticCollector
,StatisticSUL<I,O>
,ObservableSUL<S,I,O>
,SUL<I,O>
public class SymbolCounterObservableSUL<S,I,O> extends SymbolCounterSUL<I,O> implements ObservableSUL<S,I,O>
-
-
Constructor Summary
Constructors Constructor Description SymbolCounterObservableSUL(String name, ObservableSUL<S,I,O> sul)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
deepCopies()
Returns whether each state retrieved withObservableSUL.getState()
is a deep copy.ObservableSUL<S,I,O>
fork()
Forks this SUL, if possible.S
getState()
Returns the current state of the system.-
Methods inherited from class de.learnlib.filter.statistic.sul.SymbolCounterSUL
canFork, getStatisticalData, post, pre, step
-
-
-
-
Constructor Detail
-
SymbolCounterObservableSUL
public SymbolCounterObservableSUL(String name, ObservableSUL<S,I,O> sul)
-
-
Method Detail
-
fork
public ObservableSUL<S,I,O> fork()
Description copied from interface:SUL
Forks this SUL, if possible. The fork of a SUL is a copy which behaves exactly the same as this SUL. This method should always return a reseted SUL, regardless of whether this call is made between a call toSUL.pre()
andSUL.post()
.If
SUL.canFork()
returnstrue
, this method must return a non-null
object, which should behave exactly like this SUL (in particular, it must be forkable as well). Otherwise, aUnsupportedOperationException
must be thrown.Implementation note: if resetting a SUL changes the internal state of this object in a non-trivial way (e.g., incrementing a counter to ensure independent sessions), care must be taken that forks of this SUL manipulate the same internal state.
-
getState
public S getState()
Description copied from interface:ObservableSUL
Returns the current state of the system.Implementation note: it is important that the returned Object has a well-defined
Object.equals(Object)
method, and a goodObject.hashCode()
function.- Specified by:
getState
in interfaceObservableSUL<S,I,O>
- Returns:
- the current state of the system.
-
deepCopies
public boolean deepCopies()
Description copied from interface:ObservableSUL
Returns whether each state retrieved withObservableSUL.getState()
is a deep copy.A state is a deep copy if calls to either
SUL.step(Object)
,SUL.pre()
, orSUL.post()
do not modify any state previously obtained withObservableSUL.getState()
.More formally (assuming a perfect hash function): the result must be false if there is a case where in the following statements the assertion does not hold:
Object o = getState(); int hc = o.hashCode(); [step(...)|pre()|post()]; assert o.hashCode() == hc;
Furthermore, if states can be retrieved, but each state is not a deep copy, then this SUL must be forkable, i.e. if !ObservableSUL.deepCopies()
thenSUL.canFork()
must hold.- Specified by:
deepCopies
in interfaceObservableSUL<S,I,O>
- Returns:
- whether each state is a deep copy.
-
-