Class Ranker

java.lang.Object
  extended by Ranker

public class Ranker
extends java.lang.Object

Provides methods needed to rank Texas Holdem poker hands.

Core behaviors:
  I. Ranks hands on the Flop as follows:(in progress)
    01. Checks for Royal Flush on the Flop (implemented)
    02. Checks for Straight Flush on the Flop (implemented)
    03. Checks for Quad (four of a kind) on the Flop (implemented)
    04. Checks for Full House on the Flop (implemented)
    05. Checks for Flush (non royal/non straight) on the Flop (implemented)
    06. Checks for Straight (non royal/non flush) on the Flop (implemented)
    07. Checks for Trips (three of a kind) on the Flop (implemented)
    08. Checks for Two Pair on the Flop (TESTING implementation)
    09. Checks for One Pair on the Flop (TESTING implementation)
    10. Checks for High Card on the Flop (TESTING implementation)
  II. Repeats behaviors I.01 - I.10 on the Turn (NOT implemented)
  III. Repeats behaviors I.01 - I.10 on the River (NOT implemented)

Auxiliary behaviors:
  01. Prints evaluated hand contents to the console (implemented)

Possible future behaviors:
  01. None.

Version:
0.0.0.1
Author:
Joe C. Summars

Constructor Summary
Ranker()
           
 
Method Summary
static int evalFlopHandFor1Pair(int playerNumber, java.lang.String[] flopHandCardSuit, int[] flopHandCardValue, int thisHandValue, java.lang.String[] topHandType, int topHandSeat, int[] top1PRValue, int[] topPairValue)
           
static int evalFlopHandFor2Pair(int playerNumber, java.lang.String[] flopHandCardSuit, int[] flopHandCardValue, int thisHandValue, java.lang.String[] topHandType, int topHandSeat, int[] top2PRValue)
           
static int evalFlopHandForFlush(int playerNumber, java.lang.String[] flopHandCardSuit, int[] flopHandCardValue, int thisHandValue, java.lang.String[] topHandType, int topHandSeat, int[] topFLSValue)
          Checks if hand is flush (non-Royal and non-Straight) ranking by hand cards point sum per JNS point system.
static int evalFlopHandForFullHouse(int playerNumber, java.lang.String[] flopHandCardSuit, int[] flopHandCardValue, int thisHandValue, java.lang.String[] topHandType, int topHandSeat, int[] topFHSValue)
          Checks if hand is a Full House on the flop.
static int evalFlopHandForHighCard(int playerNumber, java.lang.String[] flopHandCardSuit, int[] flopHandCardValue, int thisHandValue, java.lang.String[] topHandType, int topHandSeat, int[] topCRDValue)
           
static int evalFlopHandForQuad(int playerNumber, java.lang.String[] flopHandCardSuit, int[] flopHandCardValue, int thisHandValue, java.lang.String[] topHandType, int topHandSeat)
          Checks if hand is a quad (four of a kind) on the flop.
static int evalFlopHandForRoyalFlush(int playerNumber, java.lang.String[] flopHandCardSuit, int thisHandValue, java.lang.String[] topHandType, int topHandSeat)
          Checks if hand is a royal flush (using suit ranking order Spade->Heart->Diamond->Club to break a tie).
static int evalFlopHandForStraight(int playerNumber, java.lang.String[] flopHandCardSuit, int[] flopHandCardValue, int thisHandValue, java.lang.String[] topHandType, int topHandSeat, int[] topSTRValue)
           
static int evalFlopHandForStraightFlush(int playerNumber, java.lang.String[] flopHandCardSuit, int[] flopHandCardValue, int thisHandValue, java.lang.String[] topHandType, int topHandSeat)
          Checks if hand is a straight flush (using suit ranking order Spade->Heart->Diamond->Club to break a tie).
static int evalFlopHandForTrips(int playerNumber, java.lang.String[] flopHandCardSuit, int[] flopHandCardValue, int thisHandValue, java.lang.String[] topHandType, int topHandSeat, int[] topTRPValue)
           
static void printFlopHand(int playerNumber, int[] flopHandCardValue, java.lang.String[] flopHandCardSuit, int thisHandValue)
          Outputs a player's hand to the console.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Ranker

public Ranker()
Method Detail

evalFlopHandForRoyalFlush

public static int evalFlopHandForRoyalFlush(int playerNumber,
                                            java.lang.String[] flopHandCardSuit,
                                            int thisHandValue,
                                            java.lang.String[] topHandType,
                                            int topHandSeat)
Checks if hand is a royal flush (using suit ranking order Spade->Heart->Diamond->Club to break a tie).

Parameters:
playerNumber - Player's position at the table.
flopHandCardSuit - Store for flop hand suits.
thisHandValue - This hand's value per JNS point value system.
topHandType - The current top hand type.
topHandSeat - The current top hand seat number (-1 if no top hand candidate has been found yet).

evalFlopHandForStraightFlush

public static int evalFlopHandForStraightFlush(int playerNumber,
                                               java.lang.String[] flopHandCardSuit,
                                               int[] flopHandCardValue,
                                               int thisHandValue,
                                               java.lang.String[] topHandType,
                                               int topHandSeat)
Checks if hand is a straight flush (using suit ranking order Spade->Heart->Diamond->Club to break a tie).

Parameters:
playerNumber - Player's position at the table.
flopHandCardSuit - Store for flop hand suits.
thisHandValue - This hand's value per JNS point value system.
topHandType - The current top hand type.
topHandSeat - The current top hand seat number (-1 if not yet determined).

evalFlopHandForQuad

public static int evalFlopHandForQuad(int playerNumber,
                                      java.lang.String[] flopHandCardSuit,
                                      int[] flopHandCardValue,
                                      int thisHandValue,
                                      java.lang.String[] topHandType,
                                      int topHandSeat)
Checks if hand is a quad (four of a kind) on the flop. Only one quad hand on the flop is ever possible. This method sorts the hand and then checks for four adjacent matching card values. Card suit is ignored.

Parameters:
playerNumber - Player's position at the table.
flopHandCardSuit - Store for flop hand suits.
thisHandValue - This hand's value per JNS point value system.
topHandType - The current top hand type.
topHandSeat - The current top hand seat number (-1 if not yet determined).

evalFlopHandForFullHouse

public static int evalFlopHandForFullHouse(int playerNumber,
                                           java.lang.String[] flopHandCardSuit,
                                           int[] flopHandCardValue,
                                           int thisHandValue,
                                           java.lang.String[] topHandType,
                                           int topHandSeat,
                                           int[] topFHSValue)
Checks if hand is a Full House on the flop. Multiple Full Houses on flop are possible. This method sorts the hand and then checks for three and two adjacent matching card sets. Card suit is ignored.

Parameters:
playerNumber - Player's position at the table.
flopHandCardSuit - Store for flop hand suits.
thisHandValue - This hand's value per JNS point value system.
topHandType - The current top hand type.
topHandSeat - The current top hand seat number (-1 if not yet determined).
topFHSValue - The current top hand value of all Full Houses detected and evaluated.

evalFlopHandForFlush

public static int evalFlopHandForFlush(int playerNumber,
                                       java.lang.String[] flopHandCardSuit,
                                       int[] flopHandCardValue,
                                       int thisHandValue,
                                       java.lang.String[] topHandType,
                                       int topHandSeat,
                                       int[] topFLSValue)
Checks if hand is flush (non-Royal and non-Straight) ranking by hand cards point sum per JNS point system.

Parameters:
playerNumber - Player's position at the table.
flopHandCardSuit - Store for flop hand suits.
flopHandCardValue - Store for flop hand card values.
thisHandValue - This hand's value per JNS point value system.
topHandType - The current top hand type.
topHandSeat - The current top hand seat number (-1 if no top hand candidate has been found yet).
topFLSValue - The current top Flush (non-Royal, non-Straight) hand value.

evalFlopHandForStraight

public static int evalFlopHandForStraight(int playerNumber,
                                          java.lang.String[] flopHandCardSuit,
                                          int[] flopHandCardValue,
                                          int thisHandValue,
                                          java.lang.String[] topHandType,
                                          int topHandSeat,
                                          int[] topSTRValue)

evalFlopHandForTrips

public static int evalFlopHandForTrips(int playerNumber,
                                       java.lang.String[] flopHandCardSuit,
                                       int[] flopHandCardValue,
                                       int thisHandValue,
                                       java.lang.String[] topHandType,
                                       int topHandSeat,
                                       int[] topTRPValue)

evalFlopHandFor2Pair

public static int evalFlopHandFor2Pair(int playerNumber,
                                       java.lang.String[] flopHandCardSuit,
                                       int[] flopHandCardValue,
                                       int thisHandValue,
                                       java.lang.String[] topHandType,
                                       int topHandSeat,
                                       int[] top2PRValue)

evalFlopHandFor1Pair

public static int evalFlopHandFor1Pair(int playerNumber,
                                       java.lang.String[] flopHandCardSuit,
                                       int[] flopHandCardValue,
                                       int thisHandValue,
                                       java.lang.String[] topHandType,
                                       int topHandSeat,
                                       int[] top1PRValue,
                                       int[] topPairValue)

evalFlopHandForHighCard

public static int evalFlopHandForHighCard(int playerNumber,
                                          java.lang.String[] flopHandCardSuit,
                                          int[] flopHandCardValue,
                                          int thisHandValue,
                                          java.lang.String[] topHandType,
                                          int topHandSeat,
                                          int[] topCRDValue)

printFlopHand

public static void printFlopHand(int playerNumber,
                                 int[] flopHandCardValue,
                                 java.lang.String[] flopHandCardSuit,
                                 int thisHandValue)
Outputs a player's hand to the console.

Parameters:
playerNumber - Player's position at the table.
flopHandCardValue - Store for the flop hand card values.
flopHandCardSuit - Store for flop hand card suits.
thisHandValue - This hand's value per JNS point value system.