|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
An interface for imposing a policy for state value assurance and transition, with state values consisting of non-null "state flag" objects. State transition policy causes the state value to transit to a new state given the old state, a desired new state, and an input value. State assurance policy can be passive, with invalid state flag types and combinations throwing an exception, or it can be active, with invalid state values being coerced into valid ones.
Method Summary | |
void |
checkInitialState(java.util.Set newState,
java.util.Set oldState)
Called by the system to verify the new initial state value. |
void |
checkTransitState(java.util.Collection input,
java.util.Set newState,
java.util.Set oldState)
Called by the system to transit the value of a state from its old value to a new value according to an input value. |
boolean |
isCompatible(StatePolicy policy)
Called by the system to determine if some other state policy is compatible with this one, such as when adding a state value to a group of state values that should maintain a mutually consistent state. |
Method Detail |
public boolean isCompatible(StatePolicy policy)
policy
- Other state policy. None if null.
public void checkInitialState(java.util.Set newState, java.util.Set oldState)
newState
- Reference to the new target state value (Object).
Never null. Contains the initial state value and, upon return,
the modified initial value. Must be mutable and must NOT loop
back to this method.oldState
- The old state value (Object). Never null.public void checkTransitState(java.util.Collection input, java.util.Set newState, java.util.Set oldState)
input
- Input value (Object). None if null (such as in a
"set state" operation), which may be distinct from an empty value.
If the same reference as state, may cause concurrent modification
exceptions.newState
- Reference to the new target state value (Object).
Contains the new state value and, upon return, the modified new value.
Never null. Must be mutable and must NOT loop back to this method.oldState
- The old state value (Object). Never null.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |