Enum Class Suit

java.lang.Object
java.lang.Enum<Suit>
me.ramendev.expokert.Suit
All Implemented Interfaces:
Serializable, Comparable<Suit>, java.lang.constant.Constable

public enum Suit extends Enum<Suit>
The suit of a Card. A notable difference from the Pip property is that a majority of card games don't compare have a Suit order to compare.
See Also:
  • Enum Constant Details

    • CLUBS

      public static final Suit CLUBS
      The clubs suit.
    • SPADES

      public static final Suit SPADES
      The spades suit.
    • DIAMONDS

      public static final Suit DIAMONDS
      The diamonds suit.
    • HEARTS

      public static final Suit HEARTS
      The hearts suit.
    • WILD

      public static final Suit WILD
      The wild suit, only unique to Wildcards.
  • Method Details

    • values

      public static Suit[] 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 Suit 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
    • from

      public static Suit from(char character)
      Returns the suit that is notated with the provided character.
      Parameters:
      character - The character of the pip to be returned.
      Returns:
      The suit with the provided character.
    • getCharacter

      public final char getCharacter()
      Returns the character the represents this suit. This "character" in question is actually just name().charAt(0).
      Returns:
      The character of the suit.