Package mastermind.core
Enum Class Code.Color
- All Implemented Interfaces:
Serializable,Comparable<Code.Color>,Constable
- Enclosing class:
Code
Represents a color in the Mastermind game.
-
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 Code.ColorfromIndex(int index) Retrieves theColorconstant at the specified index.static Code.ColorReturns the enum constant of this class with the specified name.static Code.Color[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
Green
The green code in the Mastermind game. -
Red
The red code in the Mastermind game. -
Blue
The blue code in the Mastermind game. -
Yellow
The yellow code in the Mastermind game. -
Orange
The orange code in the Mastermind game. -
Purple
The purple code in the Mastermind game.
-
-
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
-
fromIndex
Retrieves theColorconstant at the specified index.- Parameters:
index- the zero-based index of theColorconstant to retrieve.- Returns:
- the
Colorconstant at the given index. - Throws:
ArrayIndexOutOfBoundsException- if the specified index is out of range.
-