ConstraintCollection

Inheritance: java.lang.Object

All Implemented Interfaces: java.lang.Iterable

public class ConstraintCollection implements Iterable<Constraint>

Represents a collection of constraints for a DataTable.

Methods

Method Description
get(String constraintName) Gets the Constraint from the collection with the specified name.
get(int idx)
add(Constraint constraint) Adds the specified Constraint object to the collection.
remove(Constraint constraint) Removes the specified Constraint from the collection.
contains(Constraint cc) Indicates whether the Constraint object specified by name exists in the collection.
getCount() Gets the total number of elements in a collection.
iterator()

get(String constraintName)

public Constraint get(String constraintName)

Gets the Constraint from the collection with the specified name.

Parameters:

Parameter Type Description
constraintName java.lang.String name of the constraint in this collection

Returns: Constraint - constraint by its name or null if not found.

get(int idx)

public Constraint get(int idx)

Parameters:

Parameter Type Description
idx int

Returns: Constraint

add(Constraint constraint)

public void add(Constraint constraint)

Adds the specified Constraint object to the collection.

Parameters:

Parameter Type Description
constraint Constraint The Constraint to add.

remove(Constraint constraint)

public void remove(Constraint constraint)

Removes the specified Constraint from the collection.

Parameters:

Parameter Type Description
constraint Constraint The Constraint to remove.

contains(Constraint cc)

public boolean contains(Constraint cc)

Indicates whether the Constraint object specified by name exists in the collection.

Parameters:

Parameter Type Description
cc Constraint The Constraint to remove.

Returns: boolean - true if the collection contains the specified constraint; otherwise, false.

getCount()

public int getCount()

Gets the total number of elements in a collection.

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

iterator()

public Iterator<Constraint> iterator()

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