Package cs1302.gameutil
Enum Class Token
- All Implemented Interfaces:
Serializable,Comparable<Token>,Constable
A
Diagram of the
Token object can be used to represent a player or a player's item in a game.
cs1302.gameutil.Token enumeration.- Related CSCI 1302 projects:
- cs1302-c4-alpha
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionstatic String[]names()Returns an array containing the names of the constants of this enum class, in the order they are declared.Return the colorful string representation of thisTokenobject.Return the plain string representation of thisTokenobject.toString()Return a colorful string representation of thisTokenobject.static TokenReturns the enum constant of this class with the specified name.static Token[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
RED
A red token. -
GREEN
A green token. -
YELLOW
A yellow token. -
BLUE
A blue token. -
PURPLE
A purple token. -
CYAN
A cyan token.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
names
Returns an array containing the names of the constants of this enum class, in the order they are declared.- Returns:
- an array containing the names of the constants of this enum class, in the order they are declared
-
toString
Return a colorful string representation of thisTokenobject. The return value of thistoStringmethod is the same astoColorString().- Overrides:
toStringin classEnum<Token>- Returns:
- the same value as
toColorString() - See Also:
-
toColorString
Return the colorful string representation of thisTokenobject.- Returns:
- the colorful string representation of this
Tokenobject - See Also:
-
toPlainString
Return the plain string representation of thisTokenobject.- Returns:
- the plain string representation of this
Tokenobject - See Also:
-