Class VariableListenerSupport<Solution_>
- java.lang.Object
-
- org.optaplanner.core.impl.domain.variable.listener.support.VariableListenerSupport<Solution_>
-
- Type Parameters:
Solution_
- the solution type, the class with thePlanningSolution
annotation
- All Implemented Interfaces:
SupplyManager<Solution_>
public final class VariableListenerSupport<Solution_> extends Object implements SupplyManager<Solution_>
-
-
Constructor Summary
Constructors Constructor Description VariableListenerSupport(InnerScoreDirector<Solution_,?> scoreDirector)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
afterEntityAdded(EntityDescriptor<Solution_> entityDescriptor, Object entity)
void
afterEntityRemoved(EntityDescriptor<Solution_> entityDescriptor, Object entity)
void
afterVariableChanged(VariableDescriptor<Solution_> variableDescriptor, Object entity)
void
assertNotificationQueuesAreEmpty()
void
beforeEntityAdded(EntityDescriptor<Solution_> entityDescriptor, Object entity)
void
beforeEntityRemoved(EntityDescriptor<Solution_> entityDescriptor, Object entity)
void
beforeVariableChanged(VariableDescriptor<Solution_> variableDescriptor, Object entity)
void
clearWorkingSolution()
<Supply_ extends Supply>
Supply_demand(Demand<Solution_,Supply_> demand)
void
linkVariableListeners()
void
resetWorkingSolution()
void
triggerAllVariableListeners()
void
triggerVariableListenersInNotificationQueues()
-
-
-
Constructor Detail
-
VariableListenerSupport
public VariableListenerSupport(InnerScoreDirector<Solution_,?> scoreDirector)
-
-
Method Detail
-
linkVariableListeners
public void linkVariableListeners()
-
demand
public <Supply_ extends Supply> Supply_ demand(Demand<Solution_,Supply_> demand)
Description copied from interface:SupplyManager
Returns theSupply
for aDemand
, preferably an existing one. If theSupply
doesn't exist yet (as part of the domain model or externalized), it creates and attaches it.- Specified by:
demand
in interfaceSupplyManager<Solution_>
- Type Parameters:
Supply_
- Subclass ofSupply
- Parameters:
demand
- never null- Returns:
- never null
-
resetWorkingSolution
public void resetWorkingSolution()
-
clearWorkingSolution
public void clearWorkingSolution()
-
beforeEntityAdded
public void beforeEntityAdded(EntityDescriptor<Solution_> entityDescriptor, Object entity)
-
afterEntityAdded
public void afterEntityAdded(EntityDescriptor<Solution_> entityDescriptor, Object entity)
-
beforeVariableChanged
public void beforeVariableChanged(VariableDescriptor<Solution_> variableDescriptor, Object entity)
-
afterVariableChanged
public void afterVariableChanged(VariableDescriptor<Solution_> variableDescriptor, Object entity)
-
beforeEntityRemoved
public void beforeEntityRemoved(EntityDescriptor<Solution_> entityDescriptor, Object entity)
-
afterEntityRemoved
public void afterEntityRemoved(EntityDescriptor<Solution_> entityDescriptor, Object entity)
-
triggerVariableListenersInNotificationQueues
public void triggerVariableListenersInNotificationQueues()
-
triggerAllVariableListeners
public void triggerAllVariableListeners()
-
assertNotificationQueuesAreEmpty
public void assertNotificationQueuesAreEmpty()
-
-