Package model

Enum Card.Suit

All Implemented Interfaces:
Serializable, Comparable<Card.Suit>, java.lang.constant.Constable
Enclosing class:
Card

public static enum Card.Suit extends Enum<Card.Suit>
Represents the four possible suits in a standard playing card deck.
  • Enum Constant Details

    • CLUBS

      public static final Card.Suit CLUBS
    • DIAMONDS

      public static final Card.Suit DIAMONDS
    • HEARTS

      public static final Card.Suit HEARTS
    • SPADES

      public static final Card.Suit SPADES
  • Field Details

    • SUIT_NAME

      public final String SUIT_NAME
  • Method Details

    • values

      public static Card.Suit[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static Card.Suit valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified name
      NullPointerException - if the argument is null
    • toString

      public String toString()
      Returns the name of the Card.Suit as a string.
      Overrides:
      toString in class Enum<Card.Suit>
      Returns:
      the name of the Card.Suit