|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object blackjackanalyst.Hand
public class Hand
A hand of cards.
Method Summary | |
---|---|
java.util.List<Card> |
getCards()
Returns a list containing the cards in the hand, appearing in the order in which they were added. |
int |
getHighValidValue()
Returns the highest possible value that can be made from the hand, but does not exceed 21. |
int |
getHighValue()
Returns the highest possible value that can be made from the hand. |
int |
getLowValue()
Returns the lowest possible value that can be made from the hand. |
java.util.Set<java.lang.Integer> |
getValues()
Returns all possible values that can be made from the hand, where values appear in ascending order. |
boolean |
isBlackjack()
Returns whether the current hand is a blackjack, which is an ace and a ten-valued card. |
boolean |
isBusted()
Returns whether the hand has busted, meaning that the smallest possible hand value is greater than 21. |
boolean |
isFinished()
Returns whether this hand is finished. |
boolean |
isSoft()
Returns whether the hand is soft, meaning that it has not busted and whether the highest value that does not exceed 21 contains an ace valued as 11. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public java.util.List<Card> getCards()
public int getHighValidValue()
-1
.
public int getLowValue()
public int getHighValue()
public java.util.Set<java.lang.Integer> getValues()
public boolean isBusted()
true
if the hand has busted, false
otherwisepublic boolean isBlackjack()
true
if the hand is a blackjack,
false
otherwisepublic boolean isSoft()
true
if the hand is soft, false
otherwisepublic boolean isFinished()
true
if the hand is finished, false
otherwisepublic 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 |