|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.ObjectPlayingCard
public class PlayingCard
| Constructor Summary | |
|---|---|
PlayingCard(int cardRank,
char cardSuit)
Constructs a single playing card given the card rank and suit in the parameters. |
|
| Method Summary | |
|---|---|
int |
compareTo(PlayingCard otherCard)
Returns a positive integer if this card has a lower rank than the other card, a negative integer if this card has a higher rank than the other card, or 0 if this card's rank is the same as the other card's rank. |
java.lang.String |
getImageFileName()
Gets the image file name for this card. |
int |
getRank()
Gets the rank of this card. |
char |
getSuit()
Gets the suit of this card. |
java.lang.String |
toString()
Returns the string representation of this card including its rank and suit. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public PlayingCard(int cardRank,
char cardSuit)
cardRank - The rank of the desired card from 1 (Ace). 2, 3, ..., 10, 11 (Jack), 12 (Queen), 13 (King)cardSuit - The suit of the desired card ('C' is Clubs, 'S' is Spades, 'H' is Hearts, 'D' is Diamonds)| Method Detail |
|---|
public int getRank()
public char getSuit()
public java.lang.String getImageFileName()
public java.lang.String toString()
toString in class java.lang.Objectpublic int compareTo(PlayingCard otherCard)
compareTo in interface java.lang.Comparable<PlayingCard>
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||