|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcommon.Card
public class Card
| Field Summary | |
|---|---|
static int |
ACE
Indicates a card is an ace. |
static int |
CLUBS
Indicates that the card is a club. |
static int |
DIAMONDS
Indicates the the card is a diamond. |
static int |
HEARTS
Indicates the card is a heart. |
static int |
JACK
Indicates a card is a jack. |
static int |
KING
Indicates card is a king. |
static int |
QUEEN
Indicates a card is a queen. |
static int |
SPADES
Indicates the card is a spade. |
| Constructor Summary | |
|---|---|
Card(int cardVal,
int cardSuit)
Constructs a card with the specified value and suit. |
|
| Method Summary | |
|---|---|
int |
compareTo(java.lang.Object o)
Compares two card objects on the basis of card value w/o consideration of suit. |
boolean |
equals(java.lang.Object o)
Compares this card and another object. |
int |
getBlackjackValue()
Returns the numerical value of what the card is worth in blackjack. |
javax.swing.ImageIcon |
getImage()
Retrieves the picture file for this particular card. |
java.lang.String |
getSuit()
Returns a String representing the card's suit. |
int |
getSuitAsInt()
Returns an int representing the card's suit. |
int |
getValue()
Returns an int representation this card's value. |
java.lang.String |
getValueAsString()
Returns an int representing the card's value. |
java.lang.String |
toString()
Return a String representation of this card, such as "10 of Hearts" or "Queen of Spades". |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int CLUBS
public static final int DIAMONDS
public static final int SPADES
public static final int HEARTS
public static final int ACE
public static final int JACK
public static final int QUEEN
public static final int KING
| Constructor Detail |
|---|
public Card(int cardVal,
int cardSuit)
cardVal - int Value of the cardcardSuit - int Suit of the card.| Method Detail |
|---|
public javax.swing.ImageIcon getImage()
public java.lang.String getSuit()
public int getSuitAsInt()
public int getValue()
public java.lang.String getValueAsString()
public boolean equals(java.lang.Object o)
equals in class java.lang.Objecto - Object
public java.lang.String toString()
toString in class java.lang.Objectpublic int getBlackjackValue()
public int compareTo(java.lang.Object o)
compareTo in interface java.lang.Comparableo - Object that this object is being compared to.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||