public class DataColumnCollection
extends java.lang.Object
implements java.lang.Iterable
DataColumn objects for a DataTable.| Modifier and Type | Method and Description |
|---|---|
void |
add(DataColumn column)
Creates and adds the specified
DataColumn object to the DataColumnCollection. |
void |
add(java.lang.String columnName)
Creates and adds a
DataColumn object that has the specified name to the DataColumnCollection. |
DataColumn |
add(java.lang.String columnName,
java.lang.Class type)
Creates and adds a
DataColumn object that has the specified name and type to the DataColumnCollection. |
DataColumn |
add(java.lang.String columnName,
java.lang.Class type,
int columnMapping,
boolean allowAutoIncrement,
boolean allowDBNull)
Creates and adds a
DataColumn with the specified name, type and specific values to the columns collection. |
void |
clear()
Clears the collection of any columns.
|
boolean |
contains(java.lang.String name)
Checks whether the collection contains a column with the specified name.
|
DataColumn |
get(int index)
Gets the
DataColumn from the collection at the specified index. |
DataColumn |
get(java.lang.String name)
Gets the
DataColumn from the collection with the specified name. |
int |
getCount() |
int |
indexOf(DataColumn column)
Gets the index of a column specified by name.
|
int |
indexOf(java.lang.String columnName)
Gets the index of the column with the specific name (the name is not case sensitive).
|
java.util.Iterator |
iterator() |
void |
remove(DataColumn column)
Removes the specified
DataColumn object from the collection. |
void |
remove(java.lang.String name)
Removes the
DataColumn object that has the specified name from the collection. |
public void add(DataColumn column)
DataColumn object to the DataColumnCollection.column - The DataColumn to add.public void add(java.lang.String columnName)
DataColumn object that has the specified name to the DataColumnCollection.columnName - The name of the column.public DataColumn add(java.lang.String columnName, java.lang.Class type)
DataColumn object that has the specified name and type to the DataColumnCollection.columnName - The DataColumn.getColumnName() / DataColumn.setColumnName(java.lang.String) to use when you create the column.type - The DataColumn.getDataType() / DataColumn.setDataType(java.lang.Class) of the new column.DataColumn.public DataColumn add(java.lang.String columnName, java.lang.Class type, int columnMapping, boolean allowAutoIncrement, boolean allowDBNull)
DataColumn with the specified name, type and specific values to the columns collection.columnName - nametype - data typecolumnMapping - column mapping typeallowAutoIncrement - is auto increment allowedallowDBNull - is DBNull value allowedDataColumn instance.public int indexOf(java.lang.String columnName)
columnName - The name of the column to find.public int indexOf(DataColumn column)
column - The name of the column to return.column if it is found; otherwise, -1.public DataColumn get(int index)
DataColumn from the collection at the specified index.index - The zero-based index of the column to return.DataColumn at the specified index.public DataColumn get(java.lang.String name)
DataColumn from the collection with the specified name.name - The DataColumn.getColumnName() / DataColumn.setColumnName(java.lang.String) of the column to return.DataColumn in the collection with the specified DataColumn.getColumnName() / DataColumn.setColumnName(java.lang.String); otherwise a null value if the DataColumn does not exist.public boolean contains(java.lang.String name)
name - The DataColumn.getColumnName() / DataColumn.setColumnName(java.lang.String) of the column to look for.public void remove(java.lang.String name)
DataColumn object that has the specified name from the collection.name - The name of the column to remove.public void remove(DataColumn column)
DataColumn object from the collection.column - The DataColumn to remove.public int getCount()
public java.util.Iterator iterator()
iterator in interface java.lang.Iterablepublic void clear()