Class WordResolver.Builder

  • Enclosing class:
    WordResolver

    private static final class WordResolver.Builder
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) char[] mData  
      (package private) int mSize
      Number of characters currently used from mData
      (package private) java.lang.String[] mWords  
    • Constructor Summary

      Constructors 
      Constructor Description
      Builder​(java.util.TreeSet<java.lang.String> wordSet)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      WordResolver construct()  
      private void constructBranch​(int charIndex, int start, int end)
      Method that is called recursively to build the data representation for a branch, ie.
      private char[] expand​(int needSpace)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • mWords

        final java.lang.String[] mWords
      • mData

        char[] mData
      • mSize

        int mSize
        Number of characters currently used from mData
    • Constructor Detail

      • Builder

        public Builder​(java.util.TreeSet<java.lang.String> wordSet)
    • Method Detail

      • construct

        public WordResolver construct()
        Returns:
        Raw character data that contains compressed structure of the word set
      • constructBranch

        private void constructBranch​(int charIndex,
                                     int start,
                                     int end)
        Method that is called recursively to build the data representation for a branch, ie. part of word set tree that still has more than one ending
        Parameters:
        charIndex - Index of the character in words to consider for this round
        start - Index of the first word to be processed
        end - Index of the word after last word to be processed (so that number of words is end - start - 1
      • expand

        private char[] expand​(int needSpace)