Package adams.data

Class SharedStringsTable

    • Field Detail

      • m_Map

        protected gnu.trove.map.hash.TObjectIntHashMap<String> m_Map
        the string / index relation.
      • m_Strings

        protected ArrayList<String> m_Strings
        the ordered list of strings.
    • Constructor Detail

      • SharedStringsTable

        public SharedStringsTable()
        Initializes the table.
    • Method Detail

      • clear

        public void clear()
        Resets the table.
      • assign

        public void assign​(SharedStringsTable table)
        Retrieves all the values from the specified table, discards its own values.
        Parameters:
        table - the table to obtain the data from
      • getIndex

        public int getIndex​(String s)
        Returns the index for the given string. If not already present, it will add the string to its internal
        Parameters:
        s - the string to get the index for
        Returns:
        the index
      • getString

        public String getString​(int index)
        Returns the string associated with the given index.
        Parameters:
        index - the index of the string to retrieve
        Returns:
        the associated string, null if not found
      • size

        public int size()
        Returns the number of stored mappings.
        Returns:
        the number of mappings
      • toString

        public String toString()
        Returns a short string description of the table.
        Overrides:
        toString in class Object
        Returns:
        the description