DataColumnCollection

Inheritance: java.lang.Object

All Implemented Interfaces: java.lang.Iterable

public class DataColumnCollection implements Iterable<DataColumn>

Represents a collection of DataColumn objects for a DataTable. See also: https://referencesource.microsoft.com/#system.data/System/Data/DataColumnCollection.cs.

Methods

Method Description
add(DataColumn column) Adds the specified DataColumn to the columns collection.
add(String columnName) Creates and adds a DataColumn with the specified name to the columns collection.
add(String columnName, Class type) Creates and adds a DataColumn with the specified name and type to the columns collection.
add(String columnName, 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.
indexOf(String columnName) Returns the index of a column specified by name.
indexOf(DataColumn column) Gets the index of a column specified by DataColumn.
get(int index) Gets the DataColumn from the collection at the specified index.
get(String columnName) Gets the DataColumn from the collection with the specified name.
contains(String name) Checks whether the collection contains a column with the specified name.
remove(String name) Removes the DataColumn object that has the specified name from the collection.
remove(DataColumn column) Removes the DataColumn object that has the specified name from the collection.
getCount()
iterator()
clear() Clears the collection of any columns.

add(DataColumn column)

public void add(DataColumn column)

Adds the specified DataColumn to the columns collection.

Parameters:

Parameter Type Description
column DataColumn new column to add

add(String columnName)

public void add(String columnName)

Creates and adds a DataColumn with the specified name to the columns collection.

Parameters:

Parameter Type Description
columnName java.lang.String new column

add(String columnName, Class type)

public DataColumn add(String columnName, Class type)

Creates and adds a DataColumn with the specified name and type to the columns collection.

Parameters:

Parameter Type Description
columnName java.lang.String name
type java.lang.Class data type

Returns: DataColumn - created a DataColumn instance.

add(String columnName, Class type, int columnMapping, boolean allowAutoIncrement, boolean allowDBNull)

public DataColumn add(String columnName, 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.

Parameters:

Parameter Type Description
columnName java.lang.String name
type java.lang.Class data type
columnMapping int column mapping type
allowAutoIncrement boolean is auto increment allowed
allowDBNull boolean is DBNull value allowed

Returns: DataColumn - created a DataColumn instance.

indexOf(String columnName)

public int indexOf(String columnName)

Returns the index of a column specified by name.

Parameters:

Parameter Type Description
columnName java.lang.String the name of column

Returns: int - the index of a column specified by name

indexOf(DataColumn column)

public int indexOf(DataColumn column)

Gets the index of a column specified by DataColumn.

Parameters:

Parameter Type Description
column DataColumn DataColumn to find position for

Returns: int - the index of a specified DataColumn.

get(int index)

public DataColumn get(int index)

Gets the DataColumn from the collection at the specified index.

Parameters:

Parameter Type Description
index int index of this column at this collection

Returns: DataColumn - column with the specified name

get(String columnName)

public DataColumn get(String columnName)

Gets the DataColumn from the collection with the specified name.

Parameters:

Parameter Type Description
columnName java.lang.String name of the column

Returns: DataColumn - column with the specified name

contains(String name)

public boolean contains(String name)

Checks whether the collection contains a column with the specified name.

Parameters:

Parameter Type Description
name java.lang.String column name

Returns: boolean - true if column with the specified name exists

remove(String name)

public void remove(String name)

Removes the DataColumn object that has the specified name from the collection.

Parameters:

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

remove(DataColumn column)

public void remove(DataColumn column)

Removes the DataColumn object that has the specified name from the collection.

Parameters:

Parameter Type Description
column DataColumn name of the column

getCount()

public int getCount()

Returns: int - the total number of elements in a collection.

iterator()

public Iterator<DataColumn> iterator()

Returns: java.util.Iterator<com.groupdocs.assembly.system.data.DataColumn>

clear()

public void clear()

Clears the collection of any columns.