|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdip.world.Unit.Type
A Type is the class of unit, for example, Army or Fleet.
Type constans should be used; new Type objects should not be created unless the game concepts are being extended.
Field Summary | |
static Unit.Type |
ARMY
Constant representing an Army |
static Unit.Type |
FLEET
Constant representing a Fleet |
static Unit.Type |
UNDEFINED
Constant representing an unknown type |
static Unit.Type |
WING
Constant representing a Wing |
Constructor Summary | |
protected |
Unit.Type(java.lang.String internalName)
Create a new Type |
Method Summary | |
java.lang.String |
getFullName()
Get the full name of this type (e.g., 'Army') |
java.lang.String |
getFullNameWithArticle()
Get the full name, including an article |
java.lang.String |
getShortName()
Get the short name of this type (e.g., 'A') |
int |
hashCode()
Returns the hashcode |
static Unit.Type |
parse(java.lang.String text)
Returns a type constant corresponding to the input. |
protected java.lang.Object |
readResolve()
Assigns serialized objects to a single constant reference |
java.lang.String |
toString()
Get the short name |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final Unit.Type ARMY
public static final Unit.Type FLEET
public static final Unit.Type WING
public static final Unit.Type UNDEFINED
Constructor Detail |
protected Unit.Type(java.lang.String internalName)
Method Detail |
public java.lang.String getFullName()
public java.lang.String getShortName()
public java.lang.String toString()
public java.lang.String getFullNameWithArticle()
public int hashCode()
public static Unit.Type parse(java.lang.String text)
null -> Type.UNDEFINED 'f' or 'fleet' -> Type.FLEET 'a' or 'army' -> Type.ARMY 'w' or 'wing' -> Type.WING any other -> null
protected java.lang.Object readResolve() throws java.io.ObjectStreamException
java.io.ObjectStreamException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |