Package com.github.jmp.poker
Enum Class Suit
- All Implemented Interfaces:
Serializable,Comparable<Suit>,Constable
Represents the four suits in a standard deck of playing cards.
Each suit has an associated bitmask value for efficient set operations
and a single character symbol for display purposes.
-
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 TypeMethodDescriptionintgetValue()Returns the bitmask value of this suit.toString()Returns the single character symbol representation of this suit.static SuitReturns the enum constant of this class with the specified name.static Suit[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
CLUBS
Clubs suit with bitmask value 0x8000 and symbol "c" -
DIAMONDS
Diamonds suit with bitmask value 0x4000 and symbol "d" -
HEARTS
Hearts suit with bitmask value 0x2000 and symbol "h" -
SPADES
Spades suit with bitmask value 0x1000 and symbol "s"
-
-
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
-
getValue
public int getValue()Returns the bitmask value of this suit.The bitmask values are powers of 2 in hexadecimal format, allowing for efficient bitwise operations when working with suit combinations.
- Returns:
- the bitmask value for this suit
-
toString
Returns the single character symbol representation of this suit.Returns lowercase single character symbols: "c" for CLUBS, "d" for DIAMONDS, "h" for HEARTS, "s" for SPADES.
-