Package org.jacop.constraints.netflow
Class MultiVarHandler
- java.lang.Object
-
- org.jacop.constraints.netflow.MultiVarHandler
-
- All Implemented Interfaces:
VarHandler
public class MultiVarHandler extends java.lang.Object implements VarHandler
- Version:
- 4.8
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<VarHandler>handlersprivate IntVarvariable
-
Constructor Summary
Constructors Constructor Description MultiVarHandler(IntVar variable, VarHandler... handlers)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(VarHandler handler)intgetPruningEvent(Var variable)Retrieves the consistency pruning event of a handler variable that causes the handler to be reevaluated.java.util.List<IntVar>listVariables()voidprocessEvent(IntVar variable, MutableNetwork network)Informs the handler that one of its variable has changed and asks the handler to update the state of the network accordingly.
-
-
-
Field Detail
-
variable
private final IntVar variable
-
handlers
private final java.util.List<VarHandler> handlers
-
-
Constructor Detail
-
MultiVarHandler
public MultiVarHandler(IntVar variable, VarHandler... handlers)
-
-
Method Detail
-
add
public void add(VarHandler handler)
-
getPruningEvent
public int getPruningEvent(Var variable)
Description copied from interface:VarHandlerRetrieves the consistency pruning event of a handler variable that causes the handler to be reevaluated. For instance, X- and W-variables will listen to BOUND events while S-variables typically consider ANY events.- Specified by:
getPruningEventin interfaceVarHandler- Parameters:
variable- a handler variable- Returns:
- the pruning event which causes reevaluation of the handler
-
listVariables
public java.util.List<IntVar> listVariables()
- Specified by:
listVariablesin interfaceVarHandler- Returns:
- the list of variables handled by this handler
-
processEvent
public void processEvent(IntVar variable, MutableNetwork network)
Description copied from interface:VarHandlerInforms the handler that one of its variable has changed and asks the handler to update the state of the network accordingly.- Specified by:
processEventin interfaceVarHandler- Parameters:
variable- the variable that changednetwork- the network
-
-