choco.palm
Interface PalmVarListener

All Superinterfaces:
java.util.EventListener, VarEventListener
All Known Subinterfaces:
DecisionConstraint, PalmConstraint, PalmIntVarListener, PalmMixedConstraint, PalmRealVarListener, SymbolicDecision
All Known Implementing Classes:
AbstractDecision, AbstractPalmBinIntConstraint, AbstractPalmLargeIntConstraint, AbstractPalmSplit, AbstractPalmTernIntConstraint, AbstractPalmUnIntConstraint, AbstractPalmUnRealConstraint, Assignment, NogoodConstraint, PalmAllDifferent, PalmAssignment, PalmCardinality, PalmElt, PalmElt2D, PalmEqualXC, PalmEqualXYC, PalmEquation, PalmGreaterOrEqualXC, PalmGreaterOrEqualXYC, PalmIntLinComb, PalmLessOrEqualXC, PalmMixedCstElt, PalmMixedEqXY, PalmNotEqualXC, PalmNotEqualXYC, PalmOccurence, PalmSplitLeft, PalmSplitRight

public interface PalmVarListener
extends VarEventListener


Method Summary
 int getConstraintIdx(int idx)
          Network management: Among all listeners linked to the idx-th variable of c, find the index of constraint c.
 void setConstraintIndex(int i, int idx)
          Network management: Storing that among all listeners linked to the i-th variable of c, this (the current constraint) is found at index idx.
 void updateDataStructuresOnConstraint(int idx, int select, int newValue, int oldValue)
          Method called when one of the variables is modified.
 void updateDataStructuresOnRestoreConstraint(int idx, int select, int newValue, int oldValue)
          Method called when one of the variables has a restored value.
 
Methods inherited from interface choco.prop.VarEventListener
addListener, awakeOnVar, isActive, setActive, setPassive
 

Method Detail

updateDataStructuresOnConstraint

void updateDataStructuresOnConstraint(int idx,
                                      int select,
                                      int newValue,
                                      int oldValue)
Method called when one of the variables is modified.

Parameters:
idx - Index of the variable.
select - Type of modification (PalmIntVar.INF, PalmIntVar.SUP, PalmIntVar.VAL).
newValue - New value (or modified value).
oldValue - Old value (or 0 if this a value removal).

updateDataStructuresOnRestoreConstraint

void updateDataStructuresOnRestoreConstraint(int idx,
                                             int select,
                                             int newValue,
                                             int oldValue)
Method called when one of the variables has a restored value.

Parameters:
idx - Index of the variable.
select - Type of modification.
newValue - New value (or modified value).
oldValue - Old value (or 0 if this a value removal).

setConstraintIndex

void setConstraintIndex(int i,
                        int idx)
Network management: Storing that among all listeners linked to the i-th variable of c, this (the current constraint) is found at index idx.

Parameters:
i - index of the variable in the constraint
idx - index of the constraint in the among all listeners linked to that variable

getConstraintIdx

int getConstraintIdx(int idx)
Network management: Among all listeners linked to the idx-th variable of c, find the index of constraint c.

Parameters:
idx - index of the variable in the constraint