org.optaplanner.core.impl.score.stream.drools.tri

## Class DroolsAbstractTriConstraintStream<Solution_,A,B,C>

- java.lang.Object
- - org.optaplanner.core.impl.score.stream.common.AbstractConstraintStream<Solution_>
  - - org.optaplanner.core.impl.score.stream.drools.common.DroolsAbstractConstraintStream<Solution_>
    - - org.optaplanner.core.impl.score.stream.drools.tri.DroolsAbstractTriConstraintStream<Solution_,A,B,C>

- All Implemented Interfaces:
    ConstraintStream, TriConstraintStream<A,B,C>, InnerTriConstraintStream<A,B,C>
  Direct Known Subclasses:
    DroolsFilterTriConstraintStream, DroolsJoinTriConstraintStream, DroolsScoringTriConstraintStream

      public abstract class DroolsAbstractTriConstraintStream<Solution_,A,B,C>
      extends DroolsAbstractConstraintStream<Solution_>
      implements InnerTriConstraintStream<A,B,C>

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected DroolsAbstractTriConstraintStream<Solution_,A,B,C>` | `parent`

    - ### Fields inherited from class org.optaplanner.core.impl.score.stream.drools.common.DroolsAbstractConstraintStream

      `constraintFactory`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DroolsAbstractTriConstraintStream(DroolsConstraintFactory<Solution_> constraintFactory, DroolsAbstractTriConstraintStream<Solution_,A,B,C> parent)`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `TriConstraintStream<A,B,C>` | `filter(TriPredicate<A,B,C> predicate)` Exhaustively test each tuple of facts against the `TriPredicate` and match if `TriPredicate.test(Object, Object, Object)` returns true.
    `abstract DroolsTriCondition<A,B,C>` | `getCondition()`
    `List<DroolsFromUniConstraintStream<Solution_,Object>>` | `getFromStreamList()`
    `protected Constraint` | `impactScore(String constraintPackage, String constraintName, Score<?> constraintWeight, boolean positive)`
    `Constraint` | `impactScore(String constraintPackage, String constraintName, Score<?> constraintWeight, ToIntTriFunction<A,B,C> matchWeigher, boolean positive)`
    `Constraint` | `impactScoreBigDecimal(String constraintPackage, String constraintName, Score<?> constraintWeight, TriFunction<A,B,C,BigDecimal> matchWeigher, boolean positive)`
    `protected Constraint` | `impactScoreConfigurable(String constraintPackage, String constraintName, boolean positive)`
    `Constraint` | `impactScoreConfigurable(String constraintPackage, String constraintName, ToIntTriFunction<A,B,C> matchWeigher, boolean positive)`
    `Constraint` | `impactScoreConfigurableBigDecimal(String constraintPackage, String constraintName, TriFunction<A,B,C,BigDecimal> matchWeigher, boolean positive)`
    `Constraint` | `impactScoreConfigurableLong(String constraintPackage, String constraintName, ToLongTriFunction<A,B,C> matchWeigher, boolean positive)`
    `Constraint` | `impactScoreLong(String constraintPackage, String constraintName, Score<?> constraintWeight, ToLongTriFunction<A,B,C> matchWeigher, boolean positive)`
    `<D> QuadConstraintStream<A,B,C,D>` | `join(UniConstraintStream<D> otherStream, QuadJoiner<A,B,C,D> joiner)` Create a new `QuadConstraintStream` for every combination of [A, B] and C for which the `QuadJoiner` is true (for the properties it extracts from all facts).

    - ### Methods inherited from class org.optaplanner.core.impl.score.stream.drools.common.DroolsAbstractConstraintStream

      `addChildStream, buildConstraint, buildConstraintConfigurable, createRuleItemBuilders, getChildStreams, getConstraintFactory`

    - ### Methods inherited from class org.optaplanner.core.impl.score.stream.common.AbstractConstraintStream

      `buildConstraintWeightExtractor, buildConstraintWeightExtractor, penalize, penalizeConfigurable, reward, rewardConfigurable, validateConstraintId`

    - ### 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.impl.score.stream.tri.InnerTriConstraintStream

      `penalize, penalizeBigDecimal, penalizeConfigurable, penalizeConfigurableBigDecimal, penalizeConfigurableLong, penalizeLong, reward, rewardBigDecimal, rewardConfigurable, rewardConfigurableBigDecimal, rewardConfigurableLong, rewardLong`

    - ### Methods inherited from interface org.optaplanner.core.api.score.stream.tri.TriConstraintStream

      `join, join, join, join, join, join, join, penalize, penalizeBigDecimal, penalizeConfigurable, penalizeConfigurableBigDecimal, penalizeConfigurableLong, penalizeLong, reward, rewardBigDecimal, rewardConfigurable, rewardConfigurableBigDecimal, rewardConfigurableLong, rewardLong`

    - ### Methods inherited from interface org.optaplanner.core.api.score.stream.ConstraintStream

      `getConstraintFactory, penalize, penalize, penalizeConfigurable, penalizeConfigurable, reward, reward, rewardConfigurable, rewardConfigurable`

- - ### Field Detail

    - #### parent

          protected final DroolsAbstractTriConstraintStream<Solution_,A,B,C> parent

  - ### Constructor Detail

    - #### DroolsAbstractTriConstraintStream

          public DroolsAbstractTriConstraintStream(DroolsConstraintFactory<Solution_> constraintFactory,
                                                   DroolsAbstractTriConstraintStream<Solution_,A,B,C> parent)

  - ### Method Detail

    - #### filter

          public TriConstraintStream<A,B,C> filter(TriPredicate<A,B,C> predicate)

      Description copied from interface: `TriConstraintStream`
      Exhaustively test each tuple of facts against the `TriPredicate` and match if `TriPredicate.test(Object, Object, Object)` returns true.

      Important: This is slower and less scalable than `BiConstraintStream.join(UniConstraintStream, TriJoiner)` with a proper `TriJoiner` predicate (such as `Joiners.equal(BiFunction, Function)`, because the latter applies hashing and/or indexing, so it doesn't create every combination just to filter it out.

      Specified by:
        `filter` in interface `TriConstraintStream<A,B,C>`
      Parameters:
        `predicate` - never null
      Returns:
        never null

    - #### join

          public <D> QuadConstraintStream<A,B,C,D> join(UniConstraintStream<D> otherStream,
                                                        QuadJoiner<A,B,C,D> joiner)

      Description copied from interface: `TriConstraintStream`
      Create a new `QuadConstraintStream` for every combination of [A, B] and C for which the `QuadJoiner` is true (for the properties it extracts from all facts).

      Important: This is faster and more scalable than a `join` followed by a `filter`, because it applies hashing and/or indexing on the properties, so it doesn't create nor checks every combination of [A, B, C] and D.

      Specified by:
        `join` in interface `TriConstraintStream<A,B,C>`
      Type Parameters:
        `D` - the type of the fourth matched fact
      Parameters:
        `otherStream` - never null
        `joiner` - never null
      Returns:
        a stream that matches every combination of [A, B, C] and D for which the `QuadJoiner` is true

    - #### impactScore

          protected Constraint impactScore(String constraintPackage,
                                           String constraintName,
                                           Score<?> constraintWeight,
                                           boolean positive)

      Specified by:
        `impactScore` in class `AbstractConstraintStream<Solution_>`

    - #### impactScore

          public Constraint impactScore(String constraintPackage,
                                        String constraintName,
                                        Score<?> constraintWeight,
                                        ToIntTriFunction<A,B,C> matchWeigher,
                                        boolean positive)

      Specified by:
        `impactScore` in interface `InnerTriConstraintStream<A,B,C>`

    - #### impactScoreLong

          public Constraint impactScoreLong(String constraintPackage,
                                            String constraintName,
                                            Score<?> constraintWeight,
                                            ToLongTriFunction<A,B,C> matchWeigher,
                                            boolean positive)

      Specified by:
        `impactScoreLong` in interface `InnerTriConstraintStream<A,B,C>`

    - #### impactScoreBigDecimal

          public Constraint impactScoreBigDecimal(String constraintPackage,
                                                  String constraintName,
                                                  Score<?> constraintWeight,
                                                  TriFunction<A,B,C,BigDecimal> matchWeigher,
                                                  boolean positive)

      Specified by:
        `impactScoreBigDecimal` in interface `InnerTriConstraintStream<A,B,C>`

    - #### impactScoreConfigurable

          protected Constraint impactScoreConfigurable(String constraintPackage,
                                                       String constraintName,
                                                       boolean positive)

      Specified by:
        `impactScoreConfigurable` in class `AbstractConstraintStream<Solution_>`

    - #### impactScoreConfigurable

          public Constraint impactScoreConfigurable(String constraintPackage,
                                                    String constraintName,
                                                    ToIntTriFunction<A,B,C> matchWeigher,
                                                    boolean positive)

      Specified by:
        `impactScoreConfigurable` in interface `InnerTriConstraintStream<A,B,C>`

    - #### impactScoreConfigurableLong

          public Constraint impactScoreConfigurableLong(String constraintPackage,
                                                        String constraintName,
                                                        ToLongTriFunction<A,B,C> matchWeigher,
                                                        boolean positive)

      Specified by:
        `impactScoreConfigurableLong` in interface `InnerTriConstraintStream<A,B,C>`

    - #### impactScoreConfigurableBigDecimal

          public Constraint impactScoreConfigurableBigDecimal(String constraintPackage,
                                                              String constraintName,
                                                              TriFunction<A,B,C,BigDecimal> matchWeigher,
                                                              boolean positive)

      Specified by:
        `impactScoreConfigurableBigDecimal` in interface `InnerTriConstraintStream<A,B,C>`

    - #### getFromStreamList

          public List<DroolsFromUniConstraintStream<Solution_,Object>> getFromStreamList()

      Specified by:
        `getFromStreamList` in class `DroolsAbstractConstraintStream<Solution_>`

    - #### getCondition

          public abstract DroolsTriCondition<A,B,C> getCondition()

Copyright © 2006–2019 JBoss by Red Hat. All rights reserved.