Enum Class Token

java.lang.Object
java.lang.Enum<Token>
cs1302.gameutil.Token
All Implemented Interfaces:
Serializable, Comparable<Token>, Constable

public enum Token extends Enum<Token>
A Token object can be used to represent a player or a player's item in a game.
Diagram of the cs1302.gameutil.Token enumeration.
Diagram of the cs1302.gameutil.Token enumeration.
Related CSCI 1302 projects:
cs1302-c4-alpha
  • Enum Constant Details

    • RED

      public static final Token RED
      A red token.
    • GREEN

      public static final Token GREEN
      A green token.
    • YELLOW

      public static final Token YELLOW
      A yellow token.
    • BLUE

      public static final Token BLUE
      A blue token.
    • PURPLE

      public static final Token PURPLE
      A purple token.
    • CYAN

      public static final Token CYAN
      A cyan token.
  • Method Details

    • values

      public static Token[] 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 Token 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
    • names

      public static String[] 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

      public String toString()
      Return a colorful string representation of this Token object. The return value of this toString method is the same as toColorString().
      Overrides:
      toString in class Enum<Token>
      Returns:
      the same value as toColorString()
      See Also:
    • toColorString

      public String toColorString()
      Return the colorful string representation of this Token object.
      Returns:
      the colorful string representation of this Token object
      See Also:
    • toPlainString

      public String toPlainString()
      Return the plain string representation of this Token object.
      Returns:
      the plain string representation of this Token object
      See Also: