public enum PokerHand extends java.lang.Enum<PokerHand>
Enum Constant and Description |
---|
FLUSH |
FOUR_OF_A_KIND |
FULL_HOUSE |
HIGH_CARD |
ONE_PAIR |
ROYAL_FLUSH |
STRAIGHT |
STRAIGHT_FLUSH |
THREE_OF_A_KIND |
TWO_PAIR |
Modifier and Type | Field and Description |
---|---|
int |
id |
java.lang.String |
name |
static int |
NUM_HANDS |
Modifier and Type | Method and Description |
---|---|
static PokerHand |
getPokerHand(Card[] hand)
Given a Card array (possibly with null values) classifies the current Poker hand and returns the classification.
|
static int |
getPokerHandId(Card[] hand)
Given a Card array (possibly with null values) classifies the current Poker hand and returns the classification identification number.
|
java.lang.String |
toString() |
static PokerHand |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static PokerHand[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final PokerHand HIGH_CARD
public static final PokerHand ONE_PAIR
public static final PokerHand TWO_PAIR
public static final PokerHand THREE_OF_A_KIND
public static final PokerHand STRAIGHT
public static final PokerHand FLUSH
public static final PokerHand FULL_HOUSE
public static final PokerHand FOUR_OF_A_KIND
public static final PokerHand STRAIGHT_FLUSH
public static final PokerHand ROYAL_FLUSH
public static final int NUM_HANDS
public int id
public java.lang.String name
public static PokerHand[] values()
for (PokerHand c : PokerHand.values()) System.out.println(c);
public static PokerHand valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic static PokerHand getPokerHand(Card[] hand)
hand
- - a Poker hand represented as an array of Card objects which may contain null valuespublic static final int getPokerHandId(Card[] hand)
hand
- - a Poker hand represented as an array of Card objects which may contain null valuespublic java.lang.String toString()
toString
in class java.lang.Enum<PokerHand>