public final class DataRelationCollection
extends java.lang.Object
implements java.lang.Iterable
DataRelation
objects for this DataSet
.Modifier and Type | Method and Description |
---|---|
void |
add(DataColumn parentColumn,
DataColumn childColumn)
Creates a
DataRelation with a specified parent and child column, and adds it to the collection. |
void |
add(DataRelation relation)
Adds a
DataRelation to the DataRelationCollection . |
void |
add(DataTable parentTable,
DataTable childTable,
java.lang.String[] parentColumnNames,
java.lang.String[] childColumnNames)
Adds a relation to the collection.
|
void |
add(DataTable parentTable,
DataTable childTable,
java.lang.String parentColumnName,
java.lang.String childColumnName)
Adds a relation to the collection.
|
void |
add(java.lang.String name,
DataColumn parentColumn,
DataColumn childColumn)
Creates a
DataRelation with the specified name, and parent and child columns, and adds it to the collection. |
void |
add(java.lang.String name,
DataColumn parentColumn,
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. |
void |
clear()
Clears the collection of any relations.
|
boolean |
contains(DataRelation relation)
Verifies whether a DataRelation with the specific name (case insensitive) exists in the collection.
|
DataRelation |
get(int index)
Gets the
DataRelation object at the specified index. |
DataRelation |
get(java.lang.String name)
Gets the
DataRelation object specified by name. |
int |
getCount() |
int |
indexOf(DataRelation relation)
Gets the index of the specified
DataRelation object. |
java.util.Iterator |
iterator() |
void |
removeAt(int index)
Removes the relation at the specified index from the collection.
|
public final void add(DataRelation relation)
DataRelation
to the DataRelationCollection
.relation
- The DataRelation to add to the collection.public final void add(DataTable parentTable, DataTable childTable, java.lang.String parentColumnName, java.lang.String childColumnName)
parentTable
- The parent table of the relation.childTable
- The child table of the relation.parentColumnName
- The parent column's name of the relation.childColumnName
- The child column's name of the relation.public final void add(DataTable parentTable, DataTable childTable, java.lang.String[] parentColumnNames, java.lang.String[] childColumnNames)
parentTable
- The parent table of the relation.childTable
- The child table of the relation.parentColumnNames
- The array of parent column's name of the relation.childColumnNames
- The array of child column's name of the relation.public final void add(java.lang.String name, DataColumn parentColumn, DataColumn childColumn, boolean createConstraints)
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.name
- The name of the relation.parentColumn
- The parent column of the relation.childColumn
- The child column of the relation.createConstraints
- true to create constraints; otherwise false. (The default is true).public final void add(DataColumn parentColumn, DataColumn childColumn)
DataRelation
with a specified parent and child column, and adds it to the collection.parentColumn
- The parent column of the relation.childColumn
- The child column of the relation.public final void add(java.lang.String name, DataColumn parentColumn, DataColumn childColumn)
DataRelation
with the specified name, and parent and child columns, and adds it to the collection.name
- The name of the relation.parentColumn
- The parent column of the relation.childColumn
- The child column of the relation.public final java.util.Iterator iterator()
iterator
in interface java.lang.Iterable
public final int getCount()
public final boolean contains(DataRelation relation)
relation
- The name of the relation to find.public final int indexOf(DataRelation relation)
DataRelation
object.relation
- The relation to search for.public final DataRelation get(java.lang.String name)
DataRelation
object specified by name.name
- The name of the relation to find.DataRelation
, or a null value if the specified DataRelation
does not exist.public final DataRelation get(int index)
DataRelation
object at the specified index.index
- The zero-based index to find.DataRelation
, or a null value if the specified DataRelation
does not exist.public final void removeAt(int index)
index
- The index of the relation to remove.public final void clear()