Class PatternTable


  • public class PatternTable
    extends java.lang.Object
    Stores the key patterns that can occur in the game. Acts as a fact hash lookup to find an index given a pattern. Do not add duplicate patterns or patterns that are the reverse of other patterns.
    • Constructor Summary

      Constructors 
      Constructor Description
      PatternTable()
      Constructor.
    • Constructor Detail

      • PatternTable

        public PatternTable()
        Constructor.
    • Method Detail

      • initTable

        protected void initTable()
      • getWeightIndexForPattern

        public int getWeightIndexForPattern​(java.lang.CharSequence pattern,
                                            int minpos,
                                            int maxpos)
        Parameters:
        pattern - pattern to get the weight index for.
        minpos - index of first character in pattern
        maxpos - index of last character position in pattern.
        Returns:
        weight index
      • setPatternWeightInTable

        public void setPatternWeightInTable​(java.lang.String pattern,
                                            int wtIndex)