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 thisToken
object.Return the plain string representation of thisToken
object.toString()
Return a colorful string representation of thisToken
object.static Token
Returns 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 thisToken
object. The return value of thistoString
method is the same astoColorString()
.- Overrides:
toString
in classEnum<Token>
- Returns:
- the same value as
toColorString()
- See Also:
-
toColorString
Return the colorful string representation of thisToken
object.- Returns:
- the colorful string representation of this
Token
object - See Also:
-
toPlainString
Return the plain string representation of thisToken
object.- Returns:
- the plain string representation of this
Token
object - See Also:
-