public final class DataColumn
extends java.lang.Object
DataTable.| Constructor and Description |
|---|
DataColumn()
Initializes a new instance of a
DataColumn class as type string. |
DataColumn(java.lang.String columnName)
Inititalizes a new instance of the
DataColumn class, as type string, using the specified column name. |
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. |
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. |
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.
|
| Modifier and Type | Method and Description |
|---|---|
static boolean |
areColumnSetsTheSame(DataColumn[] columnSet,
DataColumn[] compareSet) |
boolean |
getAllowDBNull()
Gets a value that indicates whether null values are allowed in this column for rows that belong to the table.
|
boolean |
getAutoIncrement()
Gets a value that indicates whether the column automatically increments the value of the column for new rows added to the table.
|
long |
getAutoIncrementSeed()
Gets the starting value for a column that has its
getAutoIncrement() / setAutoIncrement(boolean) property set to true. |
long |
getAutoIncrementStep()
Gets the increment used by a column with its
getAutoIncrement() / setAutoIncrement(boolean) property set to true. |
java.lang.String |
getCaption()
Gets the caption for the column.
|
int |
getColumnMapping()
Gets the
MappingType of the column. |
java.lang.String |
getColumnName()
Gets the name of the column in the
DataColumnCollection. |
java.lang.Class |
getDataType()
Gets the type of data stored in the column.
|
java.lang.Object |
getDefaultValue()
Gets the default value for the column when you are creating new rows.
|
java.lang.String |
getExpression()
Gets the expression used to filter rows, calculate the values in a column, or create an aggregate column.
|
int |
getMaxLength()
Gets the maximum length of a text column.
|
java.lang.String |
getNamespace()
Gets the namespace of the
DataColumn. |
int |
getOrdinal()
Gets the position of the column in the
DataColumnCollection collection. |
java.lang.String |
getPrefix()
Gets an XML prefix that aliases the namespace of the
DataTable. |
boolean |
getReadOnly()
Gets a value that indicates whether the column allows for changes as soon as a row has been added to the table.
|
DataTable |
getTable()
Gets the
DataTable to which the column belongs to. |
boolean |
getUnique()
Gets a value that indicates whether the values in each row of the column must be unique.
|
boolean |
isReadOnly() |
boolean |
isUnique() |
void |
setAllowDBNull(boolean value)
Sets a value that indicates whether null values are allowed in this column for rows that belong to the table.
|
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.
|
void |
setAutoIncrementSeed(long value)
Sets the starting value for a column that has its
getAutoIncrement() / setAutoIncrement(boolean) property set to true. |
void |
setAutoIncrementStep(long value)
Sets the increment used by a column with its
getAutoIncrement() / setAutoIncrement(boolean) property set to true. |
void |
setCaption(java.lang.String value)
Sets the caption for the column.
|
void |
setColumnMapping(int value)
Sets the
MappingType of the column. |
void |
setColumnName(java.lang.String value)
Sets the name of the column in the
DataColumnCollection. |
void |
setDataType(java.lang.Class value)
Sets the type of data stored in the column.
|
void |
setDefaultValue(java.lang.Object value)
Sets the default value for the column when you are creating new rows.
|
void |
setMaxLength(int value)
Sets the maximum length of a text column.
|
void |
setNamespace(java.lang.String value)
Sets the namespace of the
DataColumn. |
void |
setOrdinal(int ordinal)
Changes the ordinal or position of the
DataColumn to the specified ordinal or position. |
void |
setPrefix(java.lang.String value)
Sets an XML prefix that aliases the namespace of the
DataTable. |
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.
|
void |
setUnique(boolean value)
Sets a value that indicates whether the values in each row of the column must be unique.
|
java.lang.String |
toString()
Gets the
getExpression() of the column, if one exists. |
public DataColumn()
DataColumn class as type string.public DataColumn(java.lang.String columnName)
DataColumn class, as type string, using the specified column name.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.public DataColumn(java.lang.String name,
DataTable table)
name - name of the DataColumntable - the table this column belongs topublic DataColumn(java.lang.String columnName,
java.lang.Class dataType)
DataColumn class using the specified column name and data type.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).public DataColumn(java.lang.String name,
java.lang.Class type,
DataTable table)
DataColumn class using the specified column name, data type and data table it belongs to.name - name of the DataColumntype - data typetable - the table this column belongs topublic final java.lang.String getColumnName()
DataColumnCollection.public final void setColumnName(java.lang.String value)
DataColumnCollection.value - The name of the column.public final boolean getAllowDBNull()
public final void setAllowDBNull(boolean value)
value - true if null values values are allowed; otherwise, false. The default is true.public final java.lang.Class getDataType()
Class object that represents the column data type.public final void setDataType(java.lang.Class value)
value - A Class object that represents the column data type.public final void setDefaultValue(java.lang.Object value)
value - A value appropriate to the column's getDataType() / setDataType(java.lang.Class).public final java.lang.Object getDefaultValue()
getDataType() / setDataType(java.lang.Class).public final int getOrdinal()
DataColumnCollection collection.public final void setOrdinal(int ordinal)
DataColumn to the specified ordinal or position.ordinal - The specified ordinal.public final int getColumnMapping()
MappingType of the column.MappingType values. The returned value is one of MappingType constants.public final void setColumnMapping(int value)
MappingType of the column.value - One of the MappingType values. The value must be one of MappingType constants.public final java.lang.String getNamespace()
DataColumn.DataColumn.public final void setNamespace(java.lang.String value)
DataColumn.value - The namespace of the DataColumn.public final java.lang.String getPrefix()
DataTable.DataTable namespace.public final void setPrefix(java.lang.String value)
DataTable.value - The XML prefix for the DataTable namespace.public final DataTable getTable()
DataTable to which the column belongs to.DataTable that the DataColumn belongs to.public final boolean getAutoIncrement()
public final void setAutoIncrement(boolean value)
value - true if the value of the column increments automatically; otherwise, false. The default is false.public final void setMaxLength(int value)
value - The maximum length of the column in characters. If the column has no maximum length, the value is -1 (default).public final int getMaxLength()
public final java.lang.String getCaption()
getColumnName() / setColumnName(java.lang.String) value.public final void setCaption(java.lang.String value)
value - The caption of the column. If not set, returns the getColumnName() / setColumnName(java.lang.String) value.public final long getAutoIncrementSeed()
getAutoIncrement() / setAutoIncrement(boolean) property set to true.getAutoIncrement() / setAutoIncrement(boolean) feature.public final void setAutoIncrementSeed(long value)
getAutoIncrement() / setAutoIncrement(boolean) property set to true.value - The starting value for the getAutoIncrement() / setAutoIncrement(boolean) feature.public final long getAutoIncrementStep()
getAutoIncrement() / setAutoIncrement(boolean) property set to true.public final void setAutoIncrementStep(long value)
getAutoIncrement() / setAutoIncrement(boolean) property set to true.value - The number by which the value of the column is automatically incremented. The default is 1.public final void setReadOnly(boolean value)
value - true if the column is read only; otherwise, false. The default is false.public final boolean isReadOnly()
public final boolean getReadOnly()
public final boolean getUnique()
public final boolean isUnique()
public final void setUnique(boolean value)
value - true if the value must be unique; otherwise, false. The default is false.public final java.lang.String getExpression()
getDataType() / setDataType(java.lang.Class) of the column.public static boolean areColumnSetsTheSame(DataColumn[] columnSet, DataColumn[] compareSet)
public final java.lang.String toString()
getExpression() of the column, if one exists.toString in class java.lang.ObjectgetExpression() value, if the property is set; otherwise, the getColumnName() / setColumnName(java.lang.String) property.
See Also:
GroupDocs.Assembly for Java Documentation - the home page for the GroupDocs.Assembly for Java Product Documentation.
GroupDocs.Assembly for Java Support Forum - our preferred method of support.
© 2001-2023 Aspose Pty Ltd. All rights reserved.