Package ball.game.card.poker
Enum Ranking
- java.lang.Object
-
- java.lang.Enum<Ranking>
-
- ball.game.card.poker.Ranking
-
- All Implemented Interfaces:
Serializable,Comparable<Ranking>,Predicate<List<Card>>
public enum Ranking extends Enum<Ranking> implements Predicate<List<Card>>
- Author:
- Allen D. Ball
-
-
Enum Constant Summary
Enum Constants Enum Constant Description EmptyFiveOfAKindFlushFourOfAKindFullHouseHighCardPairRoyalFlushStraightStraightFlushThreeOfAKindTwoPair
-
Field Summary
Fields Modifier and Type Field Description static Comparator<Ranking>COMPARATORComparatorthat ordersRankings weakest to strongest.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description List<Card>find(Collection<Card> collection)Predicate<List<Card>>possible()intrequired()booleantest(List<Card> list)static RankingvalueOf(String name)Returns the enum constant of this type with the specified name.static Ranking[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
ThreeOfAKind
public static final Ranking ThreeOfAKind
-
FourOfAKind
public static final Ranking FourOfAKind
-
StraightFlush
public static final Ranking StraightFlush
-
RoyalFlush
public static final Ranking RoyalFlush
-
FiveOfAKind
public static final Ranking FiveOfAKind
-
-
Field Detail
-
COMPARATOR
public static Comparator<Ranking> COMPARATOR
Comparatorthat ordersRankings weakest to strongest.
-
-
Method Detail
-
values
public static Ranking[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (Ranking c : Ranking.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static Ranking 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 nameNullPointerException- if the argument is null
-
find
public List<Card> find(Collection<Card> collection)
-
-