|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--BlackJackHand
Field Summary | |
static int |
MAX_GOOD_VALUE
|
Constructor Summary | |
BlackJackHand()
pre: none post: creates an empty Hand |
|
BlackJackHand(Card c)
pre: c != null post: creates a Hand with one Card |
Method Summary | |
void |
addCard(Card c)
|
boolean |
blackjack()
pre: size() = 2 post: returns true if this hand is a Blackjack |
boolean |
busted()
pre: none post: returns true if this Hand's value is > 21 |
int |
getValue()
|
int |
size()
pre: none post: return number of cards in this Hand |
BlackJackHand |
split()
pre: splittable() post: reduce this Hand to one card, and create a new Hand object with the other card |
boolean |
splittable()
pre: size() = 2 post: returns true if this Hand can be legally spilt, that is the hand has size two and both cards are of equal value |
String |
toString()
pre: none post: return a string version of the cards in this hand |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int MAX_GOOD_VALUE
Constructor Detail |
public BlackJackHand()
public BlackJackHand(Card c)
Method Detail |
public void addCard(Card c)
public boolean blackjack()
public boolean busted()
public int getValue()
public int size()
public BlackJackHand split()
public boolean splittable()
public String toString()
toString
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |