Class CachingSplitter

java.lang.Object
io.higson.runtime.helper.parser.CachingSplitter

public class CachingSplitter extends Object
Splits text with given separator and caches [maxSize] results. Result's tokens are internalized, so take no additional heap memory.
  • Constructor Details

    • CachingSplitter

      public CachingSplitter(char separator, int maxSize)
    • CachingSplitter

      public CachingSplitter(char separator)
  • Method Details

    • setCacheSize

      public void setCacheSize(int maxSize)
    • split

      public String[] split(String text)
      Splits provided [text] with given [separator]. If result is not found in cache, it is created. Result that would be put to the cache is internalized.
    • separator

      public char separator()