|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectagg.util.csp.Query
public abstract class Query
An abstract class that represents a query for a variable domain.
Field Summary | |
---|---|
protected int |
itsWeight
|
java.lang.String |
typeNameOfVariable
|
Constructor Summary | |
---|---|
Query(Variable tar,
int weight)
Construct myself to be a constant query. |
|
Query(Variable src,
Variable tar,
int weight)
Construct myself to be a unary query. |
|
Query(Variable src1,
Variable src2,
Variable tar,
int weight)
Construct myself to be a binary query. |
Method Summary | |
---|---|
void |
activateCorrespondent()
Activates the correspondent constraint of this query. |
void |
deactivateCorrespondent()
Deactivates the correspondent constraint of this query. |
abstract java.util.Enumeration<?> |
execute()
Return an Enumeration of candidate values for the target variable. |
abstract java.lang.String |
getKind()
Return the name of my implementing class. |
abstract int |
getSize()
Return the number of candidate values execute() will
provide. |
Variable |
getSource(int i)
|
protected java.lang.Object |
getSourceInstance(int i)
Return the current instance of the source variable given by the index i . |
java.util.Enumeration<?> |
getSources()
Return an enumeration of the variables that need to be instantiated for the query to work. |
Variable |
getTarget()
Return the variable that I'm determining the domain for. |
int |
getWeight()
Return my weight. |
boolean |
isApplicable()
Return true iff all my source variables are instantiated,
while my target variable is not. |
boolean |
isConstant()
Return true iff I am a constant query. |
void |
setCorrespondent(BinaryConstraint constraint)
Sets the correspondent constraint of this query. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected int itsWeight
public java.lang.String typeNameOfVariable
Constructor Detail |
---|
public Query(Variable tar, int weight)
public Query(Variable src, Variable tar, int weight)
public Query(Variable src1, Variable src2, Variable tar, int weight)
Method Detail |
---|
public boolean isApplicable()
true
iff all my source variables are instantiated,
while my target variable is not.
public boolean isConstant()
true
iff I am a constant query. That means, the
result of execute()
is the same for any variable
instantiation configuration.
public abstract java.util.Enumeration<?> execute()
Pre: isApplicable()
.
public Variable getTarget()
public final java.util.Enumeration<?> getSources()
Variable
.
public final Variable getSource(int i)
public abstract int getSize()
execute()
will
provide. For non-constant queries, this will most probably be based on
estimation. The value may change in response to re-setting the CSP
domains with the setDomain()
method.
Pre: csp.getDomain() != null
.
CSP.setDomain(java.lang.Object)
public final int getWeight()
public abstract java.lang.String getKind()
protected final java.lang.Object getSourceInstance(int i)
i
.
Pre: i < itsSources.size()
.
public void setCorrespondent(BinaryConstraint constraint)
constraint
- public void activateCorrespondent()
public void deactivateCorrespondent()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |