Class TableNameMapImpl

  • All Implemented Interfaces:
    NameMap, TableNameMap, Iterable<NameMap.Record>

    public class TableNameMapImpl
    extends NameMapImpl
    implements TableNameMap
    The name map of a table, which can be changed and saved back into the property of the table.
    Author:
    James Ahlborn
    Usage:
    Advanced: This class is for advanced/internal use.
    • Method Detail

      • read

        public static TableNameMapImpl read​(byte[] bytes,
                                            TableImpl table)
                                     throws IOException
        Parameters:
        bytes - the value of the name map property of a table
        table - the table which holds the property
        Returns:
        the decoded name map
        Throws:
        IOException - if the bytes are not a valid name map
      • getReferences

        public List<NameMap.Record> getReferences()
        Specified by:
        getReferences in interface TableNameMap
        Returns:
        the records for the names which expressions in the table use, in the order of the name map
      • addColumn

        public NameMap.Record addColumn​(String name,
                                        String guid)
        Description copied from interface: TableNameMap
        Adds a column record before the end record.
        Specified by:
        addColumn in interface TableNameMap
        Parameters:
        name - the column name
        guid - the guid of the column, which must be the same as the "GUID" property of the column
        Returns:
        the new record
      • removeColumn

        public NameMap.Record removeColumn​(String name)
        Description copied from interface: TableNameMap
        Removes the column record with the given name (case-insensitive).
        Specified by:
        removeColumn in interface TableNameMap
        Returns:
        the removed record, or null if there is none
      • findMismatches

        public List<NameMap.Mismatch> findMismatches()
                                              throws IOException
        Description copied from interface: TableNameMap
        Compares the table and column records with the table which holds this name map. A column is found by its guid, and by its name when it has no guid or no record carries it.
        Specified by:
        findMismatches in interface NameMap
        Specified by:
        findMismatches in interface TableNameMap
        Returns:
        every difference, empty if the name map agrees with the table
        Throws:
        IOException