Class ExternalizedCollectionInverseVariableSupply<Solution_>
java.lang.Object
ai.timefold.solver.core.impl.domain.variable.inverserelation.ExternalizedCollectionInverseVariableSupply<Solution_>
- All Implemented Interfaces:
InnerBasicVariableListener<Solution_,,Object> InnerVariableListener<Solution_,,BasicVariableChangeEvent<Object>> CollectionInverseVariableSupply,SourcedBasicVariableListener<Solution_,,Object> SourcedVariableListener<Solution_,,BasicVariableChangeEvent<Object>> Supply,Closeable,AutoCloseable
public class ExternalizedCollectionInverseVariableSupply<Solution_>
extends Object
implements SourcedBasicVariableListener<Solution_,Object>, CollectionInverseVariableSupply
Alternative to
CollectionInverseVariableListener.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionExternalizedCollectionInverseVariableSupply(VariableDescriptor<Solution_> sourceVariableDescriptor, Consumer<Object> notifier) -
Method Summary
Modifier and TypeMethodDescriptionvoidafterChange(InnerScoreDirector<Solution_, ?> scoreDirector, BasicVariableChangeEvent<Object> event) voidbeforeChange(InnerScoreDirector<Solution_, ?> scoreDirector, BasicVariableChangeEvent<Object> event) voidclose()Called before thisInnerVariableListeneris thrown away and not used anymore.Collection<?>getInverseCollection(Object value) If entity1.varA = x then an inverse of x is entity1.protected voidvoidresetWorkingSolution(@NonNull InnerScoreDirector<Solution_, ?> scoreDirector) Called when the entire working solution changes.protected voidtoString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface ai.timefold.solver.core.impl.domain.variable.InnerVariableListener
requiresUniqueEntityEvents
-
Field Details
-
sourceVariableDescriptor
-
notifier
-
inverseEntitySetMap
-
-
Constructor Details
-
ExternalizedCollectionInverseVariableSupply
public ExternalizedCollectionInverseVariableSupply(VariableDescriptor<Solution_> sourceVariableDescriptor, Consumer<Object> notifier)
-
-
Method Details
-
getSourceVariableDescriptor
- Specified by:
getSourceVariableDescriptorin interfaceSourcedVariableListener<Solution_,BasicVariableChangeEvent<Object>>
-
resetWorkingSolution
Description copied from interface:InnerVariableListenerCalled when the entire working solution changes. In this event, the other before..()/after...() methods will not be called. At this point, implementations should clear state, if any.- Specified by:
resetWorkingSolutionin interfaceInnerVariableListener<Solution_,BasicVariableChangeEvent<Object>>
-
beforeChange
public void beforeChange(InnerScoreDirector<Solution_, ?> scoreDirector, BasicVariableChangeEvent<Object> event) - Specified by:
beforeChangein interfaceInnerVariableListener<Solution_,BasicVariableChangeEvent<Object>>
-
afterChange
public void afterChange(InnerScoreDirector<Solution_, ?> scoreDirector, BasicVariableChangeEvent<Object> event) - Specified by:
afterChangein interfaceInnerVariableListener<Solution_,BasicVariableChangeEvent<Object>>
-
close
public void close()Description copied from interface:InnerVariableListenerCalled before thisInnerVariableListeneris thrown away and not used anymore.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceInnerVariableListener<Solution_,BasicVariableChangeEvent<Object>>
-
insert
-
retract
-
getInverseCollection
Description copied from interface:CollectionInverseVariableSupplyIf entity1.varA = x then an inverse of x is entity1.- Specified by:
getInverseCollectionin interfaceCollectionInverseVariableSupply- Parameters:
value- never null- Returns:
- never null, a
Collectionof entities for which the planning variable is the planningValue.
-
toString
-