|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object proj2.Rank
public class Rank
The Rank class defines each of the 13 ranks of a standard deck of playing cards. Using this class assures that all code refers to the ranks in the same manner. i.e Rank.ACE, Rank.TWO, ... Rank.QUEEN, Rank.KING with no possibility of conflicting representations.
Class Invariant:
The Rank's symbol is a single alpha-numeric character
The Ranks's name is a non-empty string
Rank objects are immutable and unique
Field Summary | |
---|---|
static Rank |
ACE
The rank ACE |
static Rank |
EIGHT
The rank EIGHT (8) |
static Rank |
FIVE
The rank FIVE (5) |
static Rank |
FOUR
The rank FOUR (4) |
static Rank |
JACK
The rank JACK |
static Rank |
KING
The rank KING |
static Rank |
NINE
The rank NINE (9) |
static Rank |
QUEEN
The rank QUEEN |
static Rank |
SEVEN
The rank SEVEN (7) |
static Rank |
SIX
The rank SIX (6) |
static Rank |
TEN
The rank TEN (10) |
static Rank |
THREE
The rank THREE (3) |
static Rank |
TWO
The rank TWO (2) |
Method Summary | |
---|---|
boolean |
equals(Rank otherRank)
Determines if two Rank objects are equal |
java.lang.String |
getName()
Accessor for the Rank's name |
java.lang.String |
getSymbol()
Accessor the Rank's symbol |
static Rank[] |
VALUES()
VALUES A static method to return all ranks |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, 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
Method Detail |
---|
public static Rank[] VALUES()
public java.lang.String getSymbol()
public java.lang.String getName()
public boolean equals(Rank otherRank)
otherRank
- to be compared with
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |