Interface Composer<C extends Candidate,​I extends Composition<C>,​R extends Result>

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void accept​(C c)
      Hook method which decides how to handle an incoming candidate.
      void candidatesAreExhausted()
      Hook method which is called when this composer will not receive any more candidates in the future as the connected proposer has been exhausted.
      R generateResult()
      Hook method where a final result is computed from the incrementally built up intermediate result.
      I getIntermediateResult()
      Typically just returns the internally managed composition.
      boolean isFinished()
      Whether this composer has reached a state where it does not want to handle new candidates.
      • Methods inherited from interface java.util.function.Consumer

        andThen
    • Method Detail

      • isFinished

        boolean isFinished()
        Whether this composer has reached a state where it does not want to handle new candidates.
        Returns:
        true iff no more candidates will be accepted
      • candidatesAreExhausted

        void candidatesAreExhausted()
        Hook method which is called when this composer will not receive any more candidates in the future as the connected proposer has been exhausted.
      • getIntermediateResult

        I getIntermediateResult()
        Typically just returns the internally managed composition. Care must be taken, that this method may be called asynchronously.
        Returns:
        the intermediate result
      • generateResult

        R generateResult()
        Hook method where a final result is computed from the incrementally built up intermediate result.
        Returns:
        the final result
      • accept

        void accept​(C c)
        Hook method which decides how to handle an incoming candidate. The internal logic decides whether the candidate is eventually added to the current composition.
        Specified by:
        accept in interface java.util.function.Consumer<C extends Candidate>
        Parameters:
        c - the candidate that has been offered to this composer