|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.pokersource.enumerate.HoldemHandGroupFactory
public class HoldemHandGroupFactory
Creates instances of HoldemHandGroup-implementing objects from their string representations. Use of this factory is preferred to directly calling the constructors of subclasses, as the factory maintains a cache of immutable instances.
| Field Summary | |
|---|---|
private static java.util.HashMap |
cache
Cache of hand groups already instantiated. |
private static java.lang.Class[] |
groupClasses
Set of registered classes that we know how to instantiate. |
| Constructor Summary | |
|---|---|
private |
HoldemHandGroupFactory()
|
| Method Summary | |
|---|---|
static HoldemHandGroup |
getInstance(java.lang.String groupSpec)
Tries to parse groupSpec into a hand group using the constructors of the list of known classes. |
static HoldemHandGroup |
getInstance(java.lang.String groupSpec,
java.lang.Class gclass)
Tries to parse groupSpec into a hand group using the gclass constructor. |
private static HoldemHandGroup |
tryGetInstance(java.lang.Class gclass,
java.lang.String groupSpec)
Try to parse groupSpec using class gclass. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static java.lang.Class[] groupClasses
private static java.util.HashMap cache
| Constructor Detail |
|---|
private HoldemHandGroupFactory()
| Method Detail |
|---|
private static HoldemHandGroup tryGetInstance(java.lang.Class gclass,
java.lang.String groupSpec)
public static HoldemHandGroup getInstance(java.lang.String groupSpec,
java.lang.Class gclass)
public static HoldemHandGroup getInstance(java.lang.String groupSpec)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||