DataColumn

Inheritance: java.lang.Object

public class DataColumn

Represents one column of data in a DataTable.

Constructors

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.

Methods

DataColumn()

public DataColumn()

Initializes a new instance of a DataColumn

DataColumn(String name)

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

DataColumn(String name, DataTable table)

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

DataColumn(String name, Class type)

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

DataColumn(String name, Class type, DataTable table)

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

getColumnName()

public String getColumnName()

Returns: java.lang.String - the name of the column within the DataColumnCollection.

setColumnName(String name)

public void setColumnName(String name)

Parameters:

Parameter Type Description
name java.lang.String of the column within the DataColumnCollection.

getAllowDBNull()

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.

setAllowDBNull(boolean allows)

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.

getDataType()

public Class getDataType()

Returns: java.lang.Class - The type of data stored in the column. String by default.

setDataType(Class aClass)

public void setDataType(Class aClass)

Parameters:

Parameter Type Description
aClass java.lang.Class The type of data stored in the column.

setDefaultValue(Object defaultValue)

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.

getDefaultValue()

public Object getDefaultValue()

Returns: java.lang.Object

getOrdinal()

public int getOrdinal()

Returns: int - the (zero-based) position of the column in the DataColumnCollection collection.

setOrdinal(int ordinal)

public void setOrdinal(int ordinal)

Parameters:

Parameter Type Description
ordinal int

getColumnMapping()

public int getColumnMapping()

Returns: int - the MappingType of the column.

setColumnMapping(int columnMapping)

public void setColumnMapping(int columnMapping)

Sets the MappingType of the column.

Parameters:

Parameter Type Description
columnMapping int type

getNamespace()

public String getNamespace()

Returns: java.lang.String - namespace.

setNamespace(String namespace)

public void setNamespace(String namespace)

Sets namespace.

Parameters:

Parameter Type Description
namespace java.lang.String of the DataColumn

getPrefix()

public String getPrefix()

Returns: java.lang.String - prefix.

setPrefix(String prefix)

public void setPrefix(String prefix)

Sets namespace.

Parameters:

Parameter Type Description
prefix java.lang.String of the DataColumn

getTable()

public DataTable getTable()

Returns: DataTable - DataTable to which the column belongs to.

getAutoIncrement()

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.

setAutoIncrement(boolean autoIncrement)

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.

setMaxLength(int length)

public void setMaxLength(int length)

Parameters:

Parameter Type Description
length int

getMaxLength()

public int getMaxLength()

Returns: int

getCaption()

public String getCaption()

Returns: java.lang.String

setCaption(String caption)

public void setCaption(String caption)

Parameters:

Parameter Type Description
caption java.lang.String

getAutoIncrementSeed()

public long getAutoIncrementSeed()

Returns: long

setAutoIncrementSeed(long autoIncrementSeed)

public void setAutoIncrementSeed(long autoIncrementSeed)

Parameters:

Parameter Type Description
autoIncrementSeed long

getAutoIncrementStep()

public long getAutoIncrementStep()

Returns: long

setAutoIncrementStep(long autoIncrementStep)

public void setAutoIncrementStep(long autoIncrementStep)

Parameters:

Parameter Type Description
autoIncrementStep long

setReadOnly(boolean readOnly)

public void setReadOnly(boolean readOnly)

Parameters:

Parameter Type Description
readOnly boolean

isReadOnly()

public boolean isReadOnly()

Returns: boolean

getReadOnly()

public boolean getReadOnly()

Returns: boolean

getUnique()

public boolean getUnique()

Returns: boolean

isUnique()

public boolean isUnique()

Returns: boolean

setUnique(boolean value)

public void setUnique(boolean value)

Parameters:

Parameter Type Description
value boolean

getExpression()

public String getExpression()

Returns: java.lang.String

areColumnSetsTheSame(DataColumn[] columnSet, DataColumn[] compareSet)

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

Parameters:

Parameter Type Description
columnSet DataColumn[]
compareSet DataColumn[]

Returns: boolean

toString()

public String toString()

Returns: java.lang.String