Class PatternExtractor
- java.lang.Object
-
- com.barrybecker4.game.twoplayer.gomoku.analysis.PatternExtractor
-
public class PatternExtractor extends java.lang.ObjectExtract a pattern from a line of symbols. A pattern consists of a sequence of friendly and unoccupied positions.
-
-
Constructor Summary
Constructors Constructor Description PatternExtractor(java.lang.CharSequence line)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected intgetEndPosition(java.lang.CharSequence line, char opponentSymb, int pos, int extremePos, int direction)March in the direction specified until we hit 2 blanks, an opponent piece, or the end of the line.protected java.lang.CharSequencegetPattern(char opponentSymb, int pos, int minpos, int maxpos)Given the opponent symbol, find the pattern in the specified potion of the line.
-
-
-
Method Detail
-
getPattern
protected java.lang.CharSequence getPattern(char opponentSymb, int pos, int minpos, int maxpos)Given the opponent symbol, find the pattern in the specified potion of the line.
-
getEndPosition
protected int getEndPosition(java.lang.CharSequence line, char opponentSymb, int pos, int extremePos, int direction)March in the direction specified until we hit 2 blanks, an opponent piece, or the end of the line.- Returns:
- end position
-
-