public abstract class BavetAbstractTriConstraintStream<Solution_,A,B,C> extends BavetAbstractConstraintStream<Solution_> implements InnerTriConstraintStream<A,B,C>
| Modifier and Type | Field and Description |
|---|---|
protected List<BavetAbstractTriConstraintStream<Solution_,A,B,C>> |
childStreamList |
constraintFactory| Constructor and Description |
|---|
BavetAbstractTriConstraintStream(BavetConstraintFactory<Solution_> constraintFactory) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addChildStream(BavetAbstractTriConstraintStream<Solution_,A,B,C> childStream) |
protected void |
createChildNodeChains(BavetNodeBuildPolicy<Solution_> buildPolicy,
Score<?> constraintWeight,
int nodeOrder,
BavetAbstractTriNode<A,B,C> node) |
protected abstract BavetAbstractTriNode<A,B,C> |
createNode(BavetNodeBuildPolicy<Solution_> buildPolicy,
Score<?> constraintWeight,
int nodeOrder,
BavetAbstractTriNode<A,B,C> parentNode) |
BavetAbstractTriNode<A,B,C> |
createNodeChain(BavetNodeBuildPolicy<Solution_> buildPolicy,
Score<?> constraintWeight,
int nodeOrder,
BavetAbstractTriNode<A,B,C> parentNode) |
BavetAbstractTriConstraintStream<Solution_,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. |
int |
getCardinality() |
<ResultContainer_,Result_> |
groupBy(TriConstraintCollector<A,B,C,ResultContainer_,Result_> collector)
Convert the
TriConstraintStream to a UniConstraintStream, containing only a single tuple, the
result of applying TriConstraintCollector. |
<GroupKey_> |
groupBy(TriFunction<A,B,C,GroupKey_> groupKeyMapping)
Convert the
TriConstraintStream to a UniConstraintStream, containing the set of tuples resulting
from applying the group key mapping function on all tuples of the original stream. |
<GroupKey_,ResultContainer_,Result_> |
groupBy(TriFunction<A,B,C,GroupKey_> groupKeyMapping,
TriConstraintCollector<A,B,C,ResultContainer_,Result_> collector)
Convert the
TriConstraintStream to a BiConstraintStream, consisting of unique tuples. |
<GroupKeyA_,GroupKeyB_> |
groupBy(TriFunction<A,B,C,GroupKeyA_> groupKeyAMapping,
TriFunction<A,B,C,GroupKeyB_> groupKeyBMapping)
Convert the
TriConstraintStream to a BiConstraintStream, consisting of unique tuples. |
<GroupKeyA_,GroupKeyB_,ResultContainer_,Result_> |
groupBy(TriFunction<A,B,C,GroupKeyA_> groupKeyAMapping,
TriFunction<A,B,C,GroupKeyB_> groupKeyBMapping,
TriConstraintCollector<A,B,C,ResultContainer_,Result_> collector)
Combines the semantics of
TriConstraintStream.groupBy(TriFunction, TriFunction) and TriConstraintStream.groupBy(TriConstraintCollector). |
<GroupKeyA_,GroupKeyB_,ResultContainerC_,ResultC_,ResultContainerD_,ResultD_> |
groupBy(TriFunction<A,B,C,GroupKeyA_> groupKeyAMapping,
TriFunction<A,B,C,GroupKeyB_> groupKeyBMapping,
TriConstraintCollector<A,B,C,ResultContainerC_,ResultC_> collectorC,
TriConstraintCollector<A,B,C,ResultContainerD_,ResultD_> collectorD)
Combines the semantics of
TriConstraintStream.groupBy(TriFunction, TriFunction) and TriConstraintStream.groupBy(TriConstraintCollector). |
<D> TriConstraintStream<A,B,C> |
ifExists(Class<D> otherClass,
QuadJoiner<A,B,C,D>... joiners)
As defined by
TriConstraintStream.ifExists(Class, QuadJoiner). |
<D> TriConstraintStream<A,B,C> |
ifNotExists(Class<D> otherClass,
QuadJoiner<A,B,C,D>... joiners)
As defined by
TriConstraintStream.ifNotExists(Class, QuadJoiner). |
Constraint |
impactScore(String constraintPackage,
String constraintName,
Score<?> constraintWeight,
ScoreImpactType impactType) |
Constraint |
impactScore(String constraintPackage,
String constraintName,
Score<?> constraintWeight,
ToIntTriFunction<A,B,C> matchWeigher,
ScoreImpactType impactType) |
Constraint |
impactScoreBigDecimal(String constraintPackage,
String constraintName,
Score<?> constraintWeight,
TriFunction<A,B,C,BigDecimal> matchWeigher,
ScoreImpactType impactType) |
Constraint |
impactScoreConfigurable(String constraintPackage,
String constraintName,
ScoreImpactType impactType) |
Constraint |
impactScoreConfigurable(String constraintPackage,
String constraintName,
ToIntTriFunction<A,B,C> matchWeigher,
ScoreImpactType impactType) |
Constraint |
impactScoreConfigurableBigDecimal(String constraintPackage,
String constraintName,
TriFunction<A,B,C,BigDecimal> matchWeigher,
ScoreImpactType impactType) |
Constraint |
impactScoreConfigurableLong(String constraintPackage,
String constraintName,
ToLongTriFunction<A,B,C> matchWeigher,
ScoreImpactType impactType) |
Constraint |
impactScoreLong(String constraintPackage,
String constraintName,
Score<?> constraintWeight,
ToLongTriFunction<A,B,C> matchWeigher,
ScoreImpactType impactType) |
<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). |
protected BavetAbstractTriNode<A,B,C> |
processNode(BavetNodeBuildPolicy<Solution_> buildPolicy,
int nodeOrder,
BavetAbstractTriNode<A,B,C> parentNode,
BavetAbstractTriNode<A,B,C> node) |
buildConstraint, buildConstraintConfigurable, getConstraintFactory, getFromStreamListbuildConstraintWeightExtractor, buildConstraintWeightExtractor, impact, penalize, penalizeConfigurable, reward, rewardConfigurableclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitimpact, impactBigDecimal, impactConfigurable, impactConfigurableBigDecimal, impactConfigurableLong, impactLong, penalize, penalizeBigDecimal, penalizeConfigurable, penalizeConfigurableBigDecimal, penalizeConfigurableLong, penalizeLong, reward, rewardBigDecimal, rewardConfigurable, rewardConfigurableBigDecimal, rewardConfigurableLong, rewardLongifExists, ifExists, ifExists, ifExists, ifNotExists, ifNotExists, ifNotExists, ifNotExists, impact, impactBigDecimal, impactConfigurable, impactConfigurableBigDecimal, impactConfigurableLong, impactLong, join, join, join, join, join, join, join, penalize, penalizeBigDecimal, penalizeConfigurable, penalizeConfigurableBigDecimal, penalizeConfigurableLong, penalizeLong, reward, rewardBigDecimal, rewardConfigurable, rewardConfigurableBigDecimal, rewardConfigurableLong, rewardLonggetConstraintFactory, impact, impact, penalize, penalize, penalizeConfigurable, penalizeConfigurable, reward, reward, rewardConfigurable, rewardConfigurablepublic BavetAbstractTriConstraintStream(BavetConstraintFactory<Solution_> constraintFactory)
protected void addChildStream(BavetAbstractTriConstraintStream<Solution_,A,B,C> childStream)
public int getCardinality()
getCardinality in class AbstractConstraintStream<Solution_>public BavetAbstractTriConstraintStream<Solution_,A,B,C> filter(TriPredicate<A,B,C> predicate)
TriConstraintStreamTriPredicate
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)
TriConstraintStreamQuadConstraintStream 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 true@SafeVarargs public final <D> TriConstraintStream<A,B,C> ifExists(Class<D> otherClass, QuadJoiner<A,B,C,D>... joiners)
TriConstraintStreamTriConstraintStream.ifExists(Class, QuadJoiner). For performance reasons, indexing joiners must be placed
before filtering joiners.
This method causes Unchecked generics array creation for varargs parameter warnings,
but we can't fix it with a SafeVarargs annotation because it's an interface method.
Therefore, there are overloaded methods with up to 4 QuadJoiner parameters.
ifExists in interface TriConstraintStream<A,B,C>D - the type of the fourth matched factotherClass - never nulljoiners - never nullQuadJoiners are true@SafeVarargs public final <D> TriConstraintStream<A,B,C> ifNotExists(Class<D> otherClass, QuadJoiner<A,B,C,D>... joiners)
TriConstraintStreamTriConstraintStream.ifNotExists(Class, QuadJoiner). For performance reasons, indexing joiners must be placed
before filtering joiners.
This method causes Unchecked generics array creation for varargs parameter warnings,
but we can't fix it with a SafeVarargs annotation because it's an interface method.
Therefore, there are overloaded methods with up to 4 QuadJoiner parameters.
ifNotExists in interface TriConstraintStream<A,B,C>D - the type of the fourth matched factotherClass - never nulljoiners - never nullQuadJoiners are truepublic <ResultContainer_,Result_> UniConstraintStream<Result_> groupBy(TriConstraintCollector<A,B,C,ResultContainer_,Result_> collector)
TriConstraintStreamTriConstraintStream to a UniConstraintStream, containing only a single tuple, the
result of applying TriConstraintCollector.groupBy in interface TriConstraintStream<A,B,C>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 with
See ConstraintCollectors for common operations, such as count(), sum() and others.public <GroupKey_> UniConstraintStream<GroupKey_> groupBy(TriFunction<A,B,C,GroupKey_> groupKeyMapping)
TriConstraintStreamTriConstraintStream to a UniConstraintStream, containing 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 Objects.equals(Object, Object) any other.groupBy in interface TriConstraintStream<A,B,C>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(TriFunction<A,B,C,GroupKey_> groupKeyMapping, TriConstraintCollector<A,B,C,ResultContainer_,Result_> collector)
TriConstraintStreamTriConstraintStream to a BiConstraintStream, consisting of unique tuples.
The first fact is the return value of the first group key mapping function, applied on the incoming tuple.
The second fact is the return value of a given TriConstraintCollector applied on all incoming tuples with
the same first fact.
groupBy in interface TriConstraintStream<A,B,C>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 the fact in the original tuple to a different factcollector - never null, the collector to perform the grouping operation with
See ConstraintCollectors for common operations, such as count(), sum() and others.public <GroupKeyA_,GroupKeyB_> BiConstraintStream<GroupKeyA_,GroupKeyB_> groupBy(TriFunction<A,B,C,GroupKeyA_> groupKeyAMapping, TriFunction<A,B,C,GroupKeyB_> groupKeyBMapping)
TriConstraintStreamTriConstraintStream to a BiConstraintStream, consisting of unique tuples.
The first fact is the return value of the first group key mapping function, applied on the incoming tuple. The second fact is the return value of the second group key mapping function, applied on all incoming tuples with the same first fact.
groupBy in interface TriConstraintStream<A,B,C>GroupKeyA_ - the type of the first fact in the destination BiConstraintStream's tupleGroupKeyB_ - the type of the second fact in the destination BiConstraintStream's tuplegroupKeyAMapping - never null, function to convert the facts in the original tuple to a new factgroupKeyBMapping - never null, function to convert the facts in the original tuple to another new factpublic <GroupKeyA_,GroupKeyB_,ResultContainer_,Result_> TriConstraintStream<GroupKeyA_,GroupKeyB_,Result_> groupBy(TriFunction<A,B,C,GroupKeyA_> groupKeyAMapping, TriFunction<A,B,C,GroupKeyB_> groupKeyBMapping, TriConstraintCollector<A,B,C,ResultContainer_,Result_> collector)
TriConstraintStreamTriConstraintStream.groupBy(TriFunction, TriFunction) and TriConstraintStream.groupBy(TriConstraintCollector).
That is, the first and second facts in the tuple follow the TriConstraintStream.groupBy(TriFunction, TriFunction) semantics,
and the third fact is the result of applying TriConstraintCollector.finisher() on all the tuples of the
original UniConstraintStream that belong to the group.groupBy in interface TriConstraintStream<A,B,C>GroupKeyA_ - the type of the first fact in the destination TriConstraintStream's tupleGroupKeyB_ - the type of the second fact in the destination TriConstraintStream's tupleResultContainer_ - the mutable accumulation type (often hidden as an implementation detail)Result_ - the type of the third fact in the destination TriConstraintStream's tuplegroupKeyAMapping - never null, function to convert the original tuple into a first factgroupKeyBMapping - never null, function to convert the original tuple into a second factcollector - never null, the collector to perform the grouping operation with
See ConstraintCollectors for common operations, such as count(), sum() and others.public <GroupKeyA_,GroupKeyB_,ResultContainerC_,ResultC_,ResultContainerD_,ResultD_> QuadConstraintStream<GroupKeyA_,GroupKeyB_,ResultC_,ResultD_> groupBy(TriFunction<A,B,C,GroupKeyA_> groupKeyAMapping, TriFunction<A,B,C,GroupKeyB_> groupKeyBMapping, TriConstraintCollector<A,B,C,ResultContainerC_,ResultC_> collectorC, TriConstraintCollector<A,B,C,ResultContainerD_,ResultD_> collectorD)
TriConstraintStreamTriConstraintStream.groupBy(TriFunction, TriFunction) and TriConstraintStream.groupBy(TriConstraintCollector).
That is, the first and second facts in the tuple follow the TriConstraintStream.groupBy(TriFunction, TriFunction) semantics.
The third fact is the result of applying the first TriConstraintCollector.finisher() on all the tuples
of the original TriConstraintStream that belong to the group.
The fourth fact is the result of applying the second TriConstraintCollector.finisher() on all the tuples
of the original TriConstraintStream that belong to the groupgroupBy in interface TriConstraintStream<A,B,C>GroupKeyA_ - the type of the first fact in the destination QuadConstraintStream's tupleGroupKeyB_ - the type of the second fact in the destination QuadConstraintStream's tupleResultContainerC_ - the mutable accumulation type (often hidden as an implementation detail)ResultC_ - the type of the third fact in the destination QuadConstraintStream's tupleResultContainerD_ - the mutable accumulation type (often hidden as an implementation detail)ResultD_ - the type of the fourth fact in the destination QuadConstraintStream's tuplegroupKeyAMapping - never null, function to convert the original tuple into a first factgroupKeyBMapping - never null, function to convert the original tuple into a second factcollectorC - never null, the collector to perform the first grouping operation with
See ConstraintCollectors for common operations, such as count(), sum() and others.collectorD - never null, the collector to perform the second grouping operation with
See ConstraintCollectors for common operations, such as count(), sum() and others.public final Constraint impactScore(String constraintPackage, String constraintName, Score<?> constraintWeight, ScoreImpactType impactType)
impactScore in class AbstractConstraintStream<Solution_>public final Constraint impactScore(String constraintPackage, String constraintName, Score<?> constraintWeight, ToIntTriFunction<A,B,C> matchWeigher, ScoreImpactType impactType)
impactScore in interface InnerTriConstraintStream<A,B,C>public final Constraint impactScoreLong(String constraintPackage, String constraintName, Score<?> constraintWeight, ToLongTriFunction<A,B,C> matchWeigher, ScoreImpactType impactType)
impactScoreLong in interface InnerTriConstraintStream<A,B,C>public final Constraint impactScoreBigDecimal(String constraintPackage, String constraintName, Score<?> constraintWeight, TriFunction<A,B,C,BigDecimal> matchWeigher, ScoreImpactType impactType)
impactScoreBigDecimal in interface InnerTriConstraintStream<A,B,C>public final Constraint impactScoreConfigurable(String constraintPackage, String constraintName, ScoreImpactType impactType)
impactScoreConfigurable in class AbstractConstraintStream<Solution_>public final Constraint impactScoreConfigurable(String constraintPackage, String constraintName, ToIntTriFunction<A,B,C> matchWeigher, ScoreImpactType impactType)
impactScoreConfigurable in interface InnerTriConstraintStream<A,B,C>public final Constraint impactScoreConfigurableLong(String constraintPackage, String constraintName, ToLongTriFunction<A,B,C> matchWeigher, ScoreImpactType impactType)
impactScoreConfigurableLong in interface InnerTriConstraintStream<A,B,C>public final Constraint impactScoreConfigurableBigDecimal(String constraintPackage, String constraintName, TriFunction<A,B,C,BigDecimal> matchWeigher, ScoreImpactType impactType)
impactScoreConfigurableBigDecimal in interface InnerTriConstraintStream<A,B,C>public BavetAbstractTriNode<A,B,C> createNodeChain(BavetNodeBuildPolicy<Solution_> buildPolicy, Score<?> constraintWeight, int nodeOrder, BavetAbstractTriNode<A,B,C> parentNode)
protected BavetAbstractTriNode<A,B,C> processNode(BavetNodeBuildPolicy<Solution_> buildPolicy, int nodeOrder, BavetAbstractTriNode<A,B,C> parentNode, BavetAbstractTriNode<A,B,C> node)
protected void createChildNodeChains(BavetNodeBuildPolicy<Solution_> buildPolicy, Score<?> constraintWeight, int nodeOrder, BavetAbstractTriNode<A,B,C> node)
protected abstract BavetAbstractTriNode<A,B,C> createNode(BavetNodeBuildPolicy<Solution_> buildPolicy, Score<?> constraintWeight, int nodeOrder, BavetAbstractTriNode<A,B,C> parentNode)
Copyright © 2006–2021 JBoss by Red Hat. All rights reserved.