com.groupdocs.assembly.system.data

Class DataColumn

  • java.lang.Object
    • com.groupdocs.assembly.system.data.DataColumn


  • public final class DataColumn
    extends java.lang.Object
    Represents the schema of a column in a DataTable.
    • Constructor Detail

      • DataColumn

        public DataColumn()
        Initializes a new instance of a DataColumn class as type string.
      • DataColumn

        public DataColumn(java.lang.String columnName)
        Inititalizes a new instance of the DataColumn class, as type string, using the specified column name.
        Parameters:
        columnName - A string that represents the name of the column to be created. If set to null or an empty string (""), a default name will be specified when added to the columns collection.
      • DataColumn

        public DataColumn(java.lang.String name,
                          DataTable table)
        Initializes a new instance of the @{link DataColumn} class using the specified column name and table it belongs to.
        Parameters:
        name - name of the DataColumn
        table - the table this column belongs to
      • DataColumn

        public DataColumn(java.lang.String columnName,
                          java.lang.Class dataType)
        Inititalizes a new instance of the DataColumn class using the specified column name and data type.
        Parameters:
        columnName - A string that represents the name of the column to be created. If set to null or an empty string (""), a default name will be specified when added to the columns collection.
        dataType - A supported getDataType() / setDataType(java.lang.Class).
      • DataColumn

        public DataColumn(java.lang.String name,
                          java.lang.Class type,
                          DataTable table)
        Initializes a new instance of the DataColumn class using the specified column name, data type and data table it belongs to.
        Parameters:
        name - name of the DataColumn
        type - data type
        table - the table this column belongs to
    • Method Detail

      • getColumnName

        public final java.lang.String getColumnName()
        Gets the name of the column in the DataColumnCollection.
        Returns:
        The name of the column.
      • setColumnName

        public final void setColumnName(java.lang.String value)
        Sets the name of the column in the DataColumnCollection.
        Parameters:
        value - The name of the column.
      • getAllowDBNull

        public final boolean getAllowDBNull()
        Gets a value that indicates whether null values are allowed in this column for rows that belong to the table.
        Returns:
        true if null values values are allowed; otherwise, false. The default is true.
      • setAllowDBNull

        public final void setAllowDBNull(boolean value)
        Sets a value that indicates whether null values are allowed in this column for rows that belong to the table.
        Parameters:
        value - true if null values values are allowed; otherwise, false. The default is true.
      • getDataType

        public final java.lang.Class getDataType()
        Gets the type of data stored in the column.
        Returns:
        A Class object that represents the column data type.
      • setDataType

        public final void setDataType(java.lang.Class value)
        Sets the type of data stored in the column.
        Parameters:
        value - A Class object that represents the column data type.
      • setDefaultValue

        public final void setDefaultValue(java.lang.Object value)
        Sets the default value for the column when you are creating new rows.
        Parameters:
        value - A value appropriate to the column's getDataType() / setDataType(java.lang.Class).
      • getDefaultValue

        public final java.lang.Object getDefaultValue()
        Gets the default value for the column when you are creating new rows.
        Returns:
        A value appropriate to the column's getDataType() / setDataType(java.lang.Class).
      • getOrdinal

        public final int getOrdinal()
        Gets the position of the column in the DataColumnCollection collection.
        Returns:
        The position of the column. Gets -1 if the column is not a member of a collection.
      • setOrdinal

        public final void setOrdinal(int ordinal)
        Changes the ordinal or position of the DataColumn to the specified ordinal or position.
        Parameters:
        ordinal - The specified ordinal.
      • getColumnMapping

        public final int getColumnMapping()
        Gets the MappingType of the column.
        Returns:
        One of the MappingType values. The returned value is one of MappingType constants.
      • setColumnMapping

        public final void setColumnMapping(int value)
        Sets the MappingType of the column.
        Parameters:
        value - One of the MappingType values. The value must be one of MappingType constants.
      • getNamespace

        public final java.lang.String getNamespace()
        Gets the namespace of the DataColumn.
        Returns:
        The namespace of the DataColumn.
      • setNamespace

        public final void setNamespace(java.lang.String value)
        Sets the namespace of the DataColumn.
        Parameters:
        value - The namespace of the DataColumn.
      • getAutoIncrement

        public final boolean getAutoIncrement()
        Gets a value that indicates whether the column automatically increments the value of the column for new rows added to the table.
        Returns:
        true if the value of the column increments automatically; otherwise, false. The default is false.
      • setAutoIncrement

        public final void setAutoIncrement(boolean value)
        Sets a value that indicates whether the column automatically increments the value of the column for new rows added to the table.
        Parameters:
        value - true if the value of the column increments automatically; otherwise, false. The default is false.
      • setMaxLength

        public final void setMaxLength(int value)
        Sets the maximum length of a text column.
        Parameters:
        value - The maximum length of the column in characters. If the column has no maximum length, the value is -1 (default).
      • getMaxLength

        public final int getMaxLength()
        Gets the maximum length of a text column.
        Returns:
        The maximum length of the column in characters. If the column has no maximum length, the value is -1 (default).
      • getAutoIncrementStep

        public final long getAutoIncrementStep()
        Gets the increment used by a column with its getAutoIncrement() / setAutoIncrement(boolean) property set to true.
        Returns:
        The number by which the value of the column is automatically incremented. The default is 1.
      • setAutoIncrementStep

        public final void setAutoIncrementStep(long value)
        Sets the increment used by a column with its getAutoIncrement() / setAutoIncrement(boolean) property set to true.
        Parameters:
        value - The number by which the value of the column is automatically incremented. The default is 1.
      • setReadOnly

        public final void setReadOnly(boolean value)
        Sets a value that indicates whether the column allows for changes as soon as a row has been added to the table.
        Parameters:
        value - true if the column is read only; otherwise, false. The default is false.
      • isReadOnly

        public final boolean isReadOnly()
      • getReadOnly

        public final boolean getReadOnly()
        Gets a value that indicates whether the column allows for changes as soon as a row has been added to the table.
        Returns:
        true if the column is read only; otherwise, false. The default is false.
      • getUnique

        public final boolean getUnique()
        Gets a value that indicates whether the values in each row of the column must be unique.
        Returns:
        true if the value must be unique; otherwise, false. The default is false.
      • isUnique

        public final boolean isUnique()
      • setUnique

        public final void setUnique()
      • getExpression

        public final java.lang.String getExpression()
        Gets the expression used to filter rows, calculate the values in a column, or create an aggregate column.
        Returns:
        An expression to calculate the value of a column, or create an aggregate column. The return type of an expression is determined by the getDataType() / setDataType(java.lang.Class) of the column.
      • areColumnSetsTheSame

        public static boolean areColumnSetsTheSame(DataColumn[] columnSet,
                                                   DataColumn[] compareSet)