|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjavax.constraints.impl.CommonBase
javax.constraints.impl.AbstractConstrainedVariable
javax.constraints.impl.AbstractVar
public abstract class AbstractVar
| Constructor Summary | |
|---|---|
AbstractVar(Problem problem)
|
|
AbstractVar(Problem problem,
java.lang.String name)
|
|
| Method Summary | |
|---|---|
abstract void |
addPropagator(Propagator propagator,
PropagationEvent event)
This method associates a custom Propagator with an "event" related to changes in the domain of a constrained variable "var". |
int |
compareTo(Var var)
|
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()
Provides the default implementation as return getMax() - getMin() + 1; This method is better to be redefined to take into consideration an actual domain implementations. |
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 |
getValue()
Returns the value to which this variable has been instantiated, throws a RuntimeException if the variable is not instantiated. |
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 |
negative()
Returns a new Var that is constrained to be the negation of this 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. |
java.lang.String |
toString()
|
| Methods inherited from class javax.constraints.impl.CommonBase |
|---|
getImpl, getName, getObject, getProblem, setImpl, setName, setObject |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface javax.constraints.Var |
|---|
abs, contains, getMax, getMin, isBound, multiply, multiply, plus, plus |
| Methods inherited from interface javax.constraints.ConstrainedVariable |
|---|
getImpl, getName, getObject, getProblem, setImpl, setName, setObject |
| Constructor Detail |
|---|
public AbstractVar(Problem problem)
public AbstractVar(Problem problem,
java.lang.String name)
| Method Detail |
|---|
public abstract void addPropagator(Propagator propagator,
PropagationEvent event)
propagator - the Propagator we wish to associate with events on the
variable.event - the events that will trigger the invocation of the
Propagator.public int compareTo(Var var)
compareTo in interface Varpublic Var divide(int value)
Var
divide in interface Varvalue - the given value.
public Var divide(Var var)
throws java.lang.Exception
Var
divide in interface Varvar - the given variable.
java.lang.Exception - if dividing by zero.public int getDomainSize()
getDomainSize in interface Varpublic DomainType getDomainType()
Var
getDomainType in interface Varpublic java.lang.String getInitialDomain()
Var
getInitialDomain in interface Varpublic int getValue()
Var
getValue in interface Varjava.lang.RuntimeException - if this variable is not instantiatedpublic Var minus(int value)
Var
minus in interface Varvalue - the given value.
public Var minus(Var var)
Var
minus in interface Varvar - the given variable.
public Var mod(int value)
Var
mod in interface Varvalue - the given value.
public Var negative()
Var
negative in interface Varpublic Var power(int value)
power in interface Varvalue - the given value.
public void setDomainType(DomainType type)
setDomainType in interface Vartype - public Var sqr()
sqr in interface Varpublic java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||