public final 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 . |
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 final void add(DataColumn column)
DataColumn
object to the DataColumnCollection
.column
- The DataColumn
to add.public final void add(java.lang.String columnName)
DataColumn
object that has the specified name to the DataColumnCollection
.columnName
- The name of the column.public final 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 final int indexOf(java.lang.String columnName)
columnName
- The name of the column to find.public final int indexOf(DataColumn column)
column
- The name of the column to return.column
if it is found; otherwise, -1.public final 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 final 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 final boolean contains(java.lang.String name)
name
- The DataColumn.getColumnName()
/ DataColumn.setColumnName(java.lang.String)
of the column to look for.public final 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 final void remove(DataColumn column)
DataColumn
object from the collection.column
- The DataColumn
to remove.public final int getCount()
public final java.util.Iterator iterator()
iterator
in interface java.lang.Iterable
public final void clear()