|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--inonit.domain.game.card.Rank
A number or value of a particular Card
.
Rank
s are conceptually values; two Rank
s with the same value are interchangeable.
Rank
objects are immutable.
Thirteen Rank
instances representing the normal values of playing cards are defined
as public static final
and are not individually documented.
Different card games have different rules about what Rank
s are highest; the two most common are defined
as static variables in the Rank.Order
class.
Inner Class Summary | |
static class |
Rank.Order
A logical ordering for Rank s; can be used to sort arrays of Card s and CardArray objects
via the Sort.Order s returned by getAscendingOrder and
getDescendingOrder , in conjunction with
CardArray's sort method. |
Field Summary | |
static Rank |
ACE
|
static Rank |
EIGHT
|
static Rank |
FIVE
|
static Rank |
FOUR
|
static Rank |
JACK
|
static Rank |
KING
|
static Rank |
NINE
|
static Rank |
QUEEN
|
static Rank |
SEVEN
|
static Rank |
SIX
|
static Rank |
TEN
|
static Rank |
THREE
|
static Rank |
TWO
|
Method Summary | |
boolean |
equals(java.lang.Object o)
Returns whether this Rank is equal to the given object. |
char |
getAbbreviation()
Returns an abbreviation representing the value of this Rank . |
java.lang.String |
getName()
Returns a string representing the value of this Rank . |
int |
hashCode()
Returns a hash code for this object. |
java.lang.String |
toString()
Returns a string representation of this object. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
public static Rank ACE
public static Rank KING
public static Rank QUEEN
public static Rank JACK
public static Rank TEN
public static Rank NINE
public static Rank EIGHT
public static Rank SEVEN
public static Rank SIX
public static Rank FIVE
public static Rank FOUR
public static Rank THREE
public static Rank TWO
Method Detail |
public java.lang.String toString()
toString
in class java.lang.Object
Rank.KING
, which may be useful
for debugging.public boolean equals(java.lang.Object o)
Rank
is equal to the given object.equals
in class java.lang.Object
o
- the object to which to compare this Rank
.true
if the given object is a Rank
and has the same value as this Rank
;
false
otherwise.public int hashCode()
hashCode
in class java.lang.Object
equals
.public java.lang.String getName()
Rank
.String
representing the value of this Rank
, e.g., "2", "10", "King".public char getAbbreviation()
Rank
.Rank
, e.g., '2', '4', 'T'
(for Rank.TEN
), 'Q', 'A'.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |