Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.pokersource.enumerate
Class BaseHandGroup

    java.lang.Object
      org.pokersource.enumerate.BaseHandGroup

All Implemented Interfaces:
  java.lang.Comparable, HandGroup

Direct Known Subclasses:
  HoldemAbdulGroup, HoldemAtomicGroup, HoldemCanonGroup, HoldemSMGroup, HoldemUniversalGroup, ThresholdHandGroup

    public class BaseHandGroup

extends java.lang.Object
implements HandGroup, java.lang.Comparable

Implements the HandGroup interface in a way that will work for most poker games. Subclasses can override if necessary.

Author:
  Michael Maurer <mjmaurer@yahoo.com>
See Also:
  `HandGroup`, `HoldemHandGroup`

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
`BaseHandGroup()`

Method Summary
`int` | `compareTo(java.lang.Object o)` Define default sort order based on string representation.
`java.lang.String` | `getGroupSpec()`
`long[]` | `getHands()` Returns an array of atomic hands (each encoded as a long).
`java.util.Set` | `getHandSet()`
`boolean` | `isHandInGroup(long hand)`
`int` | `numHands()`
`java.lang.String` | `toString()`
`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

### BaseHandGroup

    public BaseHandGroup()

Method Detail

### getGroupSpec

    public java.lang.String getGroupSpec()

  Specified by:
    `getGroupSpec` in interface `HandGroup`

### numHands

    public int numHands()

  Specified by:
    `numHands` in interface `HandGroup`

### getHands

    public long[] getHands()

  Returns an array of atomic hands (each encoded as a long).

  Specified by:
    `getHands` in interface `HandGroup`
  See Also:
    `Deck`

### getHandSet

    public java.util.Set getHandSet()

  Specified by:
    `getHandSet` in interface `HandGroup`

### isHandInGroup

    public boolean isHandInGroup(long hand)

  Specified by:
    `isHandInGroup` in interface `HandGroup`

### toString

    public java.lang.String toString()

  Specified by:
    `toString` in interface `HandGroup`
  Overrides:
    `toString` in class `java.lang.Object`

### toStringAtomic

    public java.lang.String toStringAtomic()

  Specified by:
    `toStringAtomic` in interface `HandGroup`

### compareTo

    public int compareTo(java.lang.Object o)

  Define default sort order based on string representation.

  Specified by:
    `compareTo` in interface `java.lang.Comparable`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD