net.sf.javailp
Class Constraint

java.lang.Object
  extended by net.sf.javailp.Constraint

public class Constraint
extends Object

The class Constraint represent a linear constraint.


Constructor Summary
Constraint(Linear lhs, Operator operator, Number rhs)
          Constructs a Constraint.
Constraint(Linear lhs, String operator, Number rhs)
          Constructs a Constraint.
Constraint(String name, Linear lhs, Operator operator, Number rhs)
          Constructs a Constraint.
Constraint(String name, Linear lhs, String operator, Number rhs)
          Constructs a Constraint.
 
Method Summary
 Linear getLhs()
          Returns the left-hand-side linear expression.
 String getName()
          Returns the name of the constraint.
 Operator getOperator()
          Returns the Boolean operator.
 Number getRhs()
          Returns the right-hand-side number.
 int size()
          Returns the size of the linear expression.
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Constraint

public Constraint(Linear lhs,
                  Operator operator,
                  Number rhs)
Constructs a Constraint.

Parameters:
lhs - the left hand side
operator - the operator
rhs - the right hand side

Constraint

public Constraint(Linear lhs,
                  String operator,
                  Number rhs)
Constructs a Constraint.

Parameters:
lhs - the left hand side
operator - the operator ("<=","=",">=")
rhs - the right hand side

Constraint

public Constraint(String name,
                  Linear lhs,
                  Operator operator,
                  Number rhs)
Constructs a Constraint.

Parameters:
name - the name of the constraint
lhs - the left hand side
operator - the operator
rhs - the right hand side

Constraint

public Constraint(String name,
                  Linear lhs,
                  String operator,
                  Number rhs)
Constructs a Constraint.

Parameters:
name - the name of the constraint
lhs - the left hand side
operator - the operator ("<=","=",">=")
rhs - the right hand side
Method Detail

getLhs

public Linear getLhs()
Returns the left-hand-side linear expression.

Returns:
the left-hand-side linear expression

getOperator

public Operator getOperator()
Returns the Boolean operator.

Returns:
the Boolean operator

getRhs

public Number getRhs()
Returns the right-hand-side number.

Returns:
the right-hand-side number

size

public int size()
Returns the size of the linear expression.

Returns:
the size

toString

public String toString()
Overrides:
toString in class Object

getName

public String getName()
Returns the name of the constraint.

Returns:
the name