Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.pokersource.enum
Class HandGroup  view HandGroup download HandGroup.java

java.lang.Object
  extended byorg.pokersource.enum.HandGroup
Direct Known Subclasses:
HoldemHandGroup

public class HandGroup
extends java.lang.Object

A HandGroup represents a set of poker hands that can be referred to by name. The specific way that hands are assigned to named groups is specific to each poker game. For example, in Holdem, named groups include specific holdings like "AhAd", "Kh2h"; canonical starting hands like "AKs", "TT"; or abdulian groups like "Q8s+". Subclasses like HoldemHandGroup define these groups for specific games.


Field Summary
(package private)  java.util.HashSet myhands
          Set of Long objects, each a bitmask for one hand.
(package private)  java.lang.String myspec
          String representation of hand group.
 
Constructor Summary
HandGroup()
           
 
Method Summary
 long[] getHands()
           
 boolean isHandInGroup(long hand)
           
 java.lang.String toString()
          Convert this Object to a human-readable String.
 java.lang.String toStringAtomic()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

myspec

java.lang.String myspec
String representation of hand group. Subclasses should accept this string in the constructor and save it here.


myhands

java.util.HashSet myhands
Set of Long objects, each a bitmask for one hand. Subclasses should, in their constructor, convert myspec into the set of corresponding hands. The set should be immutable once set in the constructor.

Constructor Detail

HandGroup

public HandGroup()
Method Detail

isHandInGroup

public boolean isHandInGroup(long hand)

getHands

public long[] getHands()

toString

public java.lang.String toString()
Description copied from class: java.lang.Object
Convert this Object to a human-readable String. There are no limits placed on how long this String should be or what it should contain. We suggest you make it as intuitive as possible to be able to place it into System.out.println() 55 and such.

It is typical, but not required, to ensure that this method never completes abruptly with a java.lang.RuntimeException.

This method will be called when performing string concatenation with this object. If the result is null, string concatenation will instead use "null".

The default implementation returns getClass().getName() + "@" + Integer.toHexString(hashCode()).


toStringAtomic

public java.lang.String toStringAtomic()