blackjackanalyst
Class PlayerHand

java.lang.Object
  extended by blackjackanalyst.Hand
      extended by blackjackanalyst.PlayerHand

public class PlayerHand
extends Hand

A hand of cards belonging to a player.

Author:
Michael Parker

Method Summary
 boolean beenSplit()
          Returns whether the hand has previously been split.
 int getBankroll()
          Returns the bankroll of the player to which this hand belongs.
 int getBetAmount()
          Returns the amount bet on this hand.
 int getBetNumber()
          Returns the unique identifier of this bet for the round.
 java.util.List<PlayerHand> getBets()
          Returns all bets belonging to the player this round.
 java.lang.String getName()
          Returns the name of the player to which this hand belongs.
 boolean isBlackjack()
          Returns whether the current hand is a blackjack.
 boolean isPair()
          Returns whether the hand is a pair, meaning it consists of two cards with the same value.
 
Methods inherited from class blackjackanalyst.Hand
getCards, getHighValidValue, getHighValue, getLowValue, getValues, isBusted, isFinished, isSoft, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

isPair

public boolean isPair()
Returns whether the hand is a pair, meaning it consists of two cards with the same value. If a hand consists of a pair, it can be split.

Returns:
true if the hand is a pair, false otherwise

beenSplit

public boolean beenSplit()
Returns whether the hand has previously been split. Hands that have previously been split cannot receive a blackjack.

Returns:
true if the hand has previously been split, false otherwise

getName

public java.lang.String getName()
Returns the name of the player to which this hand belongs.

Returns:
the player name

getBankroll

public int getBankroll()
Returns the bankroll of the player to which this hand belongs.

Returns:
the player bankroll

getBetAmount

public int getBetAmount()
Returns the amount bet on this hand.

Returns:
the amount bet

getBetNumber

public int getBetNumber()
Returns the unique identifier of this bet for the round. The first bet made by the player this round returns 0; each successive bet created by splitting increments the previous bet number.

Returns:
the unique identifier of this bet

getBets

public java.util.List<PlayerHand> getBets()
Returns all bets belonging to the player this round. This PlayerHand object is found at the index returned by method getBetnumber.

Returns:
all bets this round

isBlackjack

public boolean isBlackjack()
Returns whether the current hand is a blackjack. This method returns true if the hand is an ace and a ten-valued card, and the hand has not previously been split or the split card was not an ace.

Overrides:
isBlackjack in class Hand
Returns:
true if the hand is a blackjack, false otherwise