|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |
java.lang.Object java.lang.Enum<Rank> proj3.Rank
public enum Rank
The Rank enum encapsulates each of the 13 ranks of a standard deck of playing cards. Using this enum assures that all
code refers to the ranks in the same manner. i.e. Rank.ACE
, Rank.TWO
, ...,
Rank.QUEEN
, Rank.KING
with no possibility of conflicting representations.
Enum Constant Summary | |
---|---|
ACE
The rank ACE |
|
EIGHT
The rank EIGHT (8) |
|
FIVE
The rank FIVE (5) |
|
FOUR
The rank FOUR (4) |
|
JACK
The rank JACK |
|
KING
The rank KING |
|
NINE
The rank NINE (9) |
|
QUEEN
The rank QUEEN |
|
SEVEN
The rank SEVEN (7) |
|
SIX
The rank SIX (6) |
|
TEN
The rank TEN (10) |
|
THREE
The rank THREE (3) |
|
TWO
The rank TWO (2) |
Method Summary | |
---|---|
java.lang.String |
getName()
Returns the name for the suit (e.g. |
char |
getSymbol()
Returns the symbol for the rank (e.g. |
static Rank |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. |
static Rank[] |
values()
Returns an array containing the constants of this enum type, in the order they are declared. |
Methods inherited from class java.lang.Enum |
---|
compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Enum Constant Detail |
---|
public static final Rank ACE
public static final Rank TWO
public static final Rank THREE
public static final Rank FOUR
public static final Rank FIVE
public static final Rank SIX
public static final Rank SEVEN
public static final Rank EIGHT
public static final Rank NINE
public static final Rank TEN
public static final Rank JACK
public static final Rank QUEEN
public static final Rank KING
Method Detail |
---|
public static Rank[] values()
for (Rank c : Rank.values()) System.out.println(c);
public static Rank 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 name
java.lang.NullPointerException
- if the argument is nullpublic char getSymbol()
public java.lang.String getName()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |