|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |
java.lang.Objectjava.lang.Enum<CardSuit>
ps0.optional.CardSuit
public enum CardSuit extends Enum<CardSuit>
Represents one of the four suits (Hearts, Spades, Diamonds, Clubs) that appear on a playing card. This class is immutable.
Enum Constant and Description |
---|
CLUBS
The suit of clubs. |
DIAMONDS
The suit of diamonds. |
HEARTS
The suit of hearts. |
SPADES
The suit of spades. |
Modifier and Type | Method and Description |
---|---|
static CardSuit |
valueOf(String name)
Returns the enum constant of this type with the specified name. |
static CardSuit[] |
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, toString, valueOf |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Enum Constant Detail |
---|
public static final CardSuit CLUBS
public static final CardSuit DIAMONDS
public static final CardSuit HEARTS
public static final CardSuit SPADES
Method Detail |
---|
public static CardSuit[] values()
for (CardSuit c : CardSuit.values()) System.out.println(c);
public static CardSuit 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 null
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |