ilog.concert
Interface IloOr

All Superinterfaces:
IloAddable, IloConstraint, IloIntExpr, IloNumExpr

public interface IloOr
extends IloConstraint

This interface defines the API for classes that represent or-constraints.

An instance of IloOr (that is, an or-constraint) indicates that at least one of a set of constraints must be satisfied. Objects of type IloConstraint can be added to and removed from an instance of IloOr. The constraints in an or-constraint can be queried by the iterator returned by method iterator().


Method Summary
 IloConstraint add(IloConstraint object)
          This method adds the constraint to the invoking or-constraint.
 IloConstraint[] add(IloConstraint[] objects)
          This method adds the array of constraints to the invoking or-constraint.
 IloConstraint[] add(IloConstraint[] objects, int start, int num)
          This method adds constraints to the invoking instance of IloOr.
 java.util.Iterator iterator()
          This method returns an iterator that traverses the constraints in the or-constraint.
 IloConstraint remove(IloConstraint object)
          This method removes a constraint from the invoking or-constraint.
 IloConstraint[] remove(IloConstraint[] objects)
          This method removes an array of constraints from the invoking or-constraint.
 IloConstraint[] remove(IloConstraint[] objects, int start, int num)
          This method removes constraints from the invoking instance of IloOr.
 
Methods inherited from interface ilog.concert.IloAddable
getName, setName
 

Method Detail

add

public IloConstraint add(IloConstraint object)
                  throws IloException
This method adds the constraint to the invoking or-constraint.

Parameters:
object - The constraint to be added to the invoking instance of IloOr.
Returns:
The constraint that has been added.
Throws:
IloException

add

public IloConstraint[] add(IloConstraint[] objects)
                    throws IloException
This method adds the array of constraints to the invoking or-constraint.

Parameters:
objects - The array of constraints to be added to the invoking instance of IloOr.
Returns:
The array of constraints that have been added.
Throws:
IloException

add

public IloConstraint[] add(IloConstraint[] objects,
                           int start,
                           int num)
                    throws IloException
This method adds constraints to the invoking instance of IloOr.

All objects implementing the IloConstraint interface objects[start]...objects[start+num-1] are added to the invoking IloOr object.

Parameters:
objects - The array of constraints to be added to the invoking instance of IloOr.
start - The first constraint to be added to the invoking instance of IloOr.
num - The number of constraints to be added to the invoking instance of IloOr.
Returns:
The array of constraints that have been added.
Throws:
IloException

remove

public IloConstraint remove(IloConstraint object)
                     throws IloException
This method removes a constraint from the invoking or-constraint.

If the constraint has been added multiple times, only one instance is removed from the or-constraint.

Parameters:
object - The constraint to be removed from the invoking instance of IloOr.
Throws:
IloException

remove

public IloConstraint[] remove(IloConstraint[] objects)
                       throws IloException
This method removes an array of constraints from the invoking or-constraint.

Parameters:
objects - The array of constraints to be removed from the invoking IloOr.
Throws:
IloException

remove

public IloConstraint[] remove(IloConstraint[] objects,
                              int start,
                              int num)
                       throws IloException
This method removes constraints from the invoking instance of IloOr.

The constraints or, more precisely, the objects implementing the IloConstraint interface objects[start]...objects[start+num-1] are removed from the invoking instance of IloOr. If a constraint has been added multiple times, only one instance is removed from the or-constraint.

Parameters:
objects - The array of constraints to be removed from the invoking instance of IloOr.
start - The first constraints to be removed from the invoking instance of IloOr.
num - The number of constraints to be removed from the invoking instance of IloOr.
Throws:
IloException

iterator

public java.util.Iterator iterator()
This method returns an iterator that traverses the constraints in the or-constraint.

Any manipulation of the or-constraint will render an iterator accessed with this method invalid. An iterator can only be used until the method add, remove, or delete is called on the invoking instance of IloOr.