public enum CardValue extends Enum<CardValue>
Enum Constant and Description |
---|
ACE
The card value representing an Ace.
|
EIGHT
The card value representing 8.
|
FIVE
The card value representing 5.
|
FOUR
The card value representing 4.
|
JACK
The card value representing a Jack.
|
KING
The card value representing a King.
|
NINE
The card value representing 9.
|
QUEEN
The card value representing a Queen.
|
SEVEN
The card value representing 7.
|
SIX
The card value representing 6.
|
TEN
The card value representing 10.
|
THREE
The card value representing 3.
|
TWO
The card value representing 2.
|
Modifier and Type | Method and Description |
---|---|
String |
getLetterOnCard()
Returns the symbol representing this card value.
|
String |
getName()
Returns the name of this value.
|
String |
toString()
Returns a description of this value.
|
static CardValue |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static CardValue[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static CardValue[] values()
for (CardValue c : CardValue.values()) System.out.println(c);
public static CardValue valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant
with the specified nameNullPointerException
- if the argument is nullpublic String getName()
The value names can be either "2", "3", ..., "10", "Jack", "Queen", "King", or "Ace".
public String getLetterOnCard()
For the values 2-10, this symbol is simply the digits themselves; for JACK, QUEEN, KING, and ACE values, the symbols are "J", "Q", "K", and "A" respectively.