com.javaflair.pokerprophesier.api.card
Class Hand

java.lang.Object
  extended by com.javaflair.pokerprophesier.api.card.Hand

public class Hand
extends Object

A representation of a poker hand.

Author:
Javaflair

Field Summary
static int FLUSH
          Flush
static int FOUR_OF_A_KIND
          Four-of-a-kind
static int FULL_HOUSE
          Full house
static int HIGH_CARD
          High card
static int PAIR
          Pair
static int STRAIGHT
          Straight
static int STRAIGHT_FLUSH
          Straight flush
static int THREE_OF_A_KIND
          Three-of-a-kind
static int TWO_PAIRS
          Two pairs
 
Constructor Summary
Hand(int handRank, Card[] cards)
          Creates a hand with the specified rank and set of cards.
 
Method Summary
 Card[] getCards()
          Returns the cards in the hand.
 int getHandRank()
          Returns the hand rank.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

HIGH_CARD

public static final int HIGH_CARD
High card

See Also:
Constant Field Values

PAIR

public static final int PAIR
Pair

See Also:
Constant Field Values

TWO_PAIRS

public static final int TWO_PAIRS
Two pairs

See Also:
Constant Field Values

THREE_OF_A_KIND

public static final int THREE_OF_A_KIND
Three-of-a-kind

See Also:
Constant Field Values

STRAIGHT

public static final int STRAIGHT
Straight

See Also:
Constant Field Values

FLUSH

public static final int FLUSH
Flush

See Also:
Constant Field Values

FULL_HOUSE

public static final int FULL_HOUSE
Full house

See Also:
Constant Field Values

FOUR_OF_A_KIND

public static final int FOUR_OF_A_KIND
Four-of-a-kind

See Also:
Constant Field Values

STRAIGHT_FLUSH

public static final int STRAIGHT_FLUSH
Straight flush

See Also:
Constant Field Values
Constructor Detail

Hand

public Hand(int handRank,
            Card[] cards)
Creates a hand with the specified rank and set of cards. A hand must be a valid constant and can not consist of null cards. No validation is performed to ensure that the cards specified equate to the hand specified.

Parameters:
handRank - the hand rank
cards - the hand cards
Method Detail

getHandRank

public int getHandRank()
Returns the hand rank.

Returns:
the hand rank

getCards

public Card[] getCards()
Returns the cards in the hand.

Returns:
the hand cards

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2006 Javaflair. All Rights Reserved.