blue.cards
Class Card
java.lang.Object
|
+--blue.cards.Card
- public class Card
- extends java.lang.Object
A 'card' is modeled in terms of its rank and its suit.
Constructor Summary |
Card(int r,
java.lang.String s)
Create a card. |
Card(java.lang.String r,
java.lang.String s)
Create a card. |
Method Summary |
void |
print()
Print this card as an 'ordered pair'. |
void |
println()
Print this card as an 'ordered pair' followed by a newline. |
void |
printRank()
Print the rank of this card. |
void |
printSuit()
Print the suit of this card. |
int |
rank()
Returns the rank of this card. |
int |
suit()
Returns the suit of this card. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
JACK
public static final int JACK
QUEEN
public static final int QUEEN
KING
public static final int KING
ACE
public static final int ACE
CLUB
public static final int CLUB
DIAMOND
public static final int DIAMOND
HEART
public static final int HEART
SPADE
public static final int SPADE
Card
public Card(int r,
java.lang.String s)
- Create a card.
- Parameters:
r
- the rank of the cards
- the suit of the card
Card
public Card(java.lang.String r,
java.lang.String s)
- Create a card.
- Parameters:
r
- the rank of the cards
- the suit of the card
rank
public int rank()
- Returns the rank of this card.
suit
public int suit()
- Returns the suit of this card.
print
public void print()
- Print this card as an 'ordered pair'.
println
public void println()
- Print this card as an 'ordered pair' followed by a newline.
printRank
public void printRank()
- Print the rank of this card.
printSuit
public void printSuit()
- Print the suit of this card.