org.pokersource.enum

Class ThresholdHandGroup

Implemented Interfaces:
Comparable, HandGroup
Known Direct Subclasses:
HoldemThresholdGroup

public class ThresholdHandGroup
extends BaseHandGroup

Given a mapping from hand groups G_i to numeric values, this class allows you to build a new hand group as the union of those G_i whose numeric values are less than or greater than a certain threshold. For example, you could assign a numeric 'strength' to each canonical hand G_i and then create a new group consisting of those G_i whose strength exceeds some minimum value.
Author:
Michael Maurer <mjmaurer@yahoo.com>

Field Summary

Fields inherited from class org.pokersource.enum.BaseHandGroup

myhands, myspec

Constructor Summary

ThresholdHandGroup(String groupSpec)
Create a set of hands corresponding to those whose value compares either less than or greater than a threshold value, where the value of each hand is defined by a HandValuation.

Method Summary

static void
main(String[] args)
static void
registerHandValuation(String valuationName, HandValuation valuation)
Register a new HandValuation that will be referred to as valuationName.

Methods inherited from class org.pokersource.enum.BaseHandGroup

compareTo, getGroupSpec, getHandSet, getHands, isHandInGroup, numHands, toString, toStringAtomic

Constructor Details

ThresholdHandGroup

public ThresholdHandGroup(String groupSpec)
Create a set of hands corresponding to those whose value compares either less than or greater than a threshold value, where the value of each hand is defined by a HandValuation.
Parameters:
groupSpec - Defines a hand valuation, a threshold value, and a comparator. The hand valuation is referred to by a string previously registered with registerHandValuation(). The threshold value is a number in decimal form. The comparator is one of '<', '<=', '>', '>='.

Method Details

main

public static void main(String[] args)

registerHandValuation

public static void registerHandValuation(String valuationName,
                                         HandValuation valuation)
Register a new HandValuation that will be referred to as valuationName. For example, if you register a valuation as 'MYVAL', one can later instantiate a hand group using a syntax like 'MYVAL>0.80'; the hand group will include all hands to which the registered valuation assigns a numeric value greater than 0.80.

PokerSource Home Page - Learn how you can contribute!