public abstract class DroolsAbstractUniConstraintStream<Solution_,A> extends DroolsAbstractConstraintStream<Solution_> implements InnerUniConstraintStream<A>
constraintFactory| Constructor and Description |
|---|
DroolsAbstractUniConstraintStream(DroolsConstraintFactory<Solution_> constraintFactory) |
| Modifier and Type | Method and Description |
|---|---|
abstract DroolsUniCondition<A> |
createCondition() |
DroolsAbstractUniConstraintStream<Solution_,A> |
filter(Predicate<A> predicate)
Exhaustively test each fact against the
Predicate
and match if Predicate.test(Object) returns true. |
<GroupKey_> |
groupBy(Function<A,GroupKey_> groupKeyMapping)
Convert the
UniConstraintStream to a different UniConstraintStream, containing of the set of
tuples resulting from applying the group key mapping function on all tuples of the original stream. |
<GroupKey_,ResultContainer_,Result_> |
groupBy(Function<A,GroupKey_> groupKeyMapping,
UniConstraintCollector<A,ResultContainer_,Result_> collector)
Convert the
UniConstraintStream to a BiConstraintStream, consisting of tuples which have:
As the first fact, the value resulting from applying the group key mapping function on the fact from the
original tuple. |
<ResultContainer_,Result_> |
groupBy(UniConstraintCollector<A,ResultContainer_,Result_> collector)
Runs all tuples of the stream through a given @
UniConstraintCollector and converts them into a new
UniConstraintStream which only has a single tuple, the result of applying UniConstraintCollector. |
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). |
addChildStream, buildConstraint, buildConstraintConfigurable, buildRule, getChildStreams, getConstraintFactory, getFromStreamListbuildConstraintWeightExtractor, 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 DroolsAbstractUniConstraintStream(DroolsConstraintFactory<Solution_> constraintFactory)
public DroolsAbstractUniConstraintStream<Solution_,A> filter(Predicate<A> predicate)
UniConstraintStreamPredicate
and match if Predicate.test(Object) returns true.filter in interface UniConstraintStream<A>predicate - never nullpublic <B> BiConstraintStream<A,B> join(UniConstraintStream<B> otherStream, BiJoiner<A,B> joiner)
UniConstraintStreamBiConstraintStream 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.
join in interface UniConstraintStream<A>B - the type of the second matched factotherStream - never nulljoiner - never nullBiJoiner is truepublic <ResultContainer_,Result_> UniConstraintStream<Result_> groupBy(UniConstraintCollector<A,ResultContainer_,Result_> collector)
UniConstraintStreamUniConstraintCollector and converts them into a new
UniConstraintStream which only has a single tuple, the result of applying UniConstraintCollector.groupBy in interface UniConstraintStream<A>ResultContainer_ - the mutable accumulation type (often hidden as an implementation detail)Result_ - the type of a fact in the destination UniConstraintStream's tuplecollector - never null, the collector to perform the grouping operation withpublic <GroupKey_> UniConstraintStream<GroupKey_> groupBy(Function<A,GroupKey_> groupKeyMapping)
UniConstraintStreamUniConstraintStream to a different UniConstraintStream, containing of the set of
tuples resulting from applying the group key mapping function on all tuples of the original stream.
Neither tuple of the new stream will Objects.equals(Object, Object) any other.groupBy in interface UniConstraintStream<A>GroupKey_ - the type of a fact in the destination UniConstraintStream's tuplegroupKeyMapping - never null, mapping function to convert each element in the stream to a different elementpublic <GroupKey_,ResultContainer_,Result_> BiConstraintStream<GroupKey_,Result_> groupBy(Function<A,GroupKey_> groupKeyMapping, UniConstraintCollector<A,ResultContainer_,Result_> collector)
UniConstraintStreamUniConstraintStream to a BiConstraintStream, consisting of tuples which have:
Objects.equals(Object, Object) any other.UniConstraintCollector on all the facts of the
original tuple with a matching group key.groupBy in interface UniConstraintStream<A>GroupKey_ - the type of the first fact in the destination BiConstraintStream's tupleResultContainer_ - the mutable accumulation type (often hidden as an implementation detail)Result_ - the type of the second fact in the destination BiConstraintStream's tuplegroupKeyMapping - never null, function to convert a fact in original tuple to a different factpublic 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, ToIntFunction<A> matchWeigher, boolean positive)
impactScore in interface InnerUniConstraintStream<A>public final Constraint impactScoreLong(String constraintPackage, String constraintName, Score<?> constraintWeight, ToLongFunction<A> matchWeigher, boolean positive)
impactScoreLong in interface InnerUniConstraintStream<A>public final Constraint impactScoreBigDecimal(String constraintPackage, String constraintName, Score<?> constraintWeight, Function<A,BigDecimal> matchWeigher, boolean positive)
impactScoreBigDecimal in interface InnerUniConstraintStream<A>public final Constraint impactScoreConfigurable(String constraintPackage, String constraintName, boolean positive)
impactScoreConfigurable in class AbstractConstraintStream<Solution_>public final Constraint impactScoreConfigurable(String constraintPackage, String constraintName, ToIntFunction<A> matchWeigher, boolean positive)
impactScoreConfigurable in interface InnerUniConstraintStream<A>public final Constraint impactScoreConfigurableLong(String constraintPackage, String constraintName, ToLongFunction<A> matchWeigher, boolean positive)
impactScoreConfigurableLong in interface InnerUniConstraintStream<A>public final Constraint impactScoreConfigurableBigDecimal(String constraintPackage, String constraintName, Function<A,BigDecimal> matchWeigher, boolean positive)
impactScoreConfigurableBigDecimal in interface InnerUniConstraintStream<A>public abstract DroolsUniCondition<A> createCondition()
Copyright © 2006–2019 JBoss by Red Hat. All rights reserved.