All Packages Class Hierarchy This Package Previous Next Index
Class com.lotspiech.poker.strategy.Pattern
java.lang.Object
|
+----com.lotspiech.poker.strategy.Pattern
- public abstract class Pattern
- extends Object
This is an abstract type that represents a particular
rule pattern.
Copyright 2001, 2002 by Jeffrey B. Lotspiech. This program is open source;
it is licensed under the Common Public License Version 0.5.
- Author:
- Jeffrey B. Lotspiech
-
COPYRIGHT
-
-
first
- a table: "first" one bit in a byte 0:31
-
next
-
-
ones
- a table: number of one-bits in a byte 0:31
-
rules
-
-
START_MASK
-
-
Pattern(Rules)
- This method was created in VisualAge.
-
compile(String)
- This method process the pattern string and does all the pre-calculation it can.
-
endingIndex(String, char)
- This method was created in VisualAge.
-
matches(int)
- This method returns true if the pattern matches the current hand.
-
next()
- Given that this pattern matches, this moves to the next
pattern in the rule and returns its value.
COPYRIGHT
private static final String COPYRIGHT
START_MASK
public static final int START_MASK
ones
protected static final int ones[]
- a table: number of one-bits in a byte 0:31
first
protected static final int first[]
- a table: "first" one bit in a byte 0:31
rules
protected Rules rules
next
protected Pattern next
Pattern
protected Pattern(Rules rules)
- This method was created in VisualAge.
- Parameters:
- rules - com.lotspiech.poker.strategy.Rules
compile
protected abstract void compile(String rule) throws PatternSyntaxException
- This method process the pattern string and does all the pre-calculation it can.
- Parameters:
- rule - The pattern string.
- Throws: PatternSyntaxException
- If there is a syntax error in the pattern string.
endingIndex
protected static final int endingIndex(String rule,
char end) throws PatternSyntaxException
- This method was created in VisualAge.
- Parameters:
- end - char
- Returns:
- int
- Throws: PatternSyntaxException
- The exception description.
matches
protected abstract boolean matches(int mask)
- This method returns true if the pattern matches the current hand.
- Parameters:
- mask - Cards available to use to match the pattern.
- Returns:
- true if the pattern matches the current hand.
next
protected boolean next()
- Given that this pattern matches, this moves to the next
pattern in the rule and returns its value. If there is
no next pattern, then it returns true.
- Returns:
- boolean
All Packages Class Hierarchy This Package Previous Next Index