|
|||||||||||
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.TypeFlag
An immutable state flag that represents a target type (Class). Type flag identity (equals(), hashCode()) is that of the target type plus an instanceof test for TypeFlag. The flag name is not a factor in the flag's identity. Type flags that wrap the same object will test equal.
Constructor Summary | |
TypeFlag(java.lang.Class type)
Constructs an instance, with the specified target type and the default name of the type (type.getName()). |
|
TypeFlag(java.lang.Class type,
java.lang.String name)
Constructs an instance, with a specified target object and name. |
Method Summary | |
boolean |
equals(java.lang.Object o)
|
java.lang.Class |
getType()
Gets the target type wrapped by this flag. |
int |
hashCode()
|
boolean |
isTypeAssignableFrom(java.lang.Object object)
Return true if the target object is not null and is an instance of (assignable to) the type wrapped by this flag. |
java.lang.String |
toString()
Returns the name of this flag followed by its type. |
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 TypeFlag(java.lang.Class type)
type
- Target type. Never null.public TypeFlag(java.lang.Class type, java.lang.String name)
name
- Name of this state flag. Null if none, in which
case the name defaults to "(object flag)".Method Detail |
public java.lang.Class getType()
public boolean isTypeAssignableFrom(java.lang.Object object)
object
- The target object. Null if none.
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 |