|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |
java.lang.Objectjava.lang.Enum<CardValue>
ps0.optional.CardValue
public enum CardValue extends Enum<CardValue>
Represents one of 13 values (2-10, Jack, Queen, King, Ace) that appear on a playing card. This class is immutable.
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. |
Methods inherited from class java.lang.Enum |
---|
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Enum Constant Detail |
---|
public static final CardValue TWO
public static final CardValue THREE
public static final CardValue FOUR
public static final CardValue FIVE
public static final CardValue SIX
public static final CardValue SEVEN
public static final CardValue EIGHT
public static final CardValue NINE
public static final CardValue TEN
public static final CardValue JACK
public static final CardValue QUEEN
public static final CardValue KING
public static final CardValue ACE
Method Detail |
---|
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.
public String toString()
toString
in class Enum<CardValue>
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |