Class UserColumns<TColumn extends UserColumn>

    • Constructor Detail

      • UserColumns

        protected UserColumns​(String tableName,
                              List<TColumn> columns,
                              boolean custom)
        Constructor
        Parameters:
        tableName - table name
        columns - columns
        custom - custom column specification
      • UserColumns

        protected UserColumns​(UserColumns<TColumn> userColumns)
        Copy Constructor
        Parameters:
        userColumns - user columns
    • Method Detail

      • copy

        public abstract UserColumns<TColumn> copy()
        Copy the user columns
        Returns:
        copied user columns
      • updateColumns

        protected void updateColumns()
        Update the table columns
      • duplicateCheck

        protected void duplicateCheck​(int index,
                                      Integer previousIndex,
                                      String column)
        Check for duplicate column names
        Parameters:
        index - index
        previousIndex - previous index
        column - column
      • typeCheck

        protected void typeCheck​(GeoPackageDataType expected,
                                 TColumn column)
        Check for the expected data type
        Parameters:
        expected - expected data type
        column - user column
      • missingCheck

        protected void missingCheck​(Integer index,
                                    String column)
        Check for missing columns
        Parameters:
        index - column index
        column - user column
      • getColumnIndex

        public int getColumnIndex​(String columnName)
        Get the column index of the column name
        Parameters:
        columnName - column name
        Returns:
        column index
      • getColumnIndex

        public Integer getColumnIndex​(String columnName,
                                      boolean required)
        Get the column index of the column name
        Parameters:
        columnName - column name
        required - column existence is required
        Returns:
        column index
      • getColumnNames

        public String[] getColumnNames()
        Get the array of column names
        Returns:
        column names
      • getColumnName

        public String getColumnName​(int index)
        Get the column name at the index
        Parameters:
        index - column index
        Returns:
        column name
      • getColumns

        public List<TColumn> getColumns()
        Get the list of columns
        Returns:
        columns
      • getColumn

        public TColumn getColumn​(int index)
        Get the column at the index
        Parameters:
        index - column index
        Returns:
        column
      • getColumn

        public TColumn getColumn​(String columnName)
        Get the column of the column name
        Parameters:
        columnName - column name
        Returns:
        column
      • hasColumn

        public boolean hasColumn​(String columnName)
        Check if the table has the column
        Parameters:
        columnName - column name
        Returns:
        true if has the column
      • columnCount

        public int columnCount()
        Get the column count
        Returns:
        column count
      • getTableName

        public String getTableName()
        Get the table name
        Returns:
        table name
      • setTableName

        public void setTableName​(String tableName)
        Set the table name
        Parameters:
        tableName - table name
      • isCustom

        public boolean isCustom()
        Is custom column specification (partial and/or ordering)
        Returns:
        custom flag
      • setCustom

        public void setCustom​(boolean custom)
        Set the custom column specification flag
        Parameters:
        custom - custom flag
      • hasPkColumn

        public boolean hasPkColumn()
        Check if the table has a primary key column
        Returns:
        true if has a primary key
      • getPkColumnIndex

        public int getPkColumnIndex()
        Get the primary key column index
        Returns:
        primary key column index
      • getPkColumn

        public TColumn getPkColumn()
        Get the primary key column
        Returns:
        primary key column
      • getPkColumnName

        public String getPkColumnName()
        Get the primary key column name
        Returns:
        primary key column name
      • columnsOfType

        public List<TColumn> columnsOfType​(GeoPackageDataType type)
        Get the columns with the provided data type
        Parameters:
        type - data type
        Returns:
        columns
      • isPkModifiable

        public boolean isPkModifiable()
        Is the primary key modifiable
        Returns:
        true if the primary key is modifiable
        Since:
        4.0.0
      • setPkModifiable

        public void setPkModifiable​(boolean pkModifiable)
        Set if the primary key can be modified
        Parameters:
        pkModifiable - primary key modifiable flag
        Since:
        4.0.0
      • isValueValidation

        public boolean isValueValidation()
        Is value validation against column types enabled
        Returns:
        true if values are validated against column types
        Since:
        4.0.0
      • setValueValidation

        public void setValueValidation​(boolean valueValidation)
        Set if values should validated against column types
        Parameters:
        valueValidation - value validation flag
        Since:
        4.0.0
      • addColumn

        public void addColumn​(TColumn column)
        Add a new column
        Parameters:
        column - new column
      • renameColumn

        public void renameColumn​(TColumn column,
                                 String newColumnName)
        Rename a column
        Parameters:
        column - column
        newColumnName - new column name
      • renameColumn

        public void renameColumn​(String columnName,
                                 String newColumnName)
        Rename a column
        Parameters:
        columnName - column name
        newColumnName - new column name
      • renameColumn

        public void renameColumn​(int index,
                                 String newColumnName)
        Rename a column
        Parameters:
        index - column index
        newColumnName - new column name
      • dropColumn

        public void dropColumn​(TColumn column)
        Drop a column
        Parameters:
        column - column to drop
      • dropColumn

        public void dropColumn​(String columnName)
        Drop a column
        Parameters:
        columnName - column name
      • dropColumn

        public void dropColumn​(int index)
        Drop a column
        Parameters:
        index - column index
      • alterColumn

        public void alterColumn​(TColumn column)
        Alter a column
        Parameters:
        column - altered column
      • hasSchema

        public boolean hasSchema()
        Check if any columns have an in-memory data columns schema
        Returns:
        true if has a column schema
        Since:
        6.6.7