Class AnchorVariableListener<Solution_>
- java.lang.Object
-
- org.optaplanner.core.impl.domain.variable.anchor.AnchorVariableListener<Solution_>
-
- Type Parameters:
Solution_- the solution type, the class with thePlanningSolutionannotation
- All Implemented Interfaces:
Closeable,AutoCloseable,VariableListener<Solution_,Object>,AnchorVariableSupply,Supply
public class AnchorVariableListener<Solution_> extends Object implements VariableListener<Solution_,Object>, AnchorVariableSupply
-
-
Field Summary
Fields Modifier and Type Field Description protected AnchorShadowVariableDescriptor<Solution_>anchorShadowVariableDescriptorprotected SingletonInverseVariableSupplynextVariableSupplyprotected VariableDescriptor<Solution_>previousVariableDescriptor
-
Constructor Summary
Constructors Constructor Description AnchorVariableListener(AnchorShadowVariableDescriptor<Solution_> anchorShadowVariableDescriptor, VariableDescriptor<Solution_> previousVariableDescriptor, SingletonInverseVariableSupply nextVariableSupply)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterEntityAdded(ScoreDirector<Solution_> scoreDirector, Object entity)voidafterEntityRemoved(ScoreDirector<Solution_> scoreDirector, Object entity)voidafterVariableChanged(ScoreDirector<Solution_> scoreDirector, Object entity)voidbeforeEntityAdded(ScoreDirector<Solution_> scoreDirector, Object entity)voidbeforeEntityRemoved(ScoreDirector<Solution_> scoreDirector, Object entity)voidbeforeVariableChanged(ScoreDirector<Solution_> scoreDirector, Object entity)ObjectgetAnchor(Object entity)protected voidinsert(InnerScoreDirector<Solution_,?> scoreDirector, Object entity)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.optaplanner.core.api.domain.variable.VariableListener
close, requiresUniqueEntityEvents, resetWorkingSolution
-
-
-
-
Field Detail
-
anchorShadowVariableDescriptor
protected final AnchorShadowVariableDescriptor<Solution_> anchorShadowVariableDescriptor
-
previousVariableDescriptor
protected final VariableDescriptor<Solution_> previousVariableDescriptor
-
nextVariableSupply
protected final SingletonInverseVariableSupply nextVariableSupply
-
-
Constructor Detail
-
AnchorVariableListener
public AnchorVariableListener(AnchorShadowVariableDescriptor<Solution_> anchorShadowVariableDescriptor, VariableDescriptor<Solution_> previousVariableDescriptor, SingletonInverseVariableSupply nextVariableSupply)
-
-
Method Detail
-
beforeEntityAdded
public void beforeEntityAdded(ScoreDirector<Solution_> scoreDirector, Object entity)
- Specified by:
beforeEntityAddedin interfaceVariableListener<Solution_,Object>- Parameters:
scoreDirector- never nullentity- never null
-
afterEntityAdded
public void afterEntityAdded(ScoreDirector<Solution_> scoreDirector, Object entity)
- Specified by:
afterEntityAddedin interfaceVariableListener<Solution_,Object>- Parameters:
scoreDirector- never nullentity- never null
-
beforeVariableChanged
public void beforeVariableChanged(ScoreDirector<Solution_> scoreDirector, Object entity)
- Specified by:
beforeVariableChangedin interfaceVariableListener<Solution_,Object>- Parameters:
scoreDirector- never nullentity- never null
-
afterVariableChanged
public void afterVariableChanged(ScoreDirector<Solution_> scoreDirector, Object entity)
- Specified by:
afterVariableChangedin interfaceVariableListener<Solution_,Object>- Parameters:
scoreDirector- never nullentity- never null
-
beforeEntityRemoved
public void beforeEntityRemoved(ScoreDirector<Solution_> scoreDirector, Object entity)
- Specified by:
beforeEntityRemovedin interfaceVariableListener<Solution_,Object>- Parameters:
scoreDirector- never nullentity- never null
-
afterEntityRemoved
public void afterEntityRemoved(ScoreDirector<Solution_> scoreDirector, Object entity)
- Specified by:
afterEntityRemovedin interfaceVariableListener<Solution_,Object>- Parameters:
scoreDirector- never nullentity- never null
-
insert
protected void insert(InnerScoreDirector<Solution_,?> scoreDirector, Object entity)
-
getAnchor
public Object getAnchor(Object entity)
- Specified by:
getAnchorin interfaceAnchorVariableSupply- Parameters:
entity- never null- Returns:
- sometimes null, the anchor for the entity
-
-