Class AbstractComposer<C extends Candidate,I extends AdvancedComposition<C>,R extends Result>
- java.lang.Object
-
- org.processmining.specpp.componenting.system.link.AbstractBaseClass
-
- org.processmining.specpp.base.impls.AbstractComposer<C,I,R>
-
- Type Parameters:
C-I-R-
- All Implemented Interfaces:
java.util.function.Consumer<C>,Composer<C,I,R>,FullComponentSystemUser,ComposerComponent<C,I,R>,HasComponentCollection,IsGlobalProvider,UsesGlobalComponentSystem,UsesLocalComponentSystem,Initializable
- Direct Known Subclasses:
AbstractConstrainingComposer,AcceptingComposer,ComposerDelevopmentEntryPoint,ETCBasedComposer,PlaceComposerWithCIPR
public abstract class AbstractComposer<C extends Candidate,I extends AdvancedComposition<C>,R extends Result> extends AbstractBaseClass implements ComposerComponent<C,I,R>
The abstract base class for composers which internally manages an advanced, i.e. mutable, composition component.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.function.Function<? super I,R>assembleResultprotected Icomposition
-
Constructor Summary
Constructors Constructor Description AbstractComposer(I composition, java.util.function.Function<? super I,R> assembleResult)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaccept(C candidate)Delegates the decision on whether to accept a candidate todeliberateAcceptance().protected abstract voidacceptanceRevoked(C candidate)Hook for actions to perform on initially accepted candidates which are now removed.protected voidacceptCandidate(C candidate)protected abstract voidcandidateAccepted(C candidate)Hook for actions to perform on accepted candidates.protected abstract voidcandidateRejected(C candidate)Hook for actions to perform on rejected candidates.protected Icomposition()protected abstract booleandeliberateAcceptance(C candidate)Hook method where the acceptance decision is made.RgenerateResult()Hook method where a final result is computed from the incrementally built up intermediate result.IgetIntermediateResult()Typically just returns the internally managed composition.booleanisFinished()Whether this composer has reached a state where it does not want to handle new candidates.protected voidrejectCandidate(C candidate)protected voidrevokeAcceptance(C candidate)protected voidrevokeLastAcceptance()-
Methods inherited from class org.processmining.specpp.componenting.system.link.AbstractBaseClass
collectTransitiveSubcomponents, getComponentCollection, getSubComponents, globalComponentSystem, init, initSelf, localComponentSystem, postSubComponentInit, preSubComponentInit, registerSubComponent, unregisterSubComponent
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.processmining.specpp.base.Composer
candidatesAreExhausted
-
Methods inherited from interface org.processmining.specpp.componenting.system.FullComponentSystemUser
collectTransitiveSubcomponents, connectLocalComponentSystem, getComponentCollection, registerSubComponent, unregisterSubComponent
-
Methods inherited from interface org.processmining.specpp.traits.Initializable
init
-
Methods inherited from interface org.processmining.specpp.componenting.traits.UsesGlobalComponentSystem
globalComponentSystem
-
Methods inherited from interface org.processmining.specpp.componenting.traits.UsesLocalComponentSystem
bridgeToChildren, localComponentSystem
-
-
-
-
Field Detail
-
assembleResult
protected final java.util.function.Function<? super I extends AdvancedComposition<C>,R extends Result> assembleResult
-
composition
protected final I extends AdvancedComposition<C> composition
-
-
Method Detail
-
accept
public void accept(C candidate)
Delegates the decision on whether to accept a candidate todeliberateAcceptance().
-
composition
protected I composition()
-
deliberateAcceptance
protected abstract boolean deliberateAcceptance(C candidate)
Hook method where the acceptance decision is made.- Parameters:
candidate- the candidate to decide acceptance for- Returns:
- whether to accept this candidate
-
acceptCandidate
protected final void acceptCandidate(C candidate)
-
rejectCandidate
protected final void rejectCandidate(C candidate)
-
revokeAcceptance
protected final void revokeAcceptance(C candidate)
-
revokeLastAcceptance
protected final void revokeLastAcceptance()
-
acceptanceRevoked
protected abstract void acceptanceRevoked(C candidate)
Hook for actions to perform on initially accepted candidates which are now removed.- Parameters:
candidate- the revoked candidate
-
candidateAccepted
protected abstract void candidateAccepted(C candidate)
Hook for actions to perform on accepted candidates.- Parameters:
candidate- the accepted candidate
-
candidateRejected
protected abstract void candidateRejected(C candidate)
Hook for actions to perform on rejected candidates.- Parameters:
candidate- the rejected candidate
-
isFinished
public boolean isFinished()
Description copied from interface:ComposerWhether this composer has reached a state where it does not want to handle new candidates.- Specified by:
isFinishedin interfaceComposer<C extends Candidate,I extends AdvancedComposition<C>,R extends Result>- Returns:
- true iff no more candidates will be accepted
-
getIntermediateResult
public final I getIntermediateResult()
Description copied from interface:ComposerTypically just returns the internally managed composition. Care must be taken, that this method may be called asynchronously.- Specified by:
getIntermediateResultin interfaceComposer<C extends Candidate,I extends AdvancedComposition<C>,R extends Result>- Returns:
- the intermediate result
-
generateResult
public final R generateResult()
Description copied from interface:ComposerHook method where a final result is computed from the incrementally built up intermediate result.- Specified by:
generateResultin interfaceComposer<C extends Candidate,I extends AdvancedComposition<C>,R extends Result>- Returns:
- the final result
-
-