DataColumn
Leave feedback
On this page
Inheritance: java.lang.Object
public class DataColumn
Represents one column of data in a DataTable.
| Constructor | Description |
|---|---|
| DataColumn() | Initializes a new instance of a DataColumn |
| DataColumn(String name) | Initializes a new instance of the DataColumn class, as type string, using the specified column name. |
| DataColumn(String name, DataTable table) | Initializes a new instance of the @{link DataColumn} class using the specified column name and table it belongs to. |
| DataColumn(String name, Class type) | Initializes a new instance of the DataColumn class using the specified column name and data type. |
| DataColumn(String name, 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. |
public DataColumn()
Initializes a new instance of a DataColumn
public DataColumn(String name)
Initializes a new instance of the DataColumn class, as type string, using the specified column name.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| name | java.lang.String | name of the DataColumn |
public DataColumn(String name, DataTable table)
Initializes a new instance of the @{link DataColumn} class using the specified column name and table it belongs to.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| name | java.lang.String | name of the DataColumn |
| table | DataTable | the table this column belongs to |
public DataColumn(String name, Class type)
Initializes a new instance of the DataColumn class using the specified column name and data type.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| name | java.lang.String | name of the DataColumn |
| type | java.lang.Class | data type |
public DataColumn(String name, 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:
| Parameter | Type | Description |
|---|---|---|
| name | java.lang.String | name of the DataColumn |
| type | java.lang.Class | data type |
| table | DataTable | the table this column belongs to |
public String getColumnName()
Returns: java.lang.String - the name of the column within the DataColumnCollection.
public void setColumnName(String name)
Parameters:
| Parameter | Type | Description |
|---|---|---|
| name | java.lang.String | of the column within the DataColumnCollection. |
public boolean getAllowDBNull()
Returns: boolean - a value indicating whether null values are allowed in this column for rows belonging to the table. true if null values are allowed; otherwise, false. The default is true.
public void setAllowDBNull(boolean allows)
Parameters:
| Parameter | Type | Description |
|---|---|---|
| allows | boolean | is the flag that indicates whether null values are allowed in this column for rows that belong to the table. |
public Class getDataType()
Returns: java.lang.Class - The type of data stored in the column. String by default.
public void setDataType(Class aClass)
Parameters:
| Parameter | Type | Description |
|---|---|---|
| aClass | java.lang.Class | The type of data stored in the column. |
public void setDefaultValue(Object defaultValue)
Gets or sets the default value for the column when creating new rows.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| defaultValue | java.lang.Object | - default value for the newly created row. |
public Object getDefaultValue()
Returns: java.lang.Object
public int getOrdinal()
Returns: int - the (zero-based) position of the column in the DataColumnCollection collection.
public void setOrdinal(int ordinal)
Parameters:
| Parameter | Type | Description |
|---|---|---|
| ordinal | int |
public int getColumnMapping()
Returns: int - the MappingType of the column.
public void setColumnMapping(int columnMapping)
Sets the MappingType of the column.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| columnMapping | int | type |
public String getNamespace()
Returns: java.lang.String - namespace.
public void setNamespace(String namespace)
Sets namespace.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| namespace | java.lang.String | of the DataColumn |
public String getPrefix()
Returns: java.lang.String - prefix.
public void setPrefix(String prefix)
Sets namespace.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| prefix | java.lang.String | of the DataColumn |
public DataTable getTable()
Returns: DataTable - DataTable to which the column belongs to.
public boolean getAutoIncrement()
Returns: boolean - a value indicating whether the column automatically increments the value of the column for new rows added to the table.
public void setAutoIncrement(boolean autoIncrement)
Sets a value indicating whether the column automatically increments the value of the column for new rows added to the table.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| autoIncrement | boolean | flag. |
public void setMaxLength(int length)
Parameters:
| Parameter | Type | Description |
|---|---|---|
| length | int |
public int getMaxLength()
Returns: int
public String getCaption()
Returns: java.lang.String
public void setCaption(String caption)
Parameters:
| Parameter | Type | Description |
|---|---|---|
| caption | java.lang.String |
public long getAutoIncrementSeed()
Returns: long
public void setAutoIncrementSeed(long autoIncrementSeed)
Parameters:
| Parameter | Type | Description |
|---|---|---|
| autoIncrementSeed | long |
public long getAutoIncrementStep()
Returns: long
public void setAutoIncrementStep(long autoIncrementStep)
Parameters:
| Parameter | Type | Description |
|---|---|---|
| autoIncrementStep | long |
public void setReadOnly(boolean readOnly)
Parameters:
| Parameter | Type | Description |
|---|---|---|
| readOnly | boolean |
public boolean isReadOnly()
Returns: boolean
public boolean getReadOnly()
Returns: boolean
public boolean getUnique()
Returns: boolean
public boolean isUnique()
Returns: boolean
public void setUnique(boolean value)
Parameters:
| Parameter | Type | Description |
|---|---|---|
| value | boolean |
public String getExpression()
Returns: java.lang.String
public static boolean areColumnSetsTheSame(DataColumn[] columnSet, DataColumn[] compareSet)
Parameters:
| Parameter | Type | Description |
|---|---|---|
| columnSet | DataColumn[] | |
| compareSet | DataColumn[] |
Returns: boolean
public String toString()
Returns: java.lang.String
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.