Class StringSet


  • final class StringSet
    extends java.lang.Object
    Like string heap, but keeps strings in a hashmap (for quick testing) and an array list. This is used to emulate how v2 keeps strings, to support backwards compatibility for low-level access
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private int lastStringCode  
      private java.util.HashMap<java.lang.String,​java.lang.Integer> string2int  
      private java.util.ArrayList<java.lang.String> strings  
    • Constructor Summary

      Constructors 
      Constructor Description
      StringSet()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) int getCodeForString​(java.lang.String s)
      get the code for a string, adding it to the string table if not already there.
      (package private) int getSize()  
      (package private) java.lang.String getStringForCode​(int stringCode)  
      (package private) void reset()  
      • Methods inherited from class java.lang.Object

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

      • lastStringCode

        private int lastStringCode
      • strings

        private final java.util.ArrayList<java.lang.String> strings
      • string2int

        private final java.util.HashMap<java.lang.String,​java.lang.Integer> string2int
    • Constructor Detail

      • StringSet

        StringSet()
    • Method Detail

      • reset

        void reset()
      • getStringForCode

        java.lang.String getStringForCode​(int stringCode)
      • getCodeForString

        int getCodeForString​(java.lang.String s)
        get the code for a string, adding it to the string table if not already there.
        Parameters:
        s - The string.
        Returns:
        The code corresponding to the string, which can be used in the getStringForCode call above
      • getSize

        int getSize()