java.lang.Object
org.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.
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.
HandGroup
public HandGroup()
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()