|
|||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--Rank
Specification of the rank values for a standard deck of cards. Client has ability to set either the ace or the king to be the highest ranking card; default is king high. Ranks are established in the following ascending order:
King high: ace, 2, 3, 4, 5, 6, 7, 8, 9, 10, jack, queen, king.
Ace high: 2, 3, 4, 5, 6, 7, 8, 9, 10, jack, queen, king, ace.
Class can be extended for implementation of speciality decks containing a subset of the standard ranks, e.g. pinochle.
Field Summary | |
static Rank |
ACE
The rank ace. |
static Rank |
EIGHT
The rank eight. |
static Rank |
FIVE
The rank five. |
static Rank |
FOUR
The rank four. |
static Rank |
JACK
The rank jack. |
static Rank |
KING
The rank king. |
static Rank |
NINE
The rank nine. |
static Rank |
QUEEN
The rank queen. |
static Rank |
SEVEN
The rank seven. |
static Rank |
SIX
The rank six. |
static Rank |
TEN
The rank ten. |
static Rank |
THREE
The rank three. |
static Rank |
TWO
The rank two. |
static java.util.List |
VALUES
List of all rank values. |
Method Summary | |
int |
compareTo(java.lang.Object otherRankObject)
Compares the ranks. |
java.lang.String |
getName()
Returns a description of this rank. |
java.lang.String |
getSymbol()
The symbol associated with this rank. |
static void |
setAceHigh()
Sets the ace to be the card having highest rank. |
static void |
setKingHigh()
Sets the king to be the card having highest rank. |
java.lang.String |
toString()
Returns a description of this rank. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final Rank ACE
public static final Rank TWO
public static final Rank THREE
public static final Rank FOUR
public static final Rank FIVE
public static final Rank SIX
public static final Rank SEVEN
public static final Rank EIGHT
public static final Rank NINE
public static final Rank TEN
public static final Rank JACK
public static final Rank QUEEN
public static final Rank KING
public static final java.util.List VALUES
Method Detail |
public static void setKingHigh()
public static void setAceHigh()
public java.lang.String getName()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getSymbol()
public int compareTo(java.lang.Object otherRankObject)
compareTo
in interface java.lang.Comparable
otherRankObject
- the other rank.
|
|||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |