|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface Var
This interface represents constrained integer variables, the most frequently used type of constrained objects.
| Method Summary | |
|---|---|
Var |
abs()
Returns a new Var that is constrained to be the absolute value of this variable. |
int |
compareTo(Var var)
|
boolean |
contains(int value)
Returns true if the domain of this variable contains the value. |
Var |
divide(int value)
Returns a new Var that is constrained to be the division of this variable by the given value, i.e. |
Var |
divide(Var var)
Returns a new Var that is constrained to be the division of this variable by the given variable, i.e. |
int |
getDomainSize()
Returns the current number of values inside the domain of this variable. |
DomainType |
getDomainType()
Returns the type of this variable's domain. |
java.lang.String |
getInitialDomain()
Returns a string representation of the initial domain of this variable. |
int |
getMax()
Returns the current maximum value in the domain of this variable. |
int |
getMin()
Returns the current minimum value in the domain of this variable. |
int |
getValue()
Returns the value to which this variable has been instantiated, throws a RuntimeException if the variable is not instantiated. |
boolean |
isBound()
Returns true if the domain of the variable contains only one value. |
Var |
minus(int value)
Returns a new Var that is constrained to be the difference of this variable and the given value, i.e. |
Var |
minus(Var var)
Returns a new Var that is constrained to be the difference of this variable and the given variable, i.e. |
Var |
mod(int value)
Returns a new Var that is constrained to be the remainder after performing integer division of this variable by the given value, i.e. |
Var |
multiply(int value)
Returns a new Var that is constrained to be the product of this variable and the given value, i.e. |
Var |
multiply(Var var)
Returns a new Var that is constrained to be the product of this variable and the given variable, i.e. |
Var |
negative()
Returns a new Var that is constrained to be the negation of this variable, i.e. |
Var |
plus(int value)
Returns a new Var that is constrained to be the sum of this variable and the given value, i.e. |
Var |
plus(Var var)
Returns a new Var that is constrained to be the sum of this variable and the given variable, i.e. |
Var |
power(int value)
Returns a new Var that is constrained to be this variable raised to the power of the given value, i.e. |
void |
setDomainType(DomainType type)
Changes the domain type of this variable. |
Var |
sqr()
Returns a new Var that is constrained to be the product of this variable and itself, i.e. |
| Methods inherited from interface javax.constraints.ConstrainedVariable |
|---|
getImpl, getName, getObject, getProblem, setImpl, setName, setObject |
| Method Detail |
|---|
Var abs()
int compareTo(Var var)
boolean contains(int value)
Var divide(int value)
value - the given value.
Var divide(Var var)
throws java.lang.Exception
var - the given variable.
java.lang.Exception - if dividing by zero.int getDomainSize()
DomainType getDomainType()
java.lang.String getInitialDomain()
int getMax()
int getMin()
int getValue()
java.lang.RuntimeException - if this variable is not instantiated.boolean isBound()
Var minus(int value)
value - the given value.
Var minus(Var var)
var - the given variable.
Var mod(int value)
value - the given value.
Var multiply(int value)
value - the given value.
Var multiply(Var var)
var - the given variable.
Var negative()
Var plus(int value)
value - the given value.
Var plus(Var var)
var - the given variable.
Var power(int value)
value - the given value.
void setDomainType(DomainType type)
type - Var sqr()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||