|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.fhg.igd.jhsm.util.HSMValidator
A validator for hsm data structures. This implementation represents a very pragmatic approach to validation. The datastructure is not tested against a grammar, only some selected tests are run. The idea here is to protect the user of jhsm from the most common mistakes.
Constructor Summary | |
HSMValidator()
|
Method Summary | |
private void |
findSubstates(Set states,
State current)
Adds states to a given set that can be reached from a given state via transitions. |
private Set |
getAllSubstates(CompositeState hsm)
Returns a set of all possible states that can be active inside a given hsm. |
protected void |
testBorderCrossingTransitions(State state)
Tests if a given state does have border crossing transitions. |
protected void |
testHSMComplete(CompositeState hsm)
Tests if a given hsm knows all states that should be contained in it. |
protected void |
testInitialState(CompositeState hsm)
Tests if a given hsm has exactly one initial state. |
protected void |
testTransition(Transition trans)
|
boolean |
validate(CompositeState hsm)
Traverses a given hsm data structure and runs some predefined tests on it. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public HSMValidator()
Method Detail |
public boolean validate(CompositeState hsm) throws InvalidHSMException
hsm
- The hsm to be validated.
true
if the validation did succeed.
InvalidHSMException
- if the validation did fail.protected void testInitialState(CompositeState hsm) throws InvalidHSMException
hsm
- The hsm to be tested.
InvalidHSMException
- if the test did fail.protected void testBorderCrossingTransitions(State state) throws InvalidHSMException
state
- The state to be tested.
InvalidHSMException
- if the test did fail.protected void testHSMComplete(CompositeState hsm) throws InvalidHSMException
hsm
- The hsm to be tested.
InvalidHSMException
- if the test did fail.private Set getAllSubstates(CompositeState hsm)
private void findSubstates(Set states, State current)
protected void testTransition(Transition trans) throws InvalidHSMException
InvalidHSMException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |