ilog.concert
Interface IloLinearNumExprIterator

All Superinterfaces:
java.util.Iterator

public interface IloLinearNumExprIterator
extends java.util.Iterator

This is the iterator for the linear terms of an IloLinearNumExpr expression object. The iterator allows the caller to enumerate all the terms of an IloLinearNumExpr and perform simple operations, such as querying or modifying a term. During the iteration, the caller can remove elements from the underlying IloLinearNumExpr using well-defined semantics.


Method Summary
 double getValue()
          Returns the coefficient related to the IloNumVar accessed by the last call to the method next().
 IloNumVar nextNumVar()
          Returns the IloNumVar of the next linear term in the underlying IloLinearNumExpr.
 void setNumVar(IloNumVar var)
          Sets the IloNumVar of the last linear term in the scalar product.
 void setValue(double value)
          Sets the coefficient related to the IloIntVar accessed by the last call to the method next().
 
Methods inherited from interface java.util.Iterator
hasNext, next, remove
 

Method Detail

nextNumVar

public IloNumVar nextNumVar()
Returns the IloNumVar of the next linear term in the underlying IloLinearNumExpr. This differs from the method next() in that this method returns the variable with the correct java type, avoiding the need for a downcast.

Returns:
The next IloNumVar in the iteration.
Throws:
NoSuchElementException - The iteration has no more elements.

setNumVar

public void setNumVar(IloNumVar var)
Sets the IloNumVar of the last linear term in the scalar product.

Parameters:
var - The variable to be set for the current linear term of the underlying IloLinearNumExpr.
Throws:
IllegalStateException - This occurs if the next() or the nextNumVar() method has not been called, or if the remove method has been called since the last call to the next() or the nextNumVar() method.

getValue

public double getValue()
Returns the coefficient related to the IloNumVar accessed by the last call to the method next().

Returns:
The coefficient of the current linear term.
Throws:
IllegalStateException - This occurs if the next() or the nextNumVar() method has not been called, or if the remove method has been called since the last call to the next() or the nextNumVar() method.

setValue

public void setValue(double value)
Sets the coefficient related to the IloIntVar accessed by the last call to the method next().

Parameters:
value - The coefficient value to be set for the current linear term of the underlying IloLinearNumExpr.
Throws:
IllegalStateException - This occurs if the method next or nextNumVar has not been called, or if the remove method has been called since the last call to next or nextNumVar.