|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectblackjackanalyst.Card
public class Card
A card, specified by its rank and suit.
| Nested Class Summary | |
|---|---|
static class |
Card.Rank
The rank of a card. |
static class |
Card.Suit
The suit of a card. |
| Field Summary | |
|---|---|
static int |
CARD_RANKS
The number of card ranks. |
static int |
CARD_SUITS
The number of card suits. |
static int |
CARDS_PER_DECK
The number of cards per deck. |
| Method Summary | |
|---|---|
static Card |
getCard(Card.Rank _card_rank,
Card.Suit _card_suit)
Returns the Card object having the given suit and rank. |
static Card |
getCard(int card_id)
Returns the Card having the given unique numerical
identifier. |
int |
getID()
Returns the unique numerical identifier of this card. |
Card.Rank |
getRank()
Returns the rank of this card. |
Card.Suit |
getSuit()
Returns the suit of this card. |
int |
getValue()
Returns the value of the card. |
boolean |
isAce()
Returns whether this card is an ace. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int CARD_SUITS
public static final int CARD_RANKS
public static final int CARDS_PER_DECK
| Method Detail |
|---|
public static Card getCard(Card.Rank _card_rank,
Card.Suit _card_suit)
Card object having the given suit and rank.
_card_rank - the rank of the card to retrieve_card_suit - the suit of the card to retrieve
Card object having the given rank and suitpublic static Card getCard(int card_id)
Card having the given unique numerical
identifier.
card_id - the numerical identifier of the card
public final Card.Rank getRank()
public final Card.Suit getSuit()
public int getValue()
1.
public boolean isAce()
true if this card is an ace, false
otherwisepublic int getID()
public java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||