|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--gumbo.util.state.StateFlag | +--gumbo.util.state.ObjectFlag
An immutable state flag that represents a target object (instance). Object flag identity (equals(), hashCode()) is that of the target object plus an instanceof test for ObjectFlag. The flag name is not a factor in the flag's identity. Object flags that wrap the same object, including null, will test equal. As with any object not using "reference" identity, mutating the object may affect its use in collections.
Constructor Summary | |
ObjectFlag(java.lang.Object object)
Constructs an instance, with the specified target object and the default name "(object flag)". |
|
ObjectFlag(java.lang.Object object,
java.lang.String name)
Constructs an instance, with a specified target object and name. |
Method Summary | |
boolean |
equals(java.lang.Object o)
|
java.lang.Object |
getObject()
Get this target object wrapped by this flag. |
int |
hashCode()
|
boolean |
isObjectAssignableTo(java.lang.Class type)
Returns true if the object wrapped by this flag is not null and is an instance of the target type. |
java.lang.String |
toString()
Returns the name of this flag followed by its object. |
Methods inherited from class gumbo.util.state.StateFlag |
getName |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public ObjectFlag(java.lang.Object object)
object
- The target object. Null if none.public ObjectFlag(java.lang.Object object, java.lang.String name)
object
- The target object. Null if none.name
- Name of this state flag. Null if none, in which
case the name defaults to "(object flag)".Method Detail |
public final java.lang.Object getObject()
public boolean isObjectAssignableTo(java.lang.Class type)
type
- The target type. Never null.
public java.lang.String toString()
toString
in class StateFlag
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |