org.optaplanner.core.impl.score.stream.bavet.uni

## Class BavetAbstractUniConstraintStream<Solution_,A>

- java.lang.Object
- - org.optaplanner.core.impl.score.stream.common.AbstractConstraintStream<Solution_>
  - - org.optaplanner.core.impl.score.stream.bavet.common.BavetAbstractConstraintStream<Solution_>
    - - org.optaplanner.core.impl.score.stream.bavet.uni.BavetAbstractUniConstraintStream<Solution_,A>

- All Implemented Interfaces:
    ConstraintStream, UniConstraintStream<A>, InnerUniConstraintStream<A>
  Direct Known Subclasses:
    BavetFilterUniConstraintStream, BavetFromUniConstraintStream, BavetGroupBridgeUniConstraintStream, BavetJoinBridgeUniConstraintStream, BavetScoringUniConstraintStream

      public abstract class BavetAbstractUniConstraintStream<Solution_,A>
      extends BavetAbstractConstraintStream<Solution_>
      implements InnerUniConstraintStream<A>

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected List<BavetAbstractUniConstraintStream<Solution_,A>>` | `childStreamList`

    - ### Fields inherited from class org.optaplanner.core.impl.score.stream.bavet.common.BavetAbstractConstraintStream

      `constraintFactory`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `BavetAbstractUniConstraintStream(BavetConstraintFactory<Solution_> constraintFactory)`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addChildStream(BavetAbstractUniConstraintStream<Solution_,A> childStream)`
    `protected void` | `createChildNodeChains(BavetNodeBuildPolicy<Solution_> buildPolicy, Score<?> constraintWeight, int nodeOrder, BavetAbstractUniNode<A> node)`
    `protected abstract BavetAbstractUniNode<A>` | `createNode(BavetNodeBuildPolicy<Solution_> buildPolicy, Score<?> constraintWeight, int nodeOrder, BavetAbstractUniNode<A> parentNode)`
    `BavetAbstractUniNode<A>` | `createNodeChain(BavetNodeBuildPolicy<Solution_> buildPolicy, Score<?> constraintWeight, int nodeOrder, BavetAbstractUniNode<A> parentNode)`
    `BavetAbstractUniConstraintStream<Solution_,A>` | `filter(Predicate<A> predicate)` Exhaustively test each fact against the `Predicate` and match if `Predicate.test(Object)` returns true.
    `<GroupKey_> UniConstraintStream<GroupKey_>` | `groupBy(Function<A,GroupKey_> groupKeyMapping)`
    `<GroupKey_,ResultContainer_,Result_> BiConstraintStream<GroupKey_,Result_>` | `groupBy(Function<A,GroupKey_> groupKeyMapping, UniConstraintCollector<A,ResultContainer_,Result_> collector)`
    `<GroupKeyA_,GroupKeyB_> BiConstraintStream<GroupKeyA_,GroupKeyB_>` | `groupBy(Function<A,GroupKeyA_> groupKeyAMapping, Function<A,GroupKeyB_> groupKeyBMapping)`
    `<GroupKeyA_,GroupKeyB_,ResultContainer_,Result_> TriConstraintStream<GroupKeyA_,GroupKeyB_,Result_>` | `groupBy(Function<A,GroupKeyA_> groupKeyAMapping, Function<A,GroupKeyB_> groupKeyBMapping, UniConstraintCollector<A,ResultContainer_,Result_> collector)`
    `<GroupKey_,ResultContainer_,Result_> UniConstraintStream<Result_>` | `groupBy(UniConstraintCollector<A,ResultContainer_,Result_> collector)`
    `Constraint` | `impactScore(String constraintPackage, String constraintName, Score<?> constraintWeight, boolean positive)`
    `Constraint` | `impactScore(String constraintPackage, String constraintName, Score<?> constraintWeight, ToIntFunction<A> matchWeigher, boolean positive)`
    `Constraint` | `impactScoreBigDecimal(String constraintPackage, String constraintName, Score<?> constraintWeight, Function<A,BigDecimal> matchWeigher, boolean positive)`
    `Constraint` | `impactScoreConfigurable(String constraintPackage, String constraintName, boolean positive)`
    `Constraint` | `impactScoreConfigurable(String constraintPackage, String constraintName, ToIntFunction<A> matchWeigher, boolean positive)`
    `Constraint` | `impactScoreConfigurableBigDecimal(String constraintPackage, String constraintName, Function<A,BigDecimal> matchWeigher, boolean positive)`
    `Constraint` | `impactScoreConfigurableLong(String constraintPackage, String constraintName, ToLongFunction<A> matchWeigher, boolean positive)`
    `Constraint` | `impactScoreLong(String constraintPackage, String constraintName, Score<?> constraintWeight, ToLongFunction<A> matchWeigher, boolean positive)`
    `<B> BiConstraintStream<A,B>` | `join(UniConstraintStream<B> otherStream, BiJoiner<A,B> joiner)` Create a new `BiConstraintStream` for every combination of A and B for which the `BiJoiner` is true (for the properties it extracts from both facts).
    `protected BavetAbstractUniNode<A>` | `processNode(BavetNodeBuildPolicy<Solution_> buildPolicy, int nodeOrder, BavetAbstractUniNode<A> parentNode, BavetAbstractUniNode<A> node)`

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

      `buildConstraint, buildConstraintConfigurable, getConstraintFactory, getFromStreamList`

    - ### 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.uni.InnerUniConstraintStream

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

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

      `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

    - #### childStreamList

          protected final List<BavetAbstractUniConstraintStream<Solution_,A>> childStreamList

  - ### Constructor Detail

    - #### BavetAbstractUniConstraintStream

          public BavetAbstractUniConstraintStream(BavetConstraintFactory<Solution_> constraintFactory)

  - ### Method Detail

    - #### addChildStream

          public void addChildStream(BavetAbstractUniConstraintStream<Solution_,A> childStream)

    - #### filter

          public BavetAbstractUniConstraintStream<Solution_,A> filter(Predicate<A> predicate)

      Description copied from interface: `UniConstraintStream`
      Exhaustively test each fact against the `Predicate` and match if `Predicate.test(Object)` returns true.
      Specified by:
        `filter` in interface `UniConstraintStream<A>`
      Parameters:
        `predicate` - never null
      Returns:
        never null

    - #### join

          public <B> BiConstraintStream<A,B> join(UniConstraintStream<B> otherStream,
                                                  BiJoiner<A,B> joiner)

      Description copied from interface: `UniConstraintStream`
      Create a new `BiConstraintStream` for every combination of A and B for which the `BiJoiner` is true (for the properties it extracts from both 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 and B.

      Specified by:
        `join` in interface `UniConstraintStream<A>`
      Type Parameters:
        `B` - the type of the second matched fact
      Parameters:
        `otherStream` - never null
        `joiner` - never null
      Returns:
        a stream that matches every combination of A and B for which the `BiJoiner` is true

    - #### groupBy

          public <GroupKey_,ResultContainer_,Result_> UniConstraintStream<Result_> groupBy(UniConstraintCollector<A,ResultContainer_,Result_> collector)

      Specified by:
        `groupBy` in interface `UniConstraintStream<A>`

    - #### groupBy

          public <GroupKey_> UniConstraintStream<GroupKey_> groupBy(Function<A,GroupKey_> groupKeyMapping)

      Specified by:
        `groupBy` in interface `UniConstraintStream<A>`

    - #### groupBy

          public <GroupKey_,ResultContainer_,Result_> BiConstraintStream<GroupKey_,Result_> groupBy(Function<A,GroupKey_> groupKeyMapping,
                                                                                                    UniConstraintCollector<A,ResultContainer_,Result_> collector)

      Specified by:
        `groupBy` in interface `UniConstraintStream<A>`

    - #### groupBy

          public <GroupKeyA_,GroupKeyB_> BiConstraintStream<GroupKeyA_,GroupKeyB_> groupBy(Function<A,GroupKeyA_> groupKeyAMapping,
                                                                                           Function<A,GroupKeyB_> groupKeyBMapping)

      Specified by:
        `groupBy` in interface `UniConstraintStream<A>`

    - #### groupBy

          public <GroupKeyA_,GroupKeyB_,ResultContainer_,Result_> TriConstraintStream<GroupKeyA_,GroupKeyB_,Result_> groupBy(Function<A,GroupKeyA_> groupKeyAMapping,
                                                                                                                             Function<A,GroupKeyB_> groupKeyBMapping,
                                                                                                                             UniConstraintCollector<A,ResultContainer_,Result_> collector)

      Specified by:
        `groupBy` in interface `UniConstraintStream<A>`

    - #### impactScore

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

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

    - #### impactScore

          public final Constraint impactScore(String constraintPackage,
                                              String constraintName,
                                              Score<?> constraintWeight,
                                              ToIntFunction<A> matchWeigher,
                                              boolean positive)

      Specified by:
        `impactScore` in interface `InnerUniConstraintStream<A>`

    - #### impactScoreLong

          public final Constraint impactScoreLong(String constraintPackage,
                                                  String constraintName,
                                                  Score<?> constraintWeight,
                                                  ToLongFunction<A> matchWeigher,
                                                  boolean positive)

      Specified by:
        `impactScoreLong` in interface `InnerUniConstraintStream<A>`

    - #### impactScoreBigDecimal

          public final Constraint impactScoreBigDecimal(String constraintPackage,
                                                        String constraintName,
                                                        Score<?> constraintWeight,
                                                        Function<A,BigDecimal> matchWeigher,
                                                        boolean positive)

      Specified by:
        `impactScoreBigDecimal` in interface `InnerUniConstraintStream<A>`

    - #### impactScoreConfigurable

          public final Constraint impactScoreConfigurable(String constraintPackage,
                                                          String constraintName,
                                                          boolean positive)

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

    - #### impactScoreConfigurable

          public final Constraint impactScoreConfigurable(String constraintPackage,
                                                          String constraintName,
                                                          ToIntFunction<A> matchWeigher,
                                                          boolean positive)

      Specified by:
        `impactScoreConfigurable` in interface `InnerUniConstraintStream<A>`

    - #### impactScoreConfigurableLong

          public final Constraint impactScoreConfigurableLong(String constraintPackage,
                                                              String constraintName,
                                                              ToLongFunction<A> matchWeigher,
                                                              boolean positive)

      Specified by:
        `impactScoreConfigurableLong` in interface `InnerUniConstraintStream<A>`

    - #### impactScoreConfigurableBigDecimal

          public final Constraint impactScoreConfigurableBigDecimal(String constraintPackage,
                                                                    String constraintName,
                                                                    Function<A,BigDecimal> matchWeigher,
                                                                    boolean positive)

      Specified by:
        `impactScoreConfigurableBigDecimal` in interface `InnerUniConstraintStream<A>`

    - #### createNodeChain

          public BavetAbstractUniNode<A> createNodeChain(BavetNodeBuildPolicy<Solution_> buildPolicy,
                                                         Score<?> constraintWeight,
                                                         int nodeOrder,
                                                         BavetAbstractUniNode<A> parentNode)

    - #### processNode

          protected BavetAbstractUniNode<A> processNode(BavetNodeBuildPolicy<Solution_> buildPolicy,
                                                        int nodeOrder,
                                                        BavetAbstractUniNode<A> parentNode,
                                                        BavetAbstractUniNode<A> node)

    - #### createChildNodeChains

          protected void createChildNodeChains(BavetNodeBuildPolicy<Solution_> buildPolicy,
                                               Score<?> constraintWeight,
                                               int nodeOrder,
                                               BavetAbstractUniNode<A> node)

    - #### createNode

          protected abstract BavetAbstractUniNode<A> createNode(BavetNodeBuildPolicy<Solution_> buildPolicy,
                                                                Score<?> constraintWeight,
                                                                int nodeOrder,
                                                                BavetAbstractUniNode<A> parentNode)

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