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
public final class VariableListenerSupport<Solution_> extends Object implements SupplyManager
-
-
Method Summary
-
-
-
Method Detail
-
create
public static <Solution_> VariableListenerSupport<Solution_> create(InnerScoreDirector<Solution_,?> scoreDirector)
-
linkVariableListeners
public void linkVariableListeners()
-
demand
public <Supply_ extends Supply> Supply_ demand(Demand<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
- Type Parameters:
Supply_
- Subclass ofSupply
- Parameters:
demand
- never null- Returns:
- never null
-
resetWorkingSolution
public void resetWorkingSolution()
-
close
public void close()
-
beforeEntityAdded
public void beforeEntityAdded(EntityDescriptor<Solution_> entityDescriptor, Object entity)
-
beforeEntityRemoved
public void beforeEntityRemoved(EntityDescriptor<Solution_> entityDescriptor, Object entity)
-
beforeVariableChanged
public void beforeVariableChanged(VariableDescriptor<Solution_> variableDescriptor, Object entity)
-
afterElementUnassigned
public void afterElementUnassigned(ListVariableDescriptor<Solution_> variableDescriptor, Object element)
-
beforeListVariableChanged
public void beforeListVariableChanged(ListVariableDescriptor<Solution_> variableDescriptor, Object entity, int fromIndex, int toIndex)
-
afterListVariableChanged
public void afterListVariableChanged(ListVariableDescriptor<Solution_> variableDescriptor, Object entity, int fromIndex, int toIndex)
-
triggerVariableListenersInNotificationQueues
public void triggerVariableListenersInNotificationQueues()
-
createShadowVariablesViolationMessage
public String createShadowVariablesViolationMessage()
- Returns:
- null if there are no violations
-
assertNotificationQueuesAreEmpty
public void assertNotificationQueuesAreEmpty()
-
-