|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD | ||||||||
java.lang.Objectjava.lang.Enum<Suit>
proj3.Suit
public enum Suit
The Suit enum encapsulates each of the 4 suits of a standard deck of playing cards. Using this enum assures that all
code refers to the suits in the same manner, i.e Suit.CLUBS, Suit.DIAMONDS,
Suit.HEARTS, and Suit.SPADES with no possibility of conflicting representations.
| Enum Constant Summary | |
|---|---|
CLUBS
The suit CLUBS |
|
DIAMONDS
The suit DIAMONDS |
|
HEARTS
The suit HEARTS |
|
SPADES
The suit SPADES |
|
| Method Summary | |
|---|---|
java.lang.String |
getName()
Returns the name for the suit (e.g. |
char |
getSymbol()
Returns the symbol for the suit (e.g. |
static Suit |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. |
static Suit[] |
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 Suit CLUBS
public static final Suit DIAMONDS
public static final Suit HEARTS
public static final Suit SPADES
| Method Detail |
|---|
public static Suit[] values()
for (Suit c : Suit.values()) System.out.println(c);
public static Suit 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 | ||||||||