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<Object>,AnchorVariableSupply,VariableListener<Object>,Supply
public class AnchorVariableListener<Solution_> extends Object implements VariableListener<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 scoreDirector, Object entity)voidafterEntityRemoved(ScoreDirector scoreDirector, Object entity)voidafterVariableChanged(ScoreDirector scoreDirector, Object entity)voidbeforeEntityAdded(ScoreDirector scoreDirector, Object entity)voidbeforeEntityRemoved(ScoreDirector scoreDirector, Object entity)voidbeforeVariableChanged(ScoreDirector scoreDirector, Object entity)ObjectgetAnchor(Object entity)protected voidinsert(ScoreDirector 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, resetWorkingSolution
-
Methods inherited from interface org.optaplanner.core.impl.domain.variable.listener.VariableListener
requiresUniqueEntityEvents
-
-
-
-
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 scoreDirector, Object entity)
- Specified by:
beforeEntityAddedin interfaceVariableListener<Solution_>- Specified by:
beforeEntityAddedin interfaceVariableListener<Solution_>- Parameters:
scoreDirector- never nullentity- never null
-
afterEntityAdded
public void afterEntityAdded(ScoreDirector scoreDirector, Object entity)
- Specified by:
afterEntityAddedin interfaceVariableListener<Solution_>- Specified by:
afterEntityAddedin interfaceVariableListener<Solution_>- Parameters:
scoreDirector- never nullentity- never null
-
beforeVariableChanged
public void beforeVariableChanged(ScoreDirector scoreDirector, Object entity)
- Specified by:
beforeVariableChangedin interfaceVariableListener<Solution_>- Specified by:
beforeVariableChangedin interfaceVariableListener<Solution_>- Parameters:
scoreDirector- never nullentity- never null
-
afterVariableChanged
public void afterVariableChanged(ScoreDirector scoreDirector, Object entity)
- Specified by:
afterVariableChangedin interfaceVariableListener<Solution_>- Specified by:
afterVariableChangedin interfaceVariableListener<Solution_>- Parameters:
scoreDirector- never nullentity- never null
-
beforeEntityRemoved
public void beforeEntityRemoved(ScoreDirector scoreDirector, Object entity)
- Specified by:
beforeEntityRemovedin interfaceVariableListener<Solution_>- Specified by:
beforeEntityRemovedin interfaceVariableListener<Solution_>- Parameters:
scoreDirector- never nullentity- never null
-
afterEntityRemoved
public void afterEntityRemoved(ScoreDirector scoreDirector, Object entity)
- Specified by:
afterEntityRemovedin interfaceVariableListener<Solution_>- Specified by:
afterEntityRemovedin interfaceVariableListener<Solution_>- Parameters:
scoreDirector- never nullentity- never null
-
insert
protected void insert(ScoreDirector 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
-
-