|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--gumbo.util.state.StateFlags
Constants and utilities related to the use of objects in collections as state flags.
In the "generic" state flag utilities, note that the target of the action described by the method name is always the first parameter. Also, the parameter order for new and old states is newState followed by oldState, which is consistent throughout the state classes.
Method Summary | |
static boolean |
added(java.lang.Object flag,
java.util.Collection newState,
java.util.Collection oldState)
Returns true if the input flag was newly added. |
static boolean |
addedAll(java.util.Collection flags,
java.util.Collection newState,
java.util.Collection oldState)
Returns true if all input flags were newly added. |
static boolean |
addedAny(java.util.Collection flags,
java.util.Collection newState,
java.util.Collection oldState)
Returns true if any input flag was newly added. |
static int |
addedCount(java.util.Set flags,
java.util.Collection newState,
java.util.Collection oldState)
Returns the number of input flags newly added. |
static boolean |
addedNone(java.util.Collection newState,
java.util.Collection oldState)
Returns true if no flags were added. |
static boolean |
changed(java.lang.Object flag,
java.util.Collection newState,
java.util.Collection oldState)
Returns true if the input flag was newly changed. |
static boolean |
changedAll(java.util.Collection flags,
java.util.Collection newState,
java.util.Collection oldState)
Returns true if all input flags were newly changed. |
static boolean |
changedAny(java.util.Collection flags,
java.util.Collection newState,
java.util.Collection oldState)
Returns true if any input flag was newly changed. |
static int |
changedCount(java.util.Set flags,
java.util.Collection newState,
java.util.Collection oldState)
Returns the number of input flags newly changed. |
static boolean |
changedNone(java.util.Collection newState,
java.util.Collection oldState)
Returns true if no flags were changed. |
static java.util.Collection |
collectFlags(java.util.Collection elements,
java.util.Collection retVal)
Converts a collection of "state elements" into an equivalent collection of state flags. |
static java.util.Set |
collectFlags(java.lang.Object[] elements)
Converts an array of "state elements" into an equivalent collection of state flags. |
static java.util.Set |
collectFlagsImm(java.lang.Object[] elements)
Converts an array of "state elements" into an equivalent immutable collection of state flags. |
static java.util.Set |
flagObjects(java.util.Collection flags,
java.util.Set retVal)
Gets the objects in the object flags in a group of flags. |
static java.util.Set |
flagsAdded(java.util.Collection newState,
java.util.Collection oldState,
java.util.Set retVal)
Returns the state flag objects that were added. |
static java.util.Set |
flagsChanged(java.util.Collection newState,
java.util.Collection oldState,
java.util.Set retVal)
Returns the state flag objects that were changed. |
static java.util.Set |
flagsRemoved(java.util.Collection newState,
java.util.Collection oldState,
java.util.Set retVal)
Returns the state flag objects that were removed. |
static java.util.Set |
flagTypes(java.util.Collection flags,
java.util.Set retVal)
Gets the types in the type flags in a group of flags. |
static boolean |
has(java.lang.Object flag,
java.util.Collection state)
Returns true if the input flag is set in state. |
static boolean |
hasAll(java.util.Collection flags,
java.util.Collection state)
Returns true if all of the input flags are set in state. |
static boolean |
hasAny(java.util.Collection flags,
java.util.Collection state)
Returns true if any of the input flags are set in state. |
static int |
hasCount(java.util.Set flags,
java.util.Collection state)
Returns the number of input flags set in state. |
static boolean |
hasNone(java.util.Collection state)
Returns true if the state has no flags set (is clear). |
static boolean |
removed(java.lang.Object flag,
java.util.Collection newState,
java.util.Collection oldState)
Returns true if the input flag was newly removed. |
static boolean |
removedAll(java.util.Collection flags,
java.util.Collection newState,
java.util.Collection oldState)
Returns true if all input flags were newly removed. |
static boolean |
removedAny(java.util.Collection flags,
java.util.Collection newState,
java.util.Collection oldState)
Returns true if any input flag was newly removed. |
static int |
removedCount(java.util.Set flags,
java.util.Collection newState,
java.util.Collection oldState)
Returns the number of input flags newly removed. |
static boolean |
removedNone(java.util.Collection newState,
java.util.Collection oldState)
Returns true if no flags were removed. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static java.util.Set collectFlags(java.lang.Object[] elements)
elements
- State elements (StateFlag or Collection). Never null.
java.lang.IllegalArgumentException
- A state element must be a StateFlag
or Collection.public static java.util.Set collectFlagsImm(java.lang.Object[] elements)
public static java.util.Collection collectFlags(java.util.Collection elements, java.util.Collection retVal)
elements
- State elements (StateFlag or Collection).
Clear if null.retVal
- Return value object. State flags (StateFlag).
Never null.
java.lang.IllegalArgumentException
- A state element must be a StateFlag
or Collection.public static java.util.Set flagObjects(java.util.Collection flags, java.util.Set retVal)
flags
- State flags (Object). Clear if null.retVal
- Return value object. Type flag objects (Object).
Never null.
public static java.util.Set flagTypes(java.util.Collection flags, java.util.Set retVal)
flags
- State flags (Object). Clear if null.retVal
- Return value object. Type flag types (Class).
Never null.
public static java.util.Set flagsAdded(java.util.Collection newState, java.util.Collection oldState, java.util.Set retVal)
newState
- New state flags (Object). Clear if null.oldState
- Old state flags (Object). Clear if null.retVal
- Return value object. The added state flags (Object).
Never null.
public static java.util.Set flagsRemoved(java.util.Collection newState, java.util.Collection oldState, java.util.Set retVal)
newState
- New state flags (Object). Clear if null.oldState
- Old state flags (Object). Clear if null.retVal
- Return value object. The removed state flags (Object).
Never null.
public static java.util.Set flagsChanged(java.util.Collection newState, java.util.Collection oldState, java.util.Set retVal)
newState
- New state flags (Object). Clear if null.oldState
- Old state flags (Object). Clear if null.retVal
- Return value object. The changed state flags (Object).
Never null.
public static boolean hasNone(java.util.Collection state)
state
- State flags (Object). Clear if null.public static boolean has(java.lang.Object flag, java.util.Collection state)
flag
- Flag to test for. Clear if null.state
- State flags (Object). Clear if null.public static boolean hasAny(java.util.Collection flags, java.util.Collection state)
flags
- Flags to test for. Clear if null.state
- State flags (Object). Clear if null.public static boolean hasAll(java.util.Collection flags, java.util.Collection state)
flags
- Flags to test for. Clear if null.state
- State flags (Object). Clear if null.public static int hasCount(java.util.Set flags, java.util.Collection state)
flags
- Flags to test for. Clear if null.state
- State flags (Object). Clear if null.public static boolean addedNone(java.util.Collection newState, java.util.Collection oldState)
newState
- New state flags (Object). Clear if null.oldState
- Old state flags (Object). Clear if null.public static boolean added(java.lang.Object flag, java.util.Collection newState, java.util.Collection oldState)
flag
- Flag to test for. Clear if null.newState
- New state flags (Object). Clear if null.oldState
- Old state flags (Object). Clear if null.public static boolean addedAny(java.util.Collection flags, java.util.Collection newState, java.util.Collection oldState)
flags
- Flags to test for. Clear if null.newState
- New state flags (Object). Clear if null.oldState
- Old state flags (Object). Clear if null.public static boolean addedAll(java.util.Collection flags, java.util.Collection newState, java.util.Collection oldState)
flags
- Flags to test for. Clear if null.newState
- New state flags (Object). Clear if null.oldState
- Old state flags (Object). Clear if null.public static int addedCount(java.util.Set flags, java.util.Collection newState, java.util.Collection oldState)
flags
- Flags to test for. Clear if null.newState
- New state flags (Object). Clear if null.oldState
- Old state flags (Object). Clear if null.public static boolean removedNone(java.util.Collection newState, java.util.Collection oldState)
newState
- New state flags (Object). Clear if null.oldState
- Old state flags (Object). Clear if null.public static boolean removed(java.lang.Object flag, java.util.Collection newState, java.util.Collection oldState)
flag
- Flag to test for. Clear if null.newState
- New state flags (Object). Clear if null.oldState
- Old state flags (Object). Clear if null.public static boolean removedAny(java.util.Collection flags, java.util.Collection newState, java.util.Collection oldState)
flags
- Flags to test for. Clear if null.newState
- New state flags (Object). Clear if null.oldState
- Old state flags (Object). Clear if null.public static boolean removedAll(java.util.Collection flags, java.util.Collection newState, java.util.Collection oldState)
flags
- Flags to test for. Clear if null.newState
- New state flags (Object). Clear if null.oldState
- Old state flags (Object). Clear if null.public static int removedCount(java.util.Set flags, java.util.Collection newState, java.util.Collection oldState)
flags
- Flags to test for. Clear if null.newState
- New state flags (Object). Clear if null.oldState
- Old state flags (Object). Clear if null.public static boolean changedNone(java.util.Collection newState, java.util.Collection oldState)
newState
- New state flags (Object). Clear if null.oldState
- Old state flags (Object). Clear if null.public static boolean changed(java.lang.Object flag, java.util.Collection newState, java.util.Collection oldState)
flag
- Flag to test for. Clear if null.newState
- New state flags (Object). Clear if null.oldState
- Old state flags (Object). Clear if null.public static boolean changedAny(java.util.Collection flags, java.util.Collection newState, java.util.Collection oldState)
flags
- Flags to test for. Clear if null.newState
- New state flags (Object). Clear if null.oldState
- Old state flags (Object). Clear if null.public static boolean changedAll(java.util.Collection flags, java.util.Collection newState, java.util.Collection oldState)
flags
- Flags to test for. Clear if null.newState
- New state flags (Object). Clear if null.oldState
- Old state flags (Object). Clear if null.public static int changedCount(java.util.Set flags, java.util.Collection newState, java.util.Collection oldState)
flags
- Flags to test for. Clear if null.newState
- New state flags (Object). Clear if null.oldState
- Old state flags (Object). Clear if null.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |