|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--gumbo.util.GumboCollections.ImmutableCollection
|
+--gumbo.util.state.States.ImmutableStateSet
Immutable wrapper for a target state set. Identity (hashCode(), equals()) forwards to the target object, which is possible because target identity is based on contents.
| Constructor Summary | |
States.ImmutableStateSet(StateSet target)
|
|
| Method Summary | |
boolean |
change(java.lang.Object remove,
java.lang.Object add)
Removes then adds the specified state flags, as allowed by the state policy. |
boolean |
change(StateSet changes)
Performs a "masked change" by imposing a target's state set changes (deltas) on this state set, as allowed by the state policy, with the union of the target's old and new states acting as the mask. |
boolean |
changeAll(java.util.Collection remove,
java.util.Collection add)
Removes then adds the specified state flags, as allowed by the state policy. |
java.util.Set |
getOldState()
Gets a singleton immutable view of this set's old state value, which was the state value prior to the last transit, or the same state value as the current one after a reset. |
StatePolicy |
getStatePolicy()
Gets the state policy for this state set, which assures that the state value contains valid combinations and types of state flags following state initialization and transition. |
StateSet |
getStateSet()
Gets a singleton immutable view of this set, which is the current state value, resulting from the last reset or transit. |
boolean |
reset(java.util.Collection state)
Resets (re-initializes) this state set's value to a new state, as allowed by the state policy. |
boolean |
set(java.util.Collection state)
Sets this state set's value to a new state, as allowed by the state policy. |
boolean |
transit(java.util.Collection input)
Causes this state set's value to transit from one state to another (possibly with no change in value) according to an input value. |
| Methods inherited from class gumbo.util.GumboCollections.ImmutableCollection |
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray, toString |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.Set |
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray |
| Constructor Detail |
public States.ImmutableStateSet(StateSet target)
| Method Detail |
public StatePolicy getStatePolicy()
StateSet
getStatePolicy in interface StateSetpublic boolean reset(java.util.Collection state)
StateSet
reset in interface StateSetstate - The new state value (Object). Never null.
public boolean set(java.util.Collection state)
StateSet
set in interface StateSetstate - The new state value (Object). Never null.
public boolean change(StateSet changes)
StateSet
change in interface StateSetchanges - The state value changes. Never null.
public boolean change(java.lang.Object remove,
java.lang.Object add)
StateSet
change in interface StateSetremove - Flag to be removed. None if null.add - Flag to be added. None if null.
public boolean changeAll(java.util.Collection remove,
java.util.Collection add)
StateSet
changeAll in interface StateSetremove - Flags to be removed. Never null.add - Flags to be added. Never null.
public boolean transit(java.util.Collection input)
StateSet
transit in interface StateSetinput - The input value (Object). Never null.
public java.util.Set getOldState()
StateSet
getOldState in interface StateSetpublic StateSet getStateSet()
StateSet
getStateSet in interface StateSet
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||