public abstract class DroolsAbstractBiConstraintStream<Solution_,A,B> extends DroolsAbstractConstraintStream<Solution_> implements InnerBiConstraintStream<A,B>
constraintFactory| Constructor and Description |
|---|
DroolsAbstractBiConstraintStream(DroolsConstraintFactory<Solution_> constraintFactory) |
| Modifier and Type | Method and Description |
|---|---|
abstract DroolsBiCondition<A,B> |
createCondition() |
BiConstraintStream<A,B> |
filter(BiPredicate<A,B> predicate)
Exhaustively test each tuple of facts against the
BiPredicate
and match if BiPredicate.test(Object, Object) returns true. |
List<DroolsFromUniConstraintStream<Solution_,Object>> |
getFromStreamList() |
protected abstract DroolsAbstractConstraintStream<Solution_> |
getParent() |
Constraint |
impactScore(String constraintPackage,
String constraintName,
Score<?> constraintWeight,
boolean positive) |
Constraint |
impactScore(String constraintPackage,
String constraintName,
Score<?> constraintWeight,
ToIntBiFunction<A,B> matchWeigher,
boolean positive) |
Constraint |
impactScoreBigDecimal(String constraintPackage,
String constraintName,
Score<?> constraintWeight,
BiFunction<A,B,BigDecimal> matchWeigher,
boolean positive) |
Constraint |
impactScoreConfigurable(String constraintPackage,
String constraintName,
boolean positive) |
Constraint |
impactScoreConfigurable(String constraintPackage,
String constraintName,
ToIntBiFunction<A,B> matchWeigher,
boolean positive) |
Constraint |
impactScoreConfigurableBigDecimal(String constraintPackage,
String constraintName,
BiFunction<A,B,BigDecimal> matchWeigher,
boolean positive) |
Constraint |
impactScoreConfigurableLong(String constraintPackage,
String constraintName,
ToLongBiFunction<A,B> matchWeigher,
boolean positive) |
Constraint |
impactScoreLong(String constraintPackage,
String constraintName,
Score<?> constraintWeight,
ToLongBiFunction<A,B> matchWeigher,
boolean positive) |
<C> TriConstraintStream<A,B,C> |
join(UniConstraintStream<C> otherStream,
TriJoiner<A,B,C> joiner)
Create a new
TriConstraintStream for every combination of [A, B] and C for which the BiJoiner
is true (for the properties it extracts from both facts). |
addChildStream, buildConstraint, buildConstraintConfigurable, buildRule, getChildStreams, getConstraintFactorybuildConstraintWeightExtractor, buildConstraintWeightExtractor, penalize, penalizeConfigurable, reward, rewardConfigurable, validateConstraintIdclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpenalize, penalizeBigDecimal, penalizeConfigurable, penalizeConfigurableBigDecimal, penalizeConfigurableLong, penalizeLong, reward, rewardBigDecimal, rewardConfigurable, rewardConfigurableBigDecimal, rewardConfigurableLong, rewardLongjoin, join, join, join, join, join, join, penalize, penalizeBigDecimal, penalizeConfigurable, penalizeConfigurableBigDecimal, penalizeConfigurableLong, penalizeLong, reward, rewardBigDecimal, rewardConfigurable, rewardConfigurableBigDecimal, rewardConfigurableLong, rewardLonggetConstraintFactory, penalize, penalize, penalizeConfigurable, penalizeConfigurable, reward, reward, rewardConfigurable, rewardConfigurablepublic DroolsAbstractBiConstraintStream(DroolsConstraintFactory<Solution_> constraintFactory)
public BiConstraintStream<A,B> filter(BiPredicate<A,B> predicate)
BiConstraintStreamBiPredicate
and match if BiPredicate.test(Object, Object) returns true.
Important: This is slower and less scalable than UniConstraintStream#join(UniConstraintStream, BiJoiner[])
with a proper BiJoiner predicate (such as Joiners.equal(Function, Function),
because the latter applies hashing and/or indexing, so it doesn't create every combination just to filter it out.
filter in interface BiConstraintStream<A,B>predicate - never nullpublic <C> TriConstraintStream<A,B,C> join(UniConstraintStream<C> otherStream, TriJoiner<A,B,C> joiner)
BiConstraintStreamTriConstraintStream for every combination of [A, B] and C 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, B] and C.
join in interface BiConstraintStream<A,B>C - the type of the third matched factotherStream - never nulljoiner - never nullBiJoiner is truepublic final Constraint impactScore(String constraintPackage, String constraintName, Score<?> constraintWeight, boolean positive)
impactScore in class AbstractConstraintStream<Solution_>public final Constraint impactScore(String constraintPackage, String constraintName, Score<?> constraintWeight, ToIntBiFunction<A,B> matchWeigher, boolean positive)
impactScore in interface InnerBiConstraintStream<A,B>public final Constraint impactScoreLong(String constraintPackage, String constraintName, Score<?> constraintWeight, ToLongBiFunction<A,B> matchWeigher, boolean positive)
impactScoreLong in interface InnerBiConstraintStream<A,B>public final Constraint impactScoreBigDecimal(String constraintPackage, String constraintName, Score<?> constraintWeight, BiFunction<A,B,BigDecimal> matchWeigher, boolean positive)
impactScoreBigDecimal in interface InnerBiConstraintStream<A,B>public final Constraint impactScoreConfigurable(String constraintPackage, String constraintName, boolean positive)
impactScoreConfigurable in class AbstractConstraintStream<Solution_>public final Constraint impactScoreConfigurable(String constraintPackage, String constraintName, ToIntBiFunction<A,B> matchWeigher, boolean positive)
impactScoreConfigurable in interface InnerBiConstraintStream<A,B>public final Constraint impactScoreConfigurableLong(String constraintPackage, String constraintName, ToLongBiFunction<A,B> matchWeigher, boolean positive)
impactScoreConfigurableLong in interface InnerBiConstraintStream<A,B>public final Constraint impactScoreConfigurableBigDecimal(String constraintPackage, String constraintName, BiFunction<A,B,BigDecimal> matchWeigher, boolean positive)
impactScoreConfigurableBigDecimal in interface InnerBiConstraintStream<A,B>public List<DroolsFromUniConstraintStream<Solution_,Object>> getFromStreamList()
getFromStreamList in class DroolsAbstractConstraintStream<Solution_>protected abstract DroolsAbstractConstraintStream<Solution_> getParent()
public abstract DroolsBiCondition<A,B> createCondition()
Copyright © 2006–2019 JBoss by Red Hat. All rights reserved.