Class QuadLeftHandSide<A,B,C,D>
- java.lang.Object
-
- org.optaplanner.core.impl.score.stream.drools.common.QuadLeftHandSide<A,B,C,D>
-
- Type Parameters:
A
- generic type of the first resulting variableB
- generic type of the second resulting variableC
- generic type of the third resulting variableD
- generic type of the fourth resulting variable
public final class QuadLeftHandSide<A,B,C,D> extends Object
Represents the left hand side of a Drools rule, the result of which are four variables. For more, seeUniLeftHandSide
andBiLeftHandSide
.
-
-
Field Summary
Fields Modifier and Type Field Description protected DroolsVariableFactory
variableFactory
-
Constructor Summary
Constructors Modifier Constructor Description protected
QuadLeftHandSide(org.drools.model.Variable<A> variableA, org.drools.model.Variable<B> variableB, org.drools.model.Variable<C> variableC, PatternVariable<D,?,?> patternVariableD, DroolsVariableFactory variableFactory)
protected
QuadLeftHandSide(PatternVariable<A,?,?> patternVariableA, PatternVariable<B,?,?> patternVariableB, PatternVariable<C,?,?> patternVariableC, PatternVariable<D,?,?> patternVariableD, DroolsVariableFactory variableFactory)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description <E> QuadLeftHandSide<A,B,C,D>
andExists(Class<E> dClass, PentaJoiner<A,B,C,D,E>[] joiners, Predicate<E> nullityFilter)
QuadLeftHandSide<A,B,C,D>
andFilter(QuadPredicate<A,B,C,D> predicate)
<NewD> QuadLeftHandSide<A,B,C,NewD>
andFlattenLast(Function<D,Iterable<NewD>> mapping)
<NewA> UniLeftHandSide<NewA>
andGroupBy(QuadFunction<A,B,C,D,NewA> keyMapping)
<NewA,NewB>
BiLeftHandSide<NewA,NewB>andGroupBy(QuadFunction<A,B,C,D,NewA> keyMappingA, QuadFunction<A,B,C,D,NewB> keyMappingB)
<NewA,NewB,NewC>
TriLeftHandSide<NewA,NewB,NewC>andGroupBy(QuadFunction<A,B,C,D,NewA> keyMappingA, QuadFunction<A,B,C,D,NewB> keyMappingB, QuadFunction<A,B,C,D,NewC> keyMappingC)
<NewA,NewB,NewC,NewD>
QuadLeftHandSide<NewA,NewB,NewC,NewD>andGroupBy(QuadFunction<A,B,C,D,NewA> keyMappingA, QuadFunction<A,B,C,D,NewB> keyMappingB, QuadFunction<A,B,C,D,NewC> keyMappingC, QuadFunction<A,B,C,D,NewD> keyMappingD)
<NewA,NewB,NewC,NewD>
QuadLeftHandSide<NewA,NewB,NewC,NewD>andGroupBy(QuadFunction<A,B,C,D,NewA> keyMappingA, QuadFunction<A,B,C,D,NewB> keyMappingB, QuadFunction<A,B,C,D,NewC> keyMappingC, QuadConstraintCollector<A,B,C,D,?,NewD> collectorD)
<NewA,NewB,NewC>
TriLeftHandSide<NewA,NewB,NewC>andGroupBy(QuadFunction<A,B,C,D,NewA> keyMappingA, QuadFunction<A,B,C,D,NewB> keyMappingB, QuadConstraintCollector<A,B,C,D,?,NewC> collectorC)
<NewA,NewB,NewC,NewD>
QuadLeftHandSide<NewA,NewB,NewC,NewD>andGroupBy(QuadFunction<A,B,C,D,NewA> keyMappingA, QuadFunction<A,B,C,D,NewB> keyMappingB, QuadConstraintCollector<A,B,C,D,?,NewC> collectorC, QuadConstraintCollector<A,B,C,D,?,NewD> collectorD)
<NewA,NewB>
BiLeftHandSide<NewA,NewB>andGroupBy(QuadFunction<A,B,C,D,NewA> keyMappingA, QuadConstraintCollector<A,B,C,D,?,NewB> collectorB)
<NewA,NewB,NewC>
TriLeftHandSide<NewA,NewB,NewC>andGroupBy(QuadFunction<A,B,C,D,NewA> keyMappingA, QuadConstraintCollector<A,B,C,D,?,NewB> collectorB, QuadConstraintCollector<A,B,C,D,?,NewC> collectorC)
<NewA,NewB,NewC,NewD>
QuadLeftHandSide<NewA,NewB,NewC,NewD>andGroupBy(QuadFunction<A,B,C,D,NewA> keyMappingA, QuadConstraintCollector<A,B,C,D,?,NewB> collectorB, QuadConstraintCollector<A,B,C,D,?,NewC> collectorC, QuadConstraintCollector<A,B,C,D,?,NewD> collectorD)
<NewA> UniLeftHandSide<NewA>
andGroupBy(QuadConstraintCollector<A,B,C,D,?,NewA> collector)
<NewA,NewB>
BiLeftHandSide<NewA,NewB>andGroupBy(QuadConstraintCollector<A,B,C,D,?,NewA> collectorA, QuadConstraintCollector<A,B,C,D,?,NewB> collectorB)
<NewA,NewB,NewC>
TriLeftHandSide<NewA,NewB,NewC>andGroupBy(QuadConstraintCollector<A,B,C,D,?,NewA> collectorA, QuadConstraintCollector<A,B,C,D,?,NewB> collectorB, QuadConstraintCollector<A,B,C,D,?,NewC> collectorC)
<NewA,NewB,NewC,NewD>
QuadLeftHandSide<NewA,NewB,NewC,NewD>andGroupBy(QuadConstraintCollector<A,B,C,D,?,NewA> collectorA, QuadConstraintCollector<A,B,C,D,?,NewB> collectorB, QuadConstraintCollector<A,B,C,D,?,NewC> collectorC, QuadConstraintCollector<A,B,C,D,?,NewD> collectorD)
<NewA> UniLeftHandSide<NewA>
andMap(QuadFunction<A,B,C,D,NewA> mapping)
<E> QuadLeftHandSide<A,B,C,D>
andNotExists(Class<E> dClass, PentaJoiner<A,B,C,D,E>[] joiners, Predicate<E> nullityFilter)
<Solution_>
RuleBuilder<Solution_>andTerminate()
<Solution_>
RuleBuilder<Solution_>andTerminate(QuadFunction<A,B,C,D,BigDecimal> matchWeighter)
<Solution_>
RuleBuilder<Solution_>andTerminate(ToIntQuadFunction<A,B,C,D> matchWeighter)
<Solution_>
RuleBuilder<Solution_>andTerminate(ToLongQuadFunction<A,B,C,D> matchWeighter)
protected static org.drools.model.view.ViewItem<?>
buildAccumulate(org.drools.model.view.ViewItem<?> innerAccumulatePattern, org.drools.model.functions.accumulate.AccumulateFunction... accFunctions)
protected static <A,B>
org.optaplanner.core.impl.score.stream.drools.common.IndirectPatternVariable<B,BiTuple<A,B>>decompose(org.drools.model.Variable<BiTuple<A,B>> primaryVariable, org.drools.model.view.ViewItem<?> prerequisitePattern, org.drools.model.Variable<A> boundVarA, org.drools.model.Variable<B> boundVarB)
Create anIndirectPatternVariable
onBiTuple
with pre-made bindings for its components variables.protected static <A,B,C,D>
org.optaplanner.core.impl.score.stream.drools.common.IndirectPatternVariable<D,QuadTuple<A,B,C,D>>decompose(org.drools.model.Variable<QuadTuple<A,B,C,D>> primaryVariable, org.drools.model.view.ViewItem<?> prerequisitePattern, org.drools.model.Variable<A> boundVarA, org.drools.model.Variable<B> boundVarB, org.drools.model.Variable<C> boundVarC, org.drools.model.Variable<D> boundVarD)
Create anIndirectPatternVariable
onQuadTuple
with pre-made bindings for its components variables.protected static <A,B,C>
org.optaplanner.core.impl.score.stream.drools.common.IndirectPatternVariable<C,TriTuple<A,B,C>>decompose(org.drools.model.Variable<TriTuple<A,B,C>> primaryVariable, org.drools.model.view.ViewItem<?> prerequisitePattern, org.drools.model.Variable<A> boundVarA, org.drools.model.Variable<B> boundVarB, org.drools.model.Variable<C> boundVarC)
Create anIndirectPatternVariable
onTriTuple
with pre-made bindings for its components variables.protected static <A,B,C>
org.optaplanner.core.impl.score.stream.drools.common.DirectPatternVariable<C>decomposeWithAccumulate(org.drools.model.Variable<BiTuple<A,B>> primaryVariable, org.drools.model.view.ViewItem<?> prerequisitePattern, org.drools.model.Variable<A> boundVarA, org.drools.model.Variable<B> boundVarB, org.drools.model.Variable<C> accumulateOutput)
Create aDirectPatternVariable
onBiTuple
with pre-made bindings for its components variables and one accumulate output variable.protected static <A,B,C,D>
org.optaplanner.core.impl.score.stream.drools.common.DirectPatternVariable<D>decomposeWithAccumulate(org.drools.model.Variable<TriTuple<A,B,C>> primaryVariable, org.drools.model.view.ViewItem<?> prerequisitePattern, org.drools.model.Variable<A> boundVarA, org.drools.model.Variable<B> boundVarB, org.drools.model.Variable<C> boundVarC, org.drools.model.Variable<D> accumulateOutput)
Create aDirectPatternVariable
onTriTuple
with pre-made bindings for its components variables and one accumulate output variable.protected static org.drools.model.Index.ConstraintType
getConstraintType(JoinerType type)
protected static org.drools.model.view.ViewItem<?>
joinViewItemsWithLogicalAnd(PatternVariable<?,?,?>... patternVariables)
protected static List<org.drools.model.view.ViewItem<?>>
mergeViewItems(PatternVariable<?,?,?>... patternVariables)
-
-
-
Field Detail
-
variableFactory
protected final DroolsVariableFactory variableFactory
-
-
Constructor Detail
-
QuadLeftHandSide
protected QuadLeftHandSide(org.drools.model.Variable<A> variableA, org.drools.model.Variable<B> variableB, org.drools.model.Variable<C> variableC, PatternVariable<D,?,?> patternVariableD, DroolsVariableFactory variableFactory)
-
QuadLeftHandSide
protected QuadLeftHandSide(PatternVariable<A,?,?> patternVariableA, PatternVariable<B,?,?> patternVariableB, PatternVariable<C,?,?> patternVariableC, PatternVariable<D,?,?> patternVariableD, DroolsVariableFactory variableFactory)
-
-
Method Detail
-
andFilter
public QuadLeftHandSide<A,B,C,D> andFilter(QuadPredicate<A,B,C,D> predicate)
-
andExists
public <E> QuadLeftHandSide<A,B,C,D> andExists(Class<E> dClass, PentaJoiner<A,B,C,D,E>[] joiners, Predicate<E> nullityFilter)
-
andNotExists
public <E> QuadLeftHandSide<A,B,C,D> andNotExists(Class<E> dClass, PentaJoiner<A,B,C,D,E>[] joiners, Predicate<E> nullityFilter)
-
andGroupBy
public <NewA> UniLeftHandSide<NewA> andGroupBy(QuadConstraintCollector<A,B,C,D,?,NewA> collector)
-
andGroupBy
public <NewA,NewB> BiLeftHandSide<NewA,NewB> andGroupBy(QuadConstraintCollector<A,B,C,D,?,NewA> collectorA, QuadConstraintCollector<A,B,C,D,?,NewB> collectorB)
-
andGroupBy
public <NewA,NewB,NewC> TriLeftHandSide<NewA,NewB,NewC> andGroupBy(QuadConstraintCollector<A,B,C,D,?,NewA> collectorA, QuadConstraintCollector<A,B,C,D,?,NewB> collectorB, QuadConstraintCollector<A,B,C,D,?,NewC> collectorC)
-
andGroupBy
public <NewA,NewB,NewC,NewD> QuadLeftHandSide<NewA,NewB,NewC,NewD> andGroupBy(QuadConstraintCollector<A,B,C,D,?,NewA> collectorA, QuadConstraintCollector<A,B,C,D,?,NewB> collectorB, QuadConstraintCollector<A,B,C,D,?,NewC> collectorC, QuadConstraintCollector<A,B,C,D,?,NewD> collectorD)
-
andGroupBy
public <NewA> UniLeftHandSide<NewA> andGroupBy(QuadFunction<A,B,C,D,NewA> keyMapping)
-
andGroupBy
public <NewA,NewB> BiLeftHandSide<NewA,NewB> andGroupBy(QuadFunction<A,B,C,D,NewA> keyMappingA, QuadConstraintCollector<A,B,C,D,?,NewB> collectorB)
-
andGroupBy
public <NewA,NewB,NewC> TriLeftHandSide<NewA,NewB,NewC> andGroupBy(QuadFunction<A,B,C,D,NewA> keyMappingA, QuadConstraintCollector<A,B,C,D,?,NewB> collectorB, QuadConstraintCollector<A,B,C,D,?,NewC> collectorC)
-
andGroupBy
public <NewA,NewB,NewC,NewD> QuadLeftHandSide<NewA,NewB,NewC,NewD> andGroupBy(QuadFunction<A,B,C,D,NewA> keyMappingA, QuadConstraintCollector<A,B,C,D,?,NewB> collectorB, QuadConstraintCollector<A,B,C,D,?,NewC> collectorC, QuadConstraintCollector<A,B,C,D,?,NewD> collectorD)
-
andGroupBy
public <NewA,NewB> BiLeftHandSide<NewA,NewB> andGroupBy(QuadFunction<A,B,C,D,NewA> keyMappingA, QuadFunction<A,B,C,D,NewB> keyMappingB)
-
andGroupBy
public <NewA,NewB,NewC> TriLeftHandSide<NewA,NewB,NewC> andGroupBy(QuadFunction<A,B,C,D,NewA> keyMappingA, QuadFunction<A,B,C,D,NewB> keyMappingB, QuadConstraintCollector<A,B,C,D,?,NewC> collectorC)
-
andGroupBy
public <NewA,NewB,NewC,NewD> QuadLeftHandSide<NewA,NewB,NewC,NewD> andGroupBy(QuadFunction<A,B,C,D,NewA> keyMappingA, QuadFunction<A,B,C,D,NewB> keyMappingB, QuadConstraintCollector<A,B,C,D,?,NewC> collectorC, QuadConstraintCollector<A,B,C,D,?,NewD> collectorD)
-
andGroupBy
public <NewA,NewB,NewC> TriLeftHandSide<NewA,NewB,NewC> andGroupBy(QuadFunction<A,B,C,D,NewA> keyMappingA, QuadFunction<A,B,C,D,NewB> keyMappingB, QuadFunction<A,B,C,D,NewC> keyMappingC)
-
andGroupBy
public <NewA,NewB,NewC,NewD> QuadLeftHandSide<NewA,NewB,NewC,NewD> andGroupBy(QuadFunction<A,B,C,D,NewA> keyMappingA, QuadFunction<A,B,C,D,NewB> keyMappingB, QuadFunction<A,B,C,D,NewC> keyMappingC, QuadConstraintCollector<A,B,C,D,?,NewD> collectorD)
-
andGroupBy
public <NewA,NewB,NewC,NewD> QuadLeftHandSide<NewA,NewB,NewC,NewD> andGroupBy(QuadFunction<A,B,C,D,NewA> keyMappingA, QuadFunction<A,B,C,D,NewB> keyMappingB, QuadFunction<A,B,C,D,NewC> keyMappingC, QuadFunction<A,B,C,D,NewD> keyMappingD)
-
andMap
public <NewA> UniLeftHandSide<NewA> andMap(QuadFunction<A,B,C,D,NewA> mapping)
-
andFlattenLast
public <NewD> QuadLeftHandSide<A,B,C,NewD> andFlattenLast(Function<D,Iterable<NewD>> mapping)
-
andTerminate
public <Solution_> RuleBuilder<Solution_> andTerminate()
-
andTerminate
public <Solution_> RuleBuilder<Solution_> andTerminate(ToIntQuadFunction<A,B,C,D> matchWeighter)
-
andTerminate
public <Solution_> RuleBuilder<Solution_> andTerminate(ToLongQuadFunction<A,B,C,D> matchWeighter)
-
andTerminate
public <Solution_> RuleBuilder<Solution_> andTerminate(QuadFunction<A,B,C,D,BigDecimal> matchWeighter)
-
getConstraintType
protected static org.drools.model.Index.ConstraintType getConstraintType(JoinerType type)
-
joinViewItemsWithLogicalAnd
protected static org.drools.model.view.ViewItem<?> joinViewItemsWithLogicalAnd(PatternVariable<?,?,?>... patternVariables)
-
mergeViewItems
protected static List<org.drools.model.view.ViewItem<?>> mergeViewItems(PatternVariable<?,?,?>... patternVariables)
-
decompose
protected static <A,B> org.optaplanner.core.impl.score.stream.drools.common.IndirectPatternVariable<B,BiTuple<A,B>> decompose(org.drools.model.Variable<BiTuple<A,B>> primaryVariable, org.drools.model.view.ViewItem<?> prerequisitePattern, org.drools.model.Variable<A> boundVarA, org.drools.model.Variable<B> boundVarB)
Create anIndirectPatternVariable
onBiTuple
with pre-made bindings for its components variables.- Type Parameters:
A
- generic type of the first bound variableB
- generic type of the second bound variable- Parameters:
primaryVariable
- never nullprerequisitePattern
- never null, pattern required to construct the variableboundVarA
- never null,BiTuple.a
boundVarB
- never null,BiTuple.b
- Returns:
- never null
-
decomposeWithAccumulate
protected static <A,B,C> org.optaplanner.core.impl.score.stream.drools.common.DirectPatternVariable<C> decomposeWithAccumulate(org.drools.model.Variable<BiTuple<A,B>> primaryVariable, org.drools.model.view.ViewItem<?> prerequisitePattern, org.drools.model.Variable<A> boundVarA, org.drools.model.Variable<B> boundVarB, org.drools.model.Variable<C> accumulateOutput)
Create aDirectPatternVariable
onBiTuple
with pre-made bindings for its components variables and one accumulate output variable.- Type Parameters:
A
- generic type of the first bound variableB
- generic type of the second bound variableC
- generic type of the accumulate output variable- Parameters:
primaryVariable
- never nullprerequisitePattern
- never null, pattern required to construct the variableboundVarA
- never null,TriTuple.a
boundVarB
- never null,TriTuple.b
accumulateOutput
- never null, output of the accumulate function- Returns:
- never null
-
decompose
protected static <A,B,C> org.optaplanner.core.impl.score.stream.drools.common.IndirectPatternVariable<C,TriTuple<A,B,C>> decompose(org.drools.model.Variable<TriTuple<A,B,C>> primaryVariable, org.drools.model.view.ViewItem<?> prerequisitePattern, org.drools.model.Variable<A> boundVarA, org.drools.model.Variable<B> boundVarB, org.drools.model.Variable<C> boundVarC)
Create anIndirectPatternVariable
onTriTuple
with pre-made bindings for its components variables.- Type Parameters:
A
- generic type of the first bound variableB
- generic type of the second bound variableC
- generic type of the third bound variable- Parameters:
primaryVariable
- never nullprerequisitePattern
- never null, pattern required to construct the variableboundVarA
- never null,TriTuple.a
boundVarB
- never null,TriTuple.b
boundVarC
- never null,TriTuple.c
- Returns:
- never null
-
decompose
protected static <A,B,C,D> org.optaplanner.core.impl.score.stream.drools.common.IndirectPatternVariable<D,QuadTuple<A,B,C,D>> decompose(org.drools.model.Variable<QuadTuple<A,B,C,D>> primaryVariable, org.drools.model.view.ViewItem<?> prerequisitePattern, org.drools.model.Variable<A> boundVarA, org.drools.model.Variable<B> boundVarB, org.drools.model.Variable<C> boundVarC, org.drools.model.Variable<D> boundVarD)
Create anIndirectPatternVariable
onQuadTuple
with pre-made bindings for its components variables.- Type Parameters:
A
- generic type of the first bound variableB
- generic type of the second bound variableC
- generic type of the third bound variableD
- generic type of the fourth bound variable- Parameters:
primaryVariable
- never nullprerequisitePattern
- never null, pattern required to construct the variableboundVarA
- never null,QuadTuple.a
boundVarB
- never null,QuadTuple.b
boundVarC
- never null,QuadTuple.c
boundVarD
- never null,QuadTuple.d
- Returns:
- never null
-
decomposeWithAccumulate
protected static <A,B,C,D> org.optaplanner.core.impl.score.stream.drools.common.DirectPatternVariable<D> decomposeWithAccumulate(org.drools.model.Variable<TriTuple<A,B,C>> primaryVariable, org.drools.model.view.ViewItem<?> prerequisitePattern, org.drools.model.Variable<A> boundVarA, org.drools.model.Variable<B> boundVarB, org.drools.model.Variable<C> boundVarC, org.drools.model.Variable<D> accumulateOutput)
Create aDirectPatternVariable
onTriTuple
with pre-made bindings for its components variables and one accumulate output variable.- Type Parameters:
A
- generic type of the first bound variableB
- generic type of the second bound variableC
- generic type of the third bound variableD
- generic type of the accumulate output variable- Parameters:
primaryVariable
- never nullprerequisitePattern
- never null, pattern required to construct the variableboundVarA
- never null,TriTuple.a
boundVarB
- never null,TriTuple.b
boundVarC
- never null,TriTuple.c
accumulateOutput
- never null, output of the accumulate function- Returns:
- never null
-
buildAccumulate
protected static org.drools.model.view.ViewItem<?> buildAccumulate(org.drools.model.view.ViewItem<?> innerAccumulatePattern, org.drools.model.functions.accumulate.AccumulateFunction... accFunctions)
-
-