omnics.constraint
Class BinaryIntConstraint

java.lang.Object
  extended by omnics.Constraint
      extended by omnics.constraint.BinaryConstraint
          extended by omnics.constraint.BinaryIntConstraint
All Implemented Interfaces:
java.io.Serializable

public abstract class BinaryIntConstraint
extends BinaryConstraint

Convenience abstract class that enforces a binary constraint defined on integer variables. It exposes for subclasses the variables x,y and their indices xIndex, yIndex

Author:
Cristian Frasinaru
See Also:
Serialized Form

Field Summary
 
Fields inherited from class omnics.constraint.BinaryConstraint
x, xIndex, y, yIndex
 
Fields inherited from class omnics.Constraint
ALLOWED, filter, FORBIDDEN, MAX, MIN, name, problem, variables
 
Constructor Summary
BinaryIntConstraint(Var x, Var y)
          Creates a new instance of BinaryIntConstraint
 
Method Summary
abstract  int eval(int a, int b)
          This is the method that evaluates the tuple (x=a,y=b), where a and b are primitive integers.
 int eval(java.lang.Object a, java.lang.Object b)
          This method assumes that a and b are integers and transfers the control to eval(int, int)
 
Methods inherited from class omnics.constraint.BinaryConstraint
eval, eval
 
Methods inherited from class omnics.Constraint
eval, getFilter, getName, getProblem, getTuples, getVarArray, getVariables, setFilter, setName, setVariables, setVariables, toString, variable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BinaryIntConstraint

public BinaryIntConstraint(Var x,
                           Var y)
Creates a new instance of BinaryIntConstraint

Method Detail

eval

public int eval(java.lang.Object a,
                java.lang.Object b)
This method assumes that a and b are integers and transfers the control to eval(int, int)

Specified by:
eval in class BinaryConstraint

eval

public abstract int eval(int a,
                         int b)
This is the method that evaluates the tuple (x=a,y=b), where a and b are primitive integers. Must be implemented in the subclasses.