DataRelationCollection
Inheritance: java.lang.Object
All Implemented Interfaces: java.lang.Iterable
public class DataRelationCollection implements Iterable
Represents the collection of DataRelation objects for this DataSet.
Methods
add(System.Data.DataColumn parentColumn, System.Data.DataColumn childColumn)
public void add(System.Data.DataColumn parentColumn, System.Data.DataColumn childColumn)
Creates a DataRelation with a specified parent and child column, and adds it to the collection.
Parameters:
Parameter | Type | Description |
---|---|---|
parentColumn | DataColumn | The parent column of the relation. |
childColumn | DataColumn | The child column of the relation. |
add(System.Data.DataRelation relation)
public void add(System.Data.DataRelation relation)
Adds a DataRelation to the DataRelationCollection.
Parameters:
Parameter | Type | Description |
---|---|---|
relation | DataRelation | The DataRelation to add to the collection. |
add(System.Data.DataTable parentTable, System.Data.DataTable childTable, String parentColumnName, String childColumnName)
public void add(System.Data.DataTable parentTable, System.Data.DataTable childTable, String parentColumnName, String childColumnName)
Adds a relation to the collection. Performs no checks on the duplication etc.
Parameters:
Parameter | Type | Description |
---|---|---|
parentTable | DataTable | The parent table of the relation. |
childTable | DataTable | The child table of the relation. |
parentColumnName | java.lang.String | The parent column’s name of the relation. |
childColumnName | java.lang.String | The child column’s name of the relation. |
add(System.Data.DataTable parentTable, System.Data.DataTable childTable, String[] parentColumnNames, String[] childColumnNames)
public void add(System.Data.DataTable parentTable, System.Data.DataTable childTable, String[] parentColumnNames, String[] childColumnNames)
Adds a relation to the collection. Performs no checks on the duplication etc.
Parameters:
Parameter | Type | Description |
---|---|---|
parentTable | DataTable | The parent table of the relation. |
childTable | DataTable | The child table of the relation. |
parentColumnNames | java.lang.String[] | The array of parent column’s name of the relation. |
childColumnNames | java.lang.String[] | The array of child column’s name of the relation. |
add(String name, System.Data.DataColumn parentColumn, System.Data.DataColumn childColumn)
public void add(String name, System.Data.DataColumn parentColumn, System.Data.DataColumn childColumn)
Creates a DataRelation with the specified name, and parent and child columns, and adds it to the collection.
Parameters:
Parameter | Type | Description |
---|---|---|
name | java.lang.String | The name of the relation. |
parentColumn | DataColumn | The parent column of the relation. |
childColumn | DataColumn | The child column of the relation. |
add(String name, System.Data.DataColumn parentColumn, System.Data.DataColumn childColumn, boolean createConstraints)
public void add(String name, System.Data.DataColumn parentColumn, System.Data.DataColumn childColumn, boolean createConstraints)
Creates a DataRelation with the specified name, parent and child columns, with optional constraints according to the value of the createConstraints parameter, and adds it to the collection.
Parameters:
Parameter | Type | Description |
---|---|---|
name | java.lang.String | The name of the relation. |
parentColumn | DataColumn | The parent column of the relation. |
childColumn | DataColumn | The child column of the relation. |
createConstraints | boolean | true to create constraints; otherwise false. (The default is true). |
clear()
public void clear()
Clears the collection of any relations.
contains(System.Data.DataRelation relation)
public boolean contains(System.Data.DataRelation relation)
Verifies whether a DataRelation with the specific name (case insensitive) exists in the collection.
Parameters:
Parameter | Type | Description |
---|---|---|
relation | DataRelation | The name of the relation to find. |
Returns: boolean - true, if a relation with the specified name exists; otherwise false.
get(int index)
public System.Data.DataRelation get(int index)
Gets the DataRelation object at the specified index.
Parameters:
Parameter | Type | Description |
---|---|---|
index | int | The zero-based index to find. |
Returns: DataRelation - The DataRelation, or a null value if the specified DataRelation does not exist.
get(String name)
public System.Data.DataRelation get(String name)
Gets the DataRelation object specified by name.
Parameters:
Parameter | Type | Description |
---|---|---|
name | java.lang.String | The name of the relation to find. |
Returns: DataRelation - The named DataRelation, or a null value if the specified DataRelation does not exist.
getCount()
public int getCount()
Returns: int - the total number of elements in a collection
indexOf(System.Data.DataRelation relation)
public int indexOf(System.Data.DataRelation relation)
Gets the index of the specified DataRelation object.
Parameters:
Parameter | Type | Description |
---|---|---|
relation | DataRelation | The relation to search for. |
Returns: int - The 0-based index of the relation, or -1 if the relation is not found in the collection.
iterator()
public Iterator iterator()
Returns: java.util.Iterator
removeAt(int index)
public void removeAt(int index)
Removes the relation at the specified index from the collection.
Parameters:
Parameter | Type | Description |
---|---|---|
index | int | The index of the relation to remove. |