Enum Class Code.Color

java.lang.Object
java.lang.Enum<Code.Color>
mastermind.core.Code.Color
All Implemented Interfaces:
Serializable, Comparable<Code.Color>, Constable
Enclosing class:
Code

public static enum Code.Color extends Enum<Code.Color>
Represents a color in the Mastermind game.
  • Enum Constant Details

    • Green

      public static final Code.Color Green
      The green code in the Mastermind game.
    • Red

      public static final Code.Color Red
      The red code in the Mastermind game.
    • Blue

      public static final Code.Color Blue
      The blue code in the Mastermind game.
    • Yellow

      public static final Code.Color Yellow
      The yellow code in the Mastermind game.
    • Orange

      public static final Code.Color Orange
      The orange code in the Mastermind game.
    • Purple

      public static final Code.Color Purple
      The purple code in the Mastermind game.
  • Method Details

    • values

      public static Code.Color[] 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

      public static Code.Color valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • fromIndex

      public static Code.Color fromIndex(int index)
      Retrieves the Color constant at the specified index.
      Parameters:
      index - the zero-based index of the Color constant to retrieve.
      Returns:
      the Color constant at the given index.
      Throws:
      ArrayIndexOutOfBoundsException - if the specified index is out of range.