public enum CardSuit extends java.lang.Enum<CardSuit>
jpleal@fc.up.pt
values()
and valueOf()
are methods
available by default in all enumerations and don't need to be implemented.Modifier and Type | Method and Description |
---|---|
java.lang.String |
toString()
Represent suits by their usual signs
CLUBS: ♣
DIAMONDS: ♦
HEARTS: ♥
SPADES: ♠
|
static CardSuit |
valueOf(java.lang.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.
|
public static final CardSuit CLUBS
public static final CardSuit DIAMONDS
public static final CardSuit HEARTS
public static final CardSuit SPADES
public static CardSuit[] values()
for (CardSuit c : CardSuit.values()) System.out.println(c);
public static CardSuit 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 namejava.lang.NullPointerException
- if the argument is nullpublic java.lang.String toString()
toString
in class java.lang.Enum<CardSuit>