Class BavetAbstractUniConstraintStream<Solution_,A>
- All Implemented Interfaces:
ConstraintStream,UniConstraintStream<A>,InnerUniConstraintStream<A>
- Direct Known Subclasses:
BavetAftBridgeUniConstraintStream,BavetForEachUniConstraintStream,BavetForeBridgeUniConstraintStream,BavetUniConcatUniConstraintStream
-
Field Summary
Fields inherited from class ai.timefold.solver.core.impl.score.stream.bavet.common.BavetAbstractConstraintStream
childStreamList, constraintFactory, parent -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBavetAbstractUniConstraintStream(BavetConstraintFactory<Solution_> constraintFactory, BavetAbstractConstraintStream<Solution_> parent) protectedBavetAbstractUniConstraintStream(BavetConstraintFactory<Solution_> constraintFactory, RetrievalSemantics retrievalSemantics) -
Method Summary
Modifier and TypeMethodDescription<B> BiConstraintStream<A,B> concat(BiConstraintStream<A, B> otherStream, Function<A, B> paddingFunction) Returns a newBiConstraintStreamcontaining all the tuples of both thisUniConstraintStreamand the providedBiConstraintStream.<B,C, D> QuadConstraintStream<A, B, C, D> concat(QuadConstraintStream<A, B, C, D> otherStream, Function<A, B> paddingFunctionB, Function<A, C> paddingFunctionC, Function<A, D> paddingFunctionD) Returns a newQuadConstraintStreamcontaining all the tuples of both thisUniConstraintStreamand the providedQuadConstraintStream.<B,C> TriConstraintStream<A, B, C> concat(TriConstraintStream<A, B, C> otherStream, Function<A, B> paddingFunctionB, Function<A, C> paddingFunctionC) Returns a newTriConstraintStreamcontaining all the tuples of both thisUniConstraintStreamand the providedTriConstraintStream.concat(UniConstraintStream<A> otherStream) Returns a newUniConstraintStreamcontaining all the tuples of both thisUniConstraintStreamand the providedUniConstraintStream.distinct()Transforms the stream in such a way that all the tuples going through it are distinct.<ResultB_> BiConstraintStream<A,ResultB_> Adds a fact to the end of the tuple, increasing the cardinality of the stream.<ResultB_,ResultC_>
TriConstraintStream<A,ResultB_, ResultC_> Adds two facts to the end of the tuple, increasing the cardinality of the stream.<ResultB_,ResultC_, ResultD_>
QuadConstraintStream<A,ResultB_, ResultC_, ResultD_> Adds three facts to the end of the tuple, increasing the cardinality of the stream.Exhaustively test each fact against thePredicateand match ifPredicate.test(Object)returns true.<ResultA_> UniConstraintStream<ResultA_>flattenLast(Function<A, Iterable<ResultA_>> mapping) Takes each tuple and applies a mapping on it, which turns the tuple into aIterable.protected final Function<A,Collection<?>> protected final BiFunction<A,Score<?>, DefaultConstraintJustification> <ResultContainer_,Result_>
UniConstraintStream<Result_>groupBy(UniConstraintCollector<A, ResultContainer_, Result_> collector) Convert theUniConstraintStreamto a differentUniConstraintStream, containing only a single tuple, the result of applyingUniConstraintCollector.<ResultContainerA_,ResultA_, ResultContainerB_, ResultB_>
BiConstraintStream<ResultA_,ResultB_> groupBy(UniConstraintCollector<A, ResultContainerA_, ResultA_> collectorA, UniConstraintCollector<A, ResultContainerB_, ResultB_> collectorB) Convert theUniConstraintStreamto aBiConstraintStream, containing only a single tuple, the result of applying twoUniConstraintCollectors.<ResultContainerA_,ResultA_, ResultContainerB_, ResultB_, ResultContainerC_, ResultC_>
TriConstraintStream<ResultA_,ResultB_, ResultC_> groupBy(UniConstraintCollector<A, ResultContainerA_, ResultA_> collectorA, UniConstraintCollector<A, ResultContainerB_, ResultB_> collectorB, UniConstraintCollector<A, ResultContainerC_, ResultC_> collectorC) Convert theUniConstraintStreamto aTriConstraintStream, containing only a single tuple, the result of applying threeUniConstraintCollectors.<ResultContainerA_,ResultA_, ResultContainerB_, ResultB_, ResultContainerC_, ResultC_, ResultContainerD_, ResultD_>
QuadConstraintStream<ResultA_,ResultB_, ResultC_, ResultD_> groupBy(UniConstraintCollector<A, ResultContainerA_, ResultA_> collectorA, UniConstraintCollector<A, ResultContainerB_, ResultB_> collectorB, UniConstraintCollector<A, ResultContainerC_, ResultC_> collectorC, UniConstraintCollector<A, ResultContainerD_, ResultD_> collectorD) Convert theUniConstraintStreamto aQuadConstraintStream, containing only a single tuple, the result of applying fourUniConstraintCollectors.<GroupKey_>
UniConstraintStream<GroupKey_>Convert theUniConstraintStreamto a differentUniConstraintStream, containing the set of tuples resulting from applying the group key mapping function on all tuples of the original stream.<GroupKey_,ResultContainer_, Result_>
BiConstraintStream<GroupKey_,Result_> groupBy(Function<A, GroupKey_> groupKeyMapping, UniConstraintCollector<A, ResultContainer_, Result_> collector) Convert theUniConstraintStreamto aBiConstraintStream, consisting of unique tuples with two facts.<GroupKey_,ResultContainerB_, ResultB_, ResultContainerC_, ResultC_>
TriConstraintStream<GroupKey_,ResultB_, ResultC_> groupBy(Function<A, GroupKey_> groupKeyMapping, UniConstraintCollector<A, ResultContainerB_, ResultB_> collectorB, UniConstraintCollector<A, ResultContainerC_, ResultC_> collectorC) Convert theUniConstraintStreamto aTriConstraintStream, consisting of unique tuples with three facts.<GroupKey_,ResultContainerB_, ResultB_, ResultContainerC_, ResultC_, ResultContainerD_, ResultD_>
QuadConstraintStream<GroupKey_,ResultB_, ResultC_, ResultD_> groupBy(Function<A, GroupKey_> groupKeyMapping, UniConstraintCollector<A, ResultContainerB_, ResultB_> collectorB, UniConstraintCollector<A, ResultContainerC_, ResultC_> collectorC, UniConstraintCollector<A, ResultContainerD_, ResultD_> collectorD) Convert theUniConstraintStreamto aQuadConstraintStream, consisting of unique tuples with four facts.<GroupKeyA_,GroupKeyB_>
BiConstraintStream<GroupKeyA_,GroupKeyB_> Convert theUniConstraintStreamto aBiConstraintStream, consisting of unique tuples with two facts.<GroupKeyA_,GroupKeyB_, ResultContainer_, Result_>
TriConstraintStream<GroupKeyA_,GroupKeyB_, Result_> groupBy(Function<A, GroupKeyA_> groupKeyAMapping, Function<A, GroupKeyB_> groupKeyBMapping, UniConstraintCollector<A, ResultContainer_, Result_> collector) Combines the semantics ofUniConstraintStream.groupBy(Function, Function)andUniConstraintStream.groupBy(UniConstraintCollector).<GroupKeyA_,GroupKeyB_, ResultContainerC_, ResultC_, ResultContainerD_, ResultD_>
QuadConstraintStream<GroupKeyA_,GroupKeyB_, ResultC_, ResultD_> groupBy(Function<A, GroupKeyA_> groupKeyAMapping, Function<A, GroupKeyB_> groupKeyBMapping, UniConstraintCollector<A, ResultContainerC_, ResultC_> collectorC, UniConstraintCollector<A, ResultContainerD_, ResultD_> collectorD) Combines the semantics ofUniConstraintStream.groupBy(Function, Function)andUniConstraintStream.groupBy(UniConstraintCollector).<GroupKeyA_,GroupKeyB_, GroupKeyC_>
TriConstraintStream<GroupKeyA_,GroupKeyB_, GroupKeyC_> groupBy(Function<A, GroupKeyA_> groupKeyAMapping, Function<A, GroupKeyB_> groupKeyBMapping, Function<A, GroupKeyC_> groupKeyCMapping) Convert theUniConstraintStreamto aTriConstraintStream, consisting of unique tuples with three facts.<GroupKeyA_,GroupKeyB_, GroupKeyC_, ResultContainerD_, ResultD_>
QuadConstraintStream<GroupKeyA_,GroupKeyB_, GroupKeyC_, ResultD_> groupBy(Function<A, GroupKeyA_> groupKeyAMapping, Function<A, GroupKeyB_> groupKeyBMapping, Function<A, GroupKeyC_> groupKeyCMapping, UniConstraintCollector<A, ResultContainerD_, ResultD_> collectorD) Combines the semantics ofUniConstraintStream.groupBy(Function, Function)andUniConstraintStream.groupBy(UniConstraintCollector).<GroupKeyA_,GroupKeyB_, GroupKeyC_, GroupKeyD_>
QuadConstraintStream<GroupKeyA_,GroupKeyB_, GroupKeyC_, GroupKeyD_> groupBy(Function<A, GroupKeyA_> groupKeyAMapping, Function<A, GroupKeyB_> groupKeyBMapping, Function<A, GroupKeyC_> groupKeyCMapping, Function<A, GroupKeyD_> groupKeyDMapping) Convert theUniConstraintStreamto aQuadConstraintStream, consisting of unique tuples with four facts.final <B> UniConstraintStream<A>ifExists(UniConstraintStream<B> otherStream, BiJoiner<A, B>... joiners) As defined byUniConstraintStream.ifExists(UniConstraintStream, BiJoiner).final <B> UniConstraintStream<A>ifNotExists(UniConstraintStream<B> otherStream, BiJoiner<A, B>... joiners) <Score_ extends Score<Score_>>
UniConstraintBuilder<A,Score_> innerImpact(Score_ constraintWeight, Function<A, BigDecimal> matchWeigher, ScoreImpactType scoreImpactType) <Score_ extends Score<Score_>>
UniConstraintBuilder<A,Score_> innerImpact(Score_ constraintWeight, ToIntFunction<A> matchWeigher, ScoreImpactType scoreImpactType) <Score_ extends Score<Score_>>
UniConstraintBuilder<A,Score_> innerImpact(Score_ constraintWeight, ToLongFunction<A> matchWeigher, ScoreImpactType scoreImpactType) final <B> BiConstraintStream<A,B> join(UniConstraintStream<B> otherStream, BiJoiner<A, B>... joiners) As defined byUniConstraintStream.join(UniConstraintStream, BiJoiner).final <B> BiConstraintStream<A,B> join(UniConstraintStream<B> otherStream, BiJoinerComber<A, B> joinerComber) AllowsConstraintFactory.forEachUniquePair(Class)to reuse the joiner combing logic.<ResultA_> UniConstraintStream<ResultA_>Transforms the stream in such a way that tuples are remapped using the given function.<ResultA_,ResultB_>
BiConstraintStream<ResultA_,ResultB_> As defined byUniConstraintStream.map(Function), only resulting inBiConstraintStream.<ResultA_,ResultB_, ResultC_>
TriConstraintStream<ResultA_,ResultB_, ResultC_> As defined byUniConstraintStream.map(Function), only resulting inTriConstraintStream.<ResultA_,ResultB_, ResultC_, ResultD_>
QuadConstraintStream<ResultA_,ResultB_, ResultC_, ResultD_> map(Function<A, ResultA_> mappingA, Function<A, ResultB_> mappingB, Function<A, ResultC_> mappingC, Function<A, ResultD_> mappingD) As defined byUniConstraintStream.map(Function), only resulting inQuadConstraintStream.Methods inherited from class ai.timefold.solver.core.impl.score.stream.bavet.common.BavetAbstractConstraintStream
assertEmptyChildStreamList, buildConstraint, buildNode, collectActiveConstraintStreams, getChildStreamList, getConstraintFactory, getParent, getTupleSource, guaranteesDistinct, shareAndAddChildMethods inherited from class ai.timefold.solver.core.impl.score.stream.common.AbstractConstraintStream
getRetrievalSemanticsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ai.timefold.solver.core.api.score.stream.ConstraintStream
getConstraintFactoryMethods inherited from interface ai.timefold.solver.core.impl.score.stream.common.uni.InnerUniConstraintStream
getRetrievalSemantics, guaranteesDistinct, ifExists, ifExistsIncludingUnassigned, ifNotExists, ifNotExistsIncludingUnassigned, impact, impact, impact, impactBigDecimal, impactConfigurable, impactConfigurableBigDecimal, impactConfigurableLong, impactLong, join, penalize, penalize, penalize, penalizeBigDecimal, penalizeConfigurable, penalizeConfigurable, penalizeConfigurable, penalizeConfigurableBigDecimal, penalizeConfigurableLong, penalizeLong, reward, reward, reward, rewardBigDecimal, rewardConfigurable, rewardConfigurable, rewardConfigurable, rewardConfigurableBigDecimal, rewardConfigurableLong, rewardLongMethods inherited from interface ai.timefold.solver.core.api.score.stream.uni.UniConstraintStream
complement, concat, concat, concat, ifExists, ifExists, ifExists, ifExists, ifExists, ifExists, ifExists, ifExists, ifExistsIncludingNullVars, ifExistsIncludingNullVars, ifExistsIncludingNullVars, ifExistsIncludingNullVars, ifExistsIncludingNullVars, ifExistsIncludingUnassigned, ifExistsIncludingUnassigned, ifExistsIncludingUnassigned, ifExistsIncludingUnassigned, ifExistsOther, ifExistsOther, ifExistsOther, ifExistsOther, ifExistsOther, ifExistsOther, ifExistsOtherIncludingNullVars, ifExistsOtherIncludingNullVars, ifExistsOtherIncludingNullVars, ifExistsOtherIncludingNullVars, ifExistsOtherIncludingNullVars, ifExistsOtherIncludingNullVars, ifExistsOtherIncludingUnassigned, ifExistsOtherIncludingUnassigned, ifExistsOtherIncludingUnassigned, ifExistsOtherIncludingUnassigned, ifExistsOtherIncludingUnassigned, ifExistsOtherIncludingUnassigned, ifNotExists, ifNotExists, ifNotExists, ifNotExists, ifNotExists, ifNotExists, ifNotExists, ifNotExists, ifNotExistsIncludingNullVars, ifNotExistsIncludingNullVars, ifNotExistsIncludingNullVars, ifNotExistsIncludingNullVars, ifNotExistsIncludingNullVars, ifNotExistsIncludingUnassigned, ifNotExistsIncludingUnassigned, ifNotExistsIncludingUnassigned, ifNotExistsIncludingUnassigned, ifNotExistsOther, ifNotExistsOther, ifNotExistsOther, ifNotExistsOther, ifNotExistsOther, ifNotExistsOther, ifNotExistsOtherIncludingNullVars, ifNotExistsOtherIncludingNullVars, ifNotExistsOtherIncludingNullVars, ifNotExistsOtherIncludingNullVars, ifNotExistsOtherIncludingNullVars, ifNotExistsOtherIncludingNullVars, ifNotExistsOtherIncludingUnassigned, ifNotExistsOtherIncludingUnassigned, ifNotExistsOtherIncludingUnassigned, ifNotExistsOtherIncludingUnassigned, ifNotExistsOtherIncludingUnassigned, ifNotExistsOtherIncludingUnassigned, impact, impact, impact, impactBigDecimal, impactBigDecimal, impactConfigurable, impactConfigurable, impactConfigurable, impactConfigurableBigDecimal, impactConfigurableBigDecimal, impactConfigurableLong, impactConfigurableLong, impactLong, impactLong, join, join, join, join, join, join, join, join, join, join, penalize, penalize, penalize, penalizeBigDecimal, penalizeBigDecimal, penalizeBigDecimal, penalizeConfigurable, penalizeConfigurable, penalizeConfigurable, penalizeConfigurableBigDecimal, penalizeConfigurableBigDecimal, penalizeConfigurableLong, penalizeConfigurableLong, penalizeLong, penalizeLong, penalizeLong, reward, reward, reward, rewardBigDecimal, rewardBigDecimal, rewardConfigurable, rewardConfigurable, rewardConfigurable, rewardConfigurableBigDecimal, rewardConfigurableBigDecimal, rewardConfigurableLong, rewardConfigurableLong, rewardLong, rewardLong
-
Constructor Details
-
BavetAbstractUniConstraintStream
protected BavetAbstractUniConstraintStream(BavetConstraintFactory<Solution_> constraintFactory, BavetAbstractConstraintStream<Solution_> parent) -
BavetAbstractUniConstraintStream
protected BavetAbstractUniConstraintStream(BavetConstraintFactory<Solution_> constraintFactory, RetrievalSemantics retrievalSemantics)
-
-
Method Details
-
filter
Description copied from interface:UniConstraintStreamExhaustively test each fact against thePredicateand match ifPredicate.test(Object)returns true.- Specified by:
filterin interfaceUniConstraintStream<Solution_>- Parameters:
predicate- never null- Returns:
- never null
-
join
@SafeVarargs public final <B> BiConstraintStream<A,B> join(UniConstraintStream<B> otherStream, BiJoiner<A, B>... joiners) Description copied from interface:UniConstraintStreamAs defined byUniConstraintStream.join(UniConstraintStream, BiJoiner). If multipleBiJoiners are provided, for performance reasons, the 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
SafeVarargsannotation because it's an interface method. Therefore, there are overloaded methods with up to 4BiJoinerparameters.- Specified by:
joinin interfaceUniConstraintStream<Solution_>- Type Parameters:
B- the type of the second matched fact- Parameters:
otherStream- never nulljoiners- never null- Returns:
- never null, a stream that matches every combination of A and B for which all the
joinersare true
-
join
public final <B> BiConstraintStream<A,B> join(UniConstraintStream<B> otherStream, BiJoinerComber<A, B> joinerComber) Description copied from interface:InnerUniConstraintStreamAllowsConstraintFactory.forEachUniquePair(Class)to reuse the joiner combing logic.- Specified by:
joinin interfaceInnerUniConstraintStream<Solution_>- Parameters:
otherStream- never nulljoinerComber- never null- Returns:
- never null
-
ifExists
@SafeVarargs public final <B> UniConstraintStream<A> ifExists(UniConstraintStream<B> otherStream, BiJoiner<A, B>... joiners) Description copied from interface:UniConstraintStreamAs defined byUniConstraintStream.ifExists(UniConstraintStream, BiJoiner). 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
SafeVarargsannotation because it's an interface method. Therefore, there are overloaded methods with up to 4BiJoinerparameters.- Specified by:
ifExistsin interfaceUniConstraintStream<Solution_>- Type Parameters:
B- the type of the second matched fact- Parameters:
otherStream- never nulljoiners- never null- Returns:
- never null, a stream that matches every A where B exists for which all the
BiJoiners are true
-
ifNotExists
@SafeVarargs public final <B> UniConstraintStream<A> ifNotExists(UniConstraintStream<B> otherStream, BiJoiner<A, B>... joiners) Description copied from interface:UniConstraintStreamAs defined byUniConstraintStream.ifNotExists(UniConstraintStream, BiJoiner). 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
SafeVarargsannotation because it's an interface method. Therefore, there are overloaded methods with up to 4BiJoinerparameters.- Specified by:
ifNotExistsin interfaceUniConstraintStream<Solution_>- Type Parameters:
B- the type of the second matched fact- Parameters:
otherStream- never nulljoiners- never null- Returns:
- never null, a stream that matches every A where B does not exist for which all the
BiJoiners are true
-
groupBy
public <ResultContainer_,Result_> UniConstraintStream<Result_> groupBy(UniConstraintCollector<A, ResultContainer_, Result_> collector) Description copied from interface:UniConstraintStreamConvert theUniConstraintStreamto a differentUniConstraintStream, containing only a single tuple, the result of applyingUniConstraintCollector.- Specified by:
groupByin interfaceUniConstraintStream<Solution_>- Type Parameters:
ResultContainer_- the mutable accumulation type (often hidden as an implementation detail)Result_- the type of a fact in the destinationUniConstraintStream's tuple- Parameters:
collector- never null, the collector to perform the grouping operation with SeeConstraintCollectorsfor common operations, such ascount(),sum()and others.- Returns:
- never null
-
groupBy
public <ResultContainerA_,ResultA_, BiConstraintStream<ResultA_,ResultContainerB_, ResultB_> ResultB_> groupBy(UniConstraintCollector<A, ResultContainerA_, ResultA_> collectorA, UniConstraintCollector<A, ResultContainerB_, ResultB_> collectorB) Description copied from interface:UniConstraintStreamConvert theUniConstraintStreamto aBiConstraintStream, containing only a single tuple, the result of applying twoUniConstraintCollectors.- Specified by:
groupByin interfaceUniConstraintStream<Solution_>- Type Parameters:
ResultContainerA_- the mutable accumulation type (often hidden as an implementation detail)ResultA_- the type of the first fact in the destinationBiConstraintStream's tupleResultContainerB_- the mutable accumulation type (often hidden as an implementation detail)ResultB_- the type of the second fact in the destinationBiConstraintStream's tuple- Parameters:
collectorA- never null, the collector to perform the first grouping operation with SeeConstraintCollectorsfor common operations, such ascount(),sum()and others.collectorB- never null, the collector to perform the second grouping operation with SeeConstraintCollectorsfor common operations, such ascount(),sum()and others.- Returns:
- never null
-
groupBy
public <ResultContainerA_,ResultA_, TriConstraintStream<ResultA_,ResultContainerB_, ResultB_, ResultContainerC_, ResultC_> ResultB_, groupByResultC_> (UniConstraintCollector<A, ResultContainerA_, ResultA_> collectorA, UniConstraintCollector<A, ResultContainerB_, ResultB_> collectorB, UniConstraintCollector<A, ResultContainerC_, ResultC_> collectorC) Description copied from interface:UniConstraintStreamConvert theUniConstraintStreamto aTriConstraintStream, containing only a single tuple, the result of applying threeUniConstraintCollectors.- Specified by:
groupByin interfaceUniConstraintStream<Solution_>- Type Parameters:
ResultContainerA_- the mutable accumulation type (often hidden as an implementation detail)ResultA_- the type of the first fact in the destinationTriConstraintStream's tupleResultContainerB_- the mutable accumulation type (often hidden as an implementation detail)ResultB_- the type of the second fact in the destinationTriConstraintStream's tupleResultContainerC_- the mutable accumulation type (often hidden as an implementation detail)ResultC_- the type of the third fact in the destinationTriConstraintStream's tuple- Parameters:
collectorA- never null, the collector to perform the first grouping operation with SeeConstraintCollectorsfor common operations, such ascount(),sum()and others.collectorB- never null, the collector to perform the second grouping operation with SeeConstraintCollectorsfor common operations, such ascount(),sum()and others.collectorC- never null, the collector to perform the third grouping operation with SeeConstraintCollectorsfor common operations, such ascount(),sum()and others.- Returns:
- never null
-
groupBy
public <ResultContainerA_,ResultA_, QuadConstraintStream<ResultA_,ResultContainerB_, ResultB_, ResultContainerC_, ResultC_, ResultContainerD_, ResultD_> ResultB_, groupByResultC_, ResultD_> (UniConstraintCollector<A, ResultContainerA_, ResultA_> collectorA, UniConstraintCollector<A, ResultContainerB_, ResultB_> collectorB, UniConstraintCollector<A, ResultContainerC_, ResultC_> collectorC, UniConstraintCollector<A, ResultContainerD_, ResultD_> collectorD) Description copied from interface:UniConstraintStreamConvert theUniConstraintStreamto aQuadConstraintStream, containing only a single tuple, the result of applying fourUniConstraintCollectors.- Specified by:
groupByin interfaceUniConstraintStream<Solution_>- Type Parameters:
ResultContainerA_- the mutable accumulation type (often hidden as an implementation detail)ResultA_- the type of the first fact in the destinationQuadConstraintStream's tupleResultContainerB_- the mutable accumulation type (often hidden as an implementation detail)ResultB_- the type of the second fact in the destinationQuadConstraintStream's tupleResultContainerC_- the mutable accumulation type (often hidden as an implementation detail)ResultC_- the type of the third fact in the destinationQuadConstraintStream's tupleResultContainerD_- the mutable accumulation type (often hidden as an implementation detail)ResultD_- the type of the fourth fact in the destinationQuadConstraintStream's tuple- Parameters:
collectorA- never null, the collector to perform the first grouping operation with SeeConstraintCollectorsfor common operations, such ascount(),sum()and others.collectorB- never null, the collector to perform the second grouping operation with SeeConstraintCollectorsfor common operations, such ascount(),sum()and others.collectorC- never null, the collector to perform the third grouping operation with SeeConstraintCollectorsfor common operations, such ascount(),sum()and others.collectorD- never null, the collector to perform the fourth grouping operation with SeeConstraintCollectorsfor common operations, such ascount(),sum()and others.- Returns:
- never null
-
groupBy
Description copied from interface:UniConstraintStreamConvert theUniConstraintStreamto a differentUniConstraintStream, 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 streamObjects.equals(Object, Object)any other.- Specified by:
groupByin interfaceUniConstraintStream<Solution_>- Type Parameters:
GroupKey_- the type of a fact in the destinationUniConstraintStream's tuple; must honorthe general contract of hashCode.- Parameters:
groupKeyMapping- never null, mapping function to convert each element in the stream to a different element- Returns:
- never null
-
groupBy
public <GroupKey_,ResultContainerB_, TriConstraintStream<GroupKey_,ResultB_, ResultContainerC_, ResultC_> ResultB_, groupByResultC_> (Function<A, GroupKey_> groupKeyMapping, UniConstraintCollector<A, ResultContainerB_, ResultB_> collectorB, UniConstraintCollector<A, ResultContainerC_, ResultC_> collectorC) Description copied from interface:UniConstraintStreamConvert theUniConstraintStreamto aTriConstraintStream, consisting of unique tuples with three facts.The first fact is the return value of the group key mapping function, applied on the incoming tuple. The remaining facts are the return value of the respective
UniConstraintCollectorapplied on all incoming tuples with the same first fact.- Specified by:
groupByin interfaceUniConstraintStream<Solution_>- Type Parameters:
GroupKey_- the type of the first fact in the destinationTriConstraintStream's tuple; must honorthe general contract of hashCode.ResultContainerB_- the mutable accumulation type (often hidden as an implementation detail)ResultB_- the type of the second fact in the destinationTriConstraintStream's tupleResultContainerC_- the mutable accumulation type (often hidden as an implementation detail)ResultC_- the type of the third fact in the destinationTriConstraintStream's tuple- Parameters:
groupKeyMapping- never null, function to convert the fact in the original tuple to a different factcollectorB- never null, the collector to perform the first grouping operation with SeeConstraintCollectorsfor common operations, such ascount(),sum()and others.collectorC- never null, the collector to perform the second grouping operation with SeeConstraintCollectorsfor common operations, such ascount(),sum()and others.- Returns:
- never null
-
groupBy
public <GroupKey_,ResultContainerB_, QuadConstraintStream<GroupKey_,ResultB_, ResultContainerC_, ResultC_, ResultContainerD_, ResultD_> ResultB_, groupByResultC_, ResultD_> (Function<A, GroupKey_> groupKeyMapping, UniConstraintCollector<A, ResultContainerB_, ResultB_> collectorB, UniConstraintCollector<A, ResultContainerC_, ResultC_> collectorC, UniConstraintCollector<A, ResultContainerD_, ResultD_> collectorD) Description copied from interface:UniConstraintStreamConvert theUniConstraintStreamto aQuadConstraintStream, consisting of unique tuples with four facts.The first fact is the return value of the group key mapping function, applied on the incoming tuple. The remaining facts are the return value of the respective
UniConstraintCollectorapplied on all incoming tuples with the same first fact.- Specified by:
groupByin interfaceUniConstraintStream<Solution_>- Type Parameters:
GroupKey_- the type of the first fact in the destinationQuadConstraintStream's tuple; must honorthe general contract of hashCode.ResultContainerB_- the mutable accumulation type (often hidden as an implementation detail)ResultB_- the type of the second fact in the destinationQuadConstraintStream's tupleResultContainerC_- the mutable accumulation type (often hidden as an implementation detail)ResultC_- the type of the third fact in the destinationQuadConstraintStream's tupleResultContainerD_- the mutable accumulation type (often hidden as an implementation detail)ResultD_- the type of the fourth fact in the destinationQuadConstraintStream's tuple- Parameters:
groupKeyMapping- never null, function to convert the fact in the original tuple to a different factcollectorB- never null, the collector to perform the first grouping operation with SeeConstraintCollectorsfor common operations, such ascount(),sum()and others.collectorC- never null, the collector to perform the second grouping operation with SeeConstraintCollectorsfor common operations, such ascount(),sum()and others.collectorD- never null, the collector to perform the third grouping operation with SeeConstraintCollectorsfor common operations, such ascount(),sum()and others.- Returns:
- never null
-
groupBy
public <GroupKey_,ResultContainer_, BiConstraintStream<GroupKey_,Result_> Result_> groupBy(Function<A, GroupKey_> groupKeyMapping, UniConstraintCollector<A, ResultContainer_, Result_> collector) Description copied from interface:UniConstraintStreamConvert theUniConstraintStreamto aBiConstraintStream, consisting of unique tuples with two facts.The first fact is the return value of the group key mapping function, applied on the incoming tuple. The second fact is the return value of a given
UniConstraintCollectorapplied on all incoming tuples with the same first fact.- Specified by:
groupByin interfaceUniConstraintStream<Solution_>- Type Parameters:
GroupKey_- the type of the first fact in the destinationBiConstraintStream's tuple; must honorthe general contract of hashCode.ResultContainer_- the mutable accumulation type (often hidden as an implementation detail)Result_- the type of the second fact in the destinationBiConstraintStream's tuple- Parameters:
groupKeyMapping- 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 SeeConstraintCollectorsfor common operations, such ascount(),sum()and others.- Returns:
- never null
-
groupBy
public <GroupKeyA_,GroupKeyB_> BiConstraintStream<GroupKeyA_,GroupKeyB_> groupBy(Function<A, GroupKeyA_> groupKeyAMapping, Function<A, GroupKeyB_> groupKeyBMapping) Description copied from interface:UniConstraintStreamConvert theUniConstraintStreamto aBiConstraintStream, consisting of unique tuples with two facts.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.
- Specified by:
groupByin interfaceUniConstraintStream<Solution_>- Type Parameters:
GroupKeyA_- the type of the first fact in the destinationBiConstraintStream's tuple; must honorthe general contract of hashCode.GroupKeyB_- the type of the second fact in the destinationBiConstraintStream's tuple; must honorthe general contract of hashCode.- Parameters:
groupKeyAMapping- never null, function to convert the original tuple into a first factgroupKeyBMapping- never null, function to convert the original tuple into a second fact- Returns:
- never null
-
groupBy
public <GroupKeyA_,GroupKeyB_, TriConstraintStream<GroupKeyA_,ResultContainer_, Result_> GroupKeyB_, groupByResult_> (Function<A, GroupKeyA_> groupKeyAMapping, Function<A, GroupKeyB_> groupKeyBMapping, UniConstraintCollector<A, ResultContainer_, Result_> collector) Description copied from interface:UniConstraintStreamCombines the semantics ofUniConstraintStream.groupBy(Function, Function)andUniConstraintStream.groupBy(UniConstraintCollector). That is, the first and second facts in the tuple follow theUniConstraintStream.groupBy(Function, Function)semantics, and the third fact is the result of applyingUniConstraintCollector.finisher()on all the tuples of the originalUniConstraintStreamthat belong to the group.- Specified by:
groupByin interfaceUniConstraintStream<Solution_>- Type Parameters:
GroupKeyA_- the type of the first fact in the destinationTriConstraintStream's tuple; must honorthe general contract of hashCode.GroupKeyB_- the type of the second fact in the destinationTriConstraintStream's tuple; must honorthe general contract of hashCode.ResultContainer_- the mutable accumulation type (often hidden as an implementation detail)Result_- the type of the third fact in the destinationTriConstraintStream's tuple- Parameters:
groupKeyAMapping- 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 SeeConstraintCollectorsfor common operations, such ascount(),sum()and others.- Returns:
- never null
-
groupBy
public <GroupKeyA_,GroupKeyB_, QuadConstraintStream<GroupKeyA_,ResultContainerC_, ResultC_, ResultContainerD_, ResultD_> GroupKeyB_, groupByResultC_, ResultD_> (Function<A, GroupKeyA_> groupKeyAMapping, Function<A, GroupKeyB_> groupKeyBMapping, UniConstraintCollector<A, ResultContainerC_, ResultC_> collectorC, UniConstraintCollector<A, ResultContainerD_, ResultD_> collectorD) Description copied from interface:UniConstraintStreamCombines the semantics ofUniConstraintStream.groupBy(Function, Function)andUniConstraintStream.groupBy(UniConstraintCollector). That is, the first and second facts in the tuple follow theUniConstraintStream.groupBy(Function, Function)semantics. The third fact is the result of applying the firstUniConstraintCollector.finisher()on all the tuples of the originalUniConstraintStreamthat belong to the group. The fourth fact is the result of applying the secondUniConstraintCollector.finisher()on all the tuples of the originalUniConstraintStreamthat belong to the group- Specified by:
groupByin interfaceUniConstraintStream<Solution_>- Type Parameters:
GroupKeyA_- the type of the first fact in the destinationQuadConstraintStream's tuple; must honorthe general contract of hashCode.GroupKeyB_- the type of the second fact in the destinationQuadConstraintStream's tuple; must honorthe general contract of hashCode.ResultContainerC_- the mutable accumulation type (often hidden as an implementation detail)ResultC_- the type of the third fact in the destinationQuadConstraintStream's tupleResultContainerD_- the mutable accumulation type (often hidden as an implementation detail)ResultD_- the type of the fourth fact in the destinationQuadConstraintStream's tuple- Parameters:
groupKeyAMapping- 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 SeeConstraintCollectorsfor common operations, such ascount(),sum()and others.collectorD- never null, the collector to perform the second grouping operation with SeeConstraintCollectorsfor common operations, such ascount(),sum()and others.- Returns:
- never null
-
groupBy
public <GroupKeyA_,GroupKeyB_, TriConstraintStream<GroupKeyA_,GroupKeyC_> GroupKeyB_, groupByGroupKeyC_> (Function<A, GroupKeyA_> groupKeyAMapping, Function<A, GroupKeyB_> groupKeyBMapping, Function<A, GroupKeyC_> groupKeyCMapping) Description copied from interface:UniConstraintStreamConvert theUniConstraintStreamto aTriConstraintStream, consisting of unique tuples with three facts.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. The third fact is the return value of the third group key mapping function, applied on all incoming tuples with the same first fact.
- Specified by:
groupByin interfaceUniConstraintStream<Solution_>- Type Parameters:
GroupKeyA_- the type of the first fact in the destinationTriConstraintStream's tuple; must honorthe general contract of hashCode.GroupKeyB_- the type of the second fact in the destinationTriConstraintStream's tuple; must honorthe general contract of hashCode.GroupKeyC_- the type of the third fact in the destinationTriConstraintStream's tuple; must honorthe general contract of hashCode.- Parameters:
groupKeyAMapping- never null, function to convert the original tuple into a first factgroupKeyBMapping- never null, function to convert the original tuple into a second factgroupKeyCMapping- never null, function to convert the original tuple into a third fact- Returns:
- never null
-
groupBy
public <GroupKeyA_,GroupKeyB_, QuadConstraintStream<GroupKeyA_,GroupKeyC_, ResultContainerD_, ResultD_> GroupKeyB_, groupByGroupKeyC_, ResultD_> (Function<A, GroupKeyA_> groupKeyAMapping, Function<A, GroupKeyB_> groupKeyBMapping, Function<A, GroupKeyC_> groupKeyCMapping, UniConstraintCollector<A, ResultContainerD_, ResultD_> collectorD) Description copied from interface:UniConstraintStreamCombines the semantics ofUniConstraintStream.groupBy(Function, Function)andUniConstraintStream.groupBy(UniConstraintCollector). That is, the first three facts in the tuple follow theUniConstraintStream.groupBy(Function, Function)semantics. The final fact is the result of applying the firstUniConstraintCollector.finisher()on all the tuples of the originalUniConstraintStreamthat belong to the group.- Specified by:
groupByin interfaceUniConstraintStream<Solution_>- Type Parameters:
GroupKeyA_- the type of the first fact in the destinationQuadConstraintStream's tuple; must honorthe general contract of hashCode.GroupKeyB_- the type of the second fact in the destinationQuadConstraintStream's tuple; must honorthe general contract of hashCode.GroupKeyC_- the type of the third fact in the destinationQuadConstraintStream's tuple; must honorthe general contract of hashCode.ResultContainerD_- the mutable accumulation type (often hidden as an implementation detail)ResultD_- the type of the fourth fact in the destinationQuadConstraintStream's tuple- Parameters:
groupKeyAMapping- never null, function to convert the original tuple into a first factgroupKeyBMapping- never null, function to convert the original tuple into a second factgroupKeyCMapping- never null, function to convert the original tuple into a third factcollectorD- never null, the collector to perform the grouping operation with SeeConstraintCollectorsfor common operations, such ascount(),sum()and others.- Returns:
- never null
-
groupBy
public <GroupKeyA_,GroupKeyB_, QuadConstraintStream<GroupKeyA_,GroupKeyC_, GroupKeyD_> GroupKeyB_, groupByGroupKeyC_, GroupKeyD_> (Function<A, GroupKeyA_> groupKeyAMapping, Function<A, GroupKeyB_> groupKeyBMapping, Function<A, GroupKeyC_> groupKeyCMapping, Function<A, GroupKeyD_> groupKeyDMapping) Description copied from interface:UniConstraintStreamConvert theUniConstraintStreamto aQuadConstraintStream, consisting of unique tuples with four facts.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. The third fact is the return value of the third group key mapping function, applied on all incoming tuples with the same first fact. The fourth fact is the return value of the fourth group key mapping function, applied on all incoming tuples with the same first fact.
- Specified by:
groupByin interfaceUniConstraintStream<Solution_>- Type Parameters:
GroupKeyA_- the type of the first fact in the destinationQuadConstraintStream's tuple; must honorthe general contract of hashCode.GroupKeyB_- the type of the second fact in the destinationQuadConstraintStream's tuple; must honorthe general contract of hashCode.GroupKeyC_- the type of the third fact in the destinationQuadConstraintStream's tuple; must honorthe general contract of hashCode.GroupKeyD_- the type of the fourth fact in the destinationQuadConstraintStream's tuple; must honorthe general contract of hashCode.- Parameters:
groupKeyAMapping- * callingmap(Person::getAge)on such stream will produce a stream ofIntegers *[20, 25, 30],groupKeyBMapping- never null, function to convert the original tuple into a second factgroupKeyCMapping- never null, function to convert the original tuple into a third factgroupKeyDMapping- never null, function to convert the original tuple into a fourth fact- Returns:
- never null
-
distinct
Description copied from interface:UniConstraintStreamTransforms the stream in such a way that all the tuples going through it are distinct. (No two tuples willequal.)By default, tuples going through a constraint stream are distinct. However, operations such as
UniConstraintStream.map(Function)may create a stream which breaks that promise. By calling this method on such a stream, duplicate copies of the same tuple will be omitted at a performance cost.- Specified by:
distinctin interfaceInnerUniConstraintStream<Solution_>- Specified by:
distinctin interfaceUniConstraintStream<Solution_>- Returns:
- never null
-
concat
Description copied from interface:UniConstraintStreamReturns a newUniConstraintStreamcontaining all the tuples of both thisUniConstraintStreamand the providedUniConstraintStream. Tuples in both thisUniConstraintStreamand the providedUniConstraintStreamwill appear at least twice.For instance, if this stream consists of
[A, B, C]and the other stream consists of[C, D, E],this.concat(other)will consist of[A, B, C, C, D, E]. This operation can be thought of as an or between streams.- Specified by:
concatin interfaceUniConstraintStream<Solution_>- Parameters:
otherStream- never null- Returns:
- never null
-
concat
public <B> BiConstraintStream<A,B> concat(BiConstraintStream<A, B> otherStream, Function<A, B> paddingFunction) Description copied from interface:UniConstraintStreamReturns a newBiConstraintStreamcontaining all the tuples of both thisUniConstraintStreamand the providedBiConstraintStream. TheUniConstraintStreamtuples will be padded from the right by the result of the padding function.For instance, if this stream consists of
[A, B, C]and the other stream consists of[(C1, C2), (D1, D2), (E1, E2)],this.concat(other, a -> null)will consist of[(A, null), (B, null), (C, null), (C1, C2), (D1, D2), (E1, E2)].This operation can be thought of as an or between streams.
- Specified by:
concatin interfaceUniConstraintStream<Solution_>- Parameters:
otherStream- never nullpaddingFunction- never null, function to find the padding for the second fact- Returns:
- never null
-
concat
public <B,C> TriConstraintStream<A,B, concatC> (TriConstraintStream<A, B, C> otherStream, Function<A, B> paddingFunctionB, Function<A, C> paddingFunctionC) Description copied from interface:UniConstraintStreamReturns a newTriConstraintStreamcontaining all the tuples of both thisUniConstraintStreamand the providedTriConstraintStream. TheUniConstraintStreamtuples will be padded from the right by the result of the padding functions.For instance, if this stream consists of
[A, B, C]and the other stream consists of[(C1, C2, C3), (D1, D2, D3), (E1, E2, E3)],this.concat(other, a -> null, a -> null)will consist of[(A, null), (B, null), (C, null), (C1, C2, C3), (D1, D2, D3), (E1, E2, E3)].This operation can be thought of as an or between streams.
- Specified by:
concatin interfaceUniConstraintStream<Solution_>- Parameters:
otherStream- never nullpaddingFunctionB- never null, function to find the padding for the second factpaddingFunctionC- never null, function to find the padding for the third fact- Returns:
- never null
-
concat
public <B,C, QuadConstraintStream<A,D> B, concatC, D> (QuadConstraintStream<A, B, C, D> otherStream, Function<A, B> paddingFunctionB, Function<A, C> paddingFunctionC, Function<A, D> paddingFunctionD) Description copied from interface:UniConstraintStreamReturns a newQuadConstraintStreamcontaining all the tuples of both thisUniConstraintStreamand the providedQuadConstraintStream. TheUniConstraintStreamtuples will be padded from the right by the result of the padding functions.For instance, if this stream consists of
[A, B, C]and the other stream consists of[(C1, C2, C3, C4), (D1, D2, D3, D4), (E1, E2, E3, E4)],this.concat(other, a -> null, a -> null, a -> null)will consist of[(A, null), (B, null), (C, null), (C1, C2, C3, C4), (D1, D2, D3, D4), (E1, E2, E3, E4)].This operation can be thought of as an or between streams.
- Specified by:
concatin interfaceUniConstraintStream<Solution_>- Parameters:
otherStream- never nullpaddingFunctionB- never null, function to find the padding for the second factpaddingFunctionC- never null, function to find the padding for the third factpaddingFunctionD- never null, function to find the padding for the fourth fact- Returns:
- never null
-
map
Description copied from interface:UniConstraintStreamTransforms the stream in such a way that tuples are remapped using the given function. This may produce a stream with duplicate tuples. SeeUniConstraintStream.distinct()for details.There are several recommendations for implementing the mapping function:
- Purity. The mapping function should only depend on its input. That is, given the same input, it always returns the same output.
- Bijectivity.
No two input tuples should map to the same output tuple,
or to tuples that are
equal. Not following this recommendation creates a constraint stream with duplicate tuples, and may force you to useUniConstraintStream.distinct()later, which comes at a performance cost. - Immutable data carriers.
The objects returned by the mapping function should be identified by their contents and nothing else.
If two of them have contents which
equal, then they should likewiseequaland preferably be the same instance. The objects returned by the mapping function should also be immutable, meaning their contents should not be allowed to change.
Simple example: assuming a constraint stream of tuples of
Persons[Ann(age = 20), Beth(age = 25), Cathy(age = 30)], callingmap(Person::getAge)on such stream will produce a stream ofIntegers[20, 25, 30],Example with a non-bijective mapping function: assuming a constraint stream of tuples of
Persons[Ann(age = 20), Beth(age = 25), Cathy(age = 30), David(age = 30), Eric(age = 20)], callingmap(Person::getAge)on such stream will produce a stream ofIntegers[20, 25, 30, 30, 20].Use with caution, as the increased memory allocation rates coming from tuple creation may negatively affect performance.
- Specified by:
mapin interfaceUniConstraintStream<Solution_>- Type Parameters:
ResultA_- the type of the only fact in the resultingUniConstraintStream's tuple- Parameters:
mapping- never null, function to convert the original tuple into the new tuple- Returns:
- never null
-
map
public <ResultA_,ResultB_> BiConstraintStream<ResultA_,ResultB_> map(Function<A, ResultA_> mappingA, Function<A, ResultB_> mappingB) Description copied from interface:UniConstraintStreamAs defined byUniConstraintStream.map(Function), only resulting inBiConstraintStream.- Specified by:
mapin interfaceUniConstraintStream<Solution_>- Type Parameters:
ResultA_- the type of the first fact in the resultingBiConstraintStream's tupleResultB_- the type of the first fact in the resultingBiConstraintStream's tuple- Parameters:
mappingA- never null, function to convert the original tuple into the first fact of a new tuplemappingB- never null, function to convert the original tuple into the second fact of a new tuple- Returns:
- never null
-
map
public <ResultA_,ResultB_, TriConstraintStream<ResultA_,ResultC_> ResultB_, mapResultC_> (Function<A, ResultA_> mappingA, Function<A, ResultB_> mappingB, Function<A, ResultC_> mappingC) Description copied from interface:UniConstraintStreamAs defined byUniConstraintStream.map(Function), only resulting inTriConstraintStream.- Specified by:
mapin interfaceUniConstraintStream<Solution_>- Type Parameters:
ResultA_- the type of the first fact in the resultingTriConstraintStream's tupleResultB_- the type of the first fact in the resultingTriConstraintStream's tupleResultC_- the type of the third fact in the resultingTriConstraintStream's tuple- Parameters:
mappingA- never null, function to convert the original tuple into the first fact of a new tuplemappingB- never null, function to convert the original tuple into the second fact of a new tuplemappingC- never null, function to convert the original tuple into the third fact of a new tuple- Returns:
- never null
-
map
public <ResultA_,ResultB_, QuadConstraintStream<ResultA_,ResultC_, ResultD_> ResultB_, mapResultC_, ResultD_> (Function<A, ResultA_> mappingA, Function<A, ResultB_> mappingB, Function<A, ResultC_> mappingC, Function<A, ResultD_> mappingD) Description copied from interface:UniConstraintStreamAs defined byUniConstraintStream.map(Function), only resulting inQuadConstraintStream.- Specified by:
mapin interfaceUniConstraintStream<Solution_>- Type Parameters:
ResultA_- the type of the first fact in the resultingQuadConstraintStream's tupleResultB_- the type of the first fact in the resultingQuadConstraintStream's tupleResultC_- the type of the third fact in the resultingQuadConstraintStream's tupleResultD_- the type of the third fact in the resultingQuadConstraintStream's tuple- Parameters:
mappingA- never null, function to convert the original tuple into the first fact of a new tuplemappingB- never null, function to convert the original tuple into the second fact of a new tuplemappingC- never null, function to convert the original tuple into the third fact of a new tuplemappingD- never null, function to convert the original tuple into the fourth fact of a new tuple- Returns:
- never null
-
flattenLast
Description copied from interface:UniConstraintStreamTakes each tuple and applies a mapping on it, which turns the tuple into aIterable. Returns a constraint stream consisting of contents of those iterables. This may produce a stream with duplicate tuples. SeeUniConstraintStream.distinct()for details.In cases where the original tuple is already an
Iterable, useFunction.identity()as the argument.Simple example: assuming a constraint stream of tuples of
Persons[Ann(roles = [USER, ADMIN]]), Beth(roles = [USER]), Cathy(roles = [ADMIN, AUDITOR])], callingflattenLast(Person::getRoles)on such stream will produce a stream of[USER, ADMIN, USER, ADMIN, AUDITOR].- Specified by:
flattenLastin interfaceUniConstraintStream<Solution_>- Type Parameters:
ResultA_- the type of facts in the resulting tuples. It is recommended that this type be deeply immutable. Not following this recommendation may lead to hard-to-debug hashing issues down the stream, especially if this value is ever used as a group key.- Parameters:
mapping- never null, function to convert the original tuple intoIterable. For performance, returning an implementation ofCollectionis preferred.- Returns:
- never null
-
expand
Description copied from interface:UniConstraintStreamAdds a fact to the end of the tuple, increasing the cardinality of the stream. Useful for storing results of expensive computations on the original tuple.Use with caution, as the benefits of caching computation may be outweighed by increased memory allocation rates coming from tuple creation. If more than one fact is to be added, prefer
UniConstraintStream.expand(Function, Function)orUniConstraintStream.expand(Function, Function, Function).- Specified by:
expandin interfaceUniConstraintStream<Solution_>- Type Parameters:
ResultB_- type of the final fact of the new tuple- Parameters:
mapping- function to produce the new fact from the original tuple- Returns:
- never null
-
expand
public <ResultB_,ResultC_> TriConstraintStream<A,ResultB_, expandResultC_> (Function<A, ResultB_> mappingB, Function<A, ResultC_> mappingC) Description copied from interface:UniConstraintStreamAdds two facts to the end of the tuple, increasing the cardinality of the stream. Useful for storing results of expensive computations on the original tuple.Use with caution, as the benefits of caching computation may be outweighed by increased memory allocation rates coming from tuple creation. If more than two facts are to be added, prefer
UniConstraintStream.expand(Function, Function, Function).- Specified by:
expandin interfaceUniConstraintStream<Solution_>- Type Parameters:
ResultB_- type of the second fact of the new tupleResultC_- type of the third fact of the new tuple- Parameters:
mappingB- function to produce the new second fact from the original tuplemappingC- function to produce the new third fact from the original tuple- Returns:
- never null
-
expand
public <ResultB_,ResultC_, QuadConstraintStream<A,ResultD_> ResultB_, expandResultC_, ResultD_> (Function<A, ResultB_> mappingB, Function<A, ResultC_> mappingC, Function<A, ResultD_> mappingD) Description copied from interface:UniConstraintStreamAdds three facts to the end of the tuple, increasing the cardinality of the stream. Useful for storing results of expensive computations on the original tuple.Use with caution, as the benefits of caching computation may be outweighed by increased memory allocation rates coming from tuple creation.
- Specified by:
expandin interfaceUniConstraintStream<Solution_>- Type Parameters:
ResultB_- type of the second fact of the new tupleResultC_- type of the third fact of the new tupleResultD_- type of the final fact of the new tuple- Parameters:
mappingB- function to produce the new second fact from the original tuplemappingC- function to produce the new third fact from the original tuplemappingD- function to produce the new final fact from the original tuple- Returns:
- never null
-
innerImpact
public <Score_ extends Score<Score_>> UniConstraintBuilder<A,Score_> innerImpact(Score_ constraintWeight, ToIntFunction<A> matchWeigher, ScoreImpactType scoreImpactType) - Specified by:
innerImpactin interfaceInnerUniConstraintStream<Solution_>
-
innerImpact
public <Score_ extends Score<Score_>> UniConstraintBuilder<A,Score_> innerImpact(Score_ constraintWeight, ToLongFunction<A> matchWeigher, ScoreImpactType scoreImpactType) - Specified by:
innerImpactin interfaceInnerUniConstraintStream<Solution_>
-
innerImpact
public <Score_ extends Score<Score_>> UniConstraintBuilder<A,Score_> innerImpact(Score_ constraintWeight, Function<A, BigDecimal> matchWeigher, ScoreImpactType scoreImpactType) - Specified by:
innerImpactin interfaceInnerUniConstraintStream<Solution_>
-
getDefaultJustificationMapping
protected final BiFunction<A,Score<?>, getDefaultJustificationMapping()DefaultConstraintJustification> - Specified by:
getDefaultJustificationMappingin classAbstractConstraintStream<Solution_>
-
getDefaultIndictedObjectsMapping
- Specified by:
getDefaultIndictedObjectsMappingin classAbstractConstraintStream<Solution_>
-