Class StringHeap


  • final class StringHeap
    extends java.lang.Object
    Encapsulate string storage for the CAS.
    • Field Detail

      • stringList

        private java.util.List<java.lang.String> stringList
    • Constructor Detail

      • StringHeap

        StringHeap()
    • Method Detail

      • initMemory

        private void initMemory()
      • reinit

        void reinit​(StringHeapDeserializationHelper shdh,
                    boolean delta)
        Deserialize from a binary serialized CAS
        Parameters:
        shdh - Serialization helper datastructure.
      • serialize

        StringHeapDeserializationHelper serialize()
        Create serialization helper datastructure.
        Returns:
        Serialization helper that can be interpreted easier by serialization code.
      • reset

        void reset()
      • getStringForCode

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

        int copyCharsToBuffer​(int stringCode,
                              char[] buffer,
                              int start)
      • addString

        int addString​(java.lang.String s)
        Add a string.
        Parameters:
        s - The string.
        Returns:
        The positional code of the added string.
      • cloneStringReference

        int cloneStringReference​(int stringCode)
      • addCharBuffer

        int addCharBuffer​(char[] buffer,
                          int start,
                          int length)
      • getCharArrayLength

        int getCharArrayLength​(int stringCode)
      • getLeastStringCode

        int getLeastStringCode()
      • getLargestStringCode

        int getLargestStringCode()
      • getSize

        int getSize()
      • toArray

        public java.lang.String[] toArray()