public abstract class DroolsAbstractTriConstraintStream<Solution_,A,B,C> extends DroolsAbstractConstraintStream<Solution_> implements InnerTriConstraintStream<A,B,C>
Modifier and Type | Field and Description |
---|---|
protected DroolsAbstractTriConstraintStream<Solution_,A,B,C> |
parent |
constraintFactory
Constructor and Description |
---|
DroolsAbstractTriConstraintStream(DroolsConstraintFactory<Solution_> constraintFactory,
DroolsAbstractTriConstraintStream<Solution_,A,B,C> parent) |
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). |
addChildStream, buildConstraint, buildConstraintConfigurable, createRuleItemBuilders, getChildStreams, getConstraintFactory
buildConstraintWeightExtractor, buildConstraintWeightExtractor, penalize, penalizeConfigurable, reward, rewardConfigurable, validateConstraintId
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
penalize, penalizeBigDecimal, penalizeConfigurable, penalizeConfigurableBigDecimal, penalizeConfigurableLong, penalizeLong, reward, rewardBigDecimal, rewardConfigurable, rewardConfigurableBigDecimal, rewardConfigurableLong, rewardLong
join, join, join, join, join, join, join, penalize, penalizeBigDecimal, penalizeConfigurable, penalizeConfigurableBigDecimal, penalizeConfigurableLong, penalizeLong, reward, rewardBigDecimal, rewardConfigurable, rewardConfigurableBigDecimal, rewardConfigurableLong, rewardLong
getConstraintFactory, penalize, penalize, penalizeConfigurable, penalizeConfigurable, reward, reward, rewardConfigurable, rewardConfigurable
protected final DroolsAbstractTriConstraintStream<Solution_,A,B,C> parent
public DroolsAbstractTriConstraintStream(DroolsConstraintFactory<Solution_> constraintFactory, DroolsAbstractTriConstraintStream<Solution_,A,B,C> parent)
public TriConstraintStream<A,B,C> filter(TriPredicate<A,B,C> predicate)
TriConstraintStream
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.
filter
in interface TriConstraintStream<A,B,C>
predicate
- never nullpublic <D> QuadConstraintStream<A,B,C,D> join(UniConstraintStream<D> otherStream, QuadJoiner<A,B,C,D> joiner)
TriConstraintStream
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.
join
in interface TriConstraintStream<A,B,C>
D
- the type of the fourth matched factotherStream
- never nulljoiner
- never nullQuadJoiner
is trueprotected Constraint impactScore(String constraintPackage, String constraintName, Score<?> constraintWeight, boolean positive)
impactScore
in class AbstractConstraintStream<Solution_>
public Constraint impactScore(String constraintPackage, String constraintName, Score<?> constraintWeight, ToIntTriFunction<A,B,C> matchWeigher, boolean positive)
impactScore
in interface InnerTriConstraintStream<A,B,C>
public Constraint impactScoreLong(String constraintPackage, String constraintName, Score<?> constraintWeight, ToLongTriFunction<A,B,C> matchWeigher, boolean positive)
impactScoreLong
in interface InnerTriConstraintStream<A,B,C>
public Constraint impactScoreBigDecimal(String constraintPackage, String constraintName, Score<?> constraintWeight, TriFunction<A,B,C,BigDecimal> matchWeigher, boolean positive)
impactScoreBigDecimal
in interface InnerTriConstraintStream<A,B,C>
protected Constraint impactScoreConfigurable(String constraintPackage, String constraintName, boolean positive)
impactScoreConfigurable
in class AbstractConstraintStream<Solution_>
public Constraint impactScoreConfigurable(String constraintPackage, String constraintName, ToIntTriFunction<A,B,C> matchWeigher, boolean positive)
impactScoreConfigurable
in interface InnerTriConstraintStream<A,B,C>
public Constraint impactScoreConfigurableLong(String constraintPackage, String constraintName, ToLongTriFunction<A,B,C> matchWeigher, boolean positive)
impactScoreConfigurableLong
in interface InnerTriConstraintStream<A,B,C>
public Constraint impactScoreConfigurableBigDecimal(String constraintPackage, String constraintName, TriFunction<A,B,C,BigDecimal> matchWeigher, boolean positive)
impactScoreConfigurableBigDecimal
in interface InnerTriConstraintStream<A,B,C>
public List<DroolsFromUniConstraintStream<Solution_,Object>> getFromStreamList()
getFromStreamList
in class DroolsAbstractConstraintStream<Solution_>
public abstract DroolsTriCondition<A,B,C> getCondition()
Copyright © 2006–2019 JBoss by Red Hat. All rights reserved.