Package org.drools.drl.ast.dsl.impl
Class AccumulateDescrBuilderImpl<P extends DescrBuilder<?,?>>
java.lang.Object
org.drools.drl.ast.dsl.impl.BaseDescrBuilderImpl<P,AccumulateDescr>
org.drools.drl.ast.dsl.impl.AccumulateDescrBuilderImpl<P>
- All Implemented Interfaces:
AccumulateDescrBuilder<P>,DescrBuilder<P,AccumulateDescr>
- Direct Known Subclasses:
GroupByDescrBuilderImpl
public class AccumulateDescrBuilderImpl<P extends DescrBuilder<?,?>>
extends BaseDescrBuilderImpl<P,AccumulateDescr>
implements AccumulateDescrBuilder<P>
An implementation for the CollectDescrBuilder
-
Field Summary
Fields inherited from class org.drools.drl.ast.dsl.impl.BaseDescrBuilderImpl
descr, parent -
Constructor Summary
ConstructorsModifierConstructorDescriptionAccumulateDescrBuilderImpl(P parent) protectedAccumulateDescrBuilderImpl(P parent, AccumulateDescr accumulateDescr) -
Method Summary
Modifier and TypeMethodDescriptionFor accumulate CEs that use custom code blocks, this call sets the content of the action code block.constraint(String constr) For accumulate CEs that use accumulate functions, this call instantiate one accumulate function call.For accumulate CEs that use custom code blocks, this call sets the content of the init code block.pattern()For accumulate CEs that use custom code blocks, this call sets the content of the result expression.For accumulate CEs that use custom code blocks, this call sets the content of the reverse code block.source()Defines the source CE for the Accumulate CE.Methods inherited from class org.drools.drl.ast.dsl.impl.BaseDescrBuilderImpl
end, endCharacter, endLocation, getDescr, getParent, startCharacter, startLocationMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.drools.drl.ast.dsl.AccumulateDescrBuilder
endMethods inherited from interface org.drools.drl.ast.dsl.DescrBuilder
endCharacter, endLocation, getDescr, getParent, startCharacter, startLocation
-
Constructor Details
-
AccumulateDescrBuilderImpl
-
AccumulateDescrBuilderImpl
-
-
Method Details
-
pattern
-
pattern
-
source
Description copied from interface:AccumulateDescrBuilderDefines the source CE for the Accumulate CE. It is always an AND descriptor that contains one or more Patterns and other CEs.- Specified by:
sourcein interfaceAccumulateDescrBuilder<P extends DescrBuilder<?,?>> - Returns:
- the CEDescrBuilder for the source CE
-
function
public AccumulateDescrBuilder<P> function(String name, String bind, boolean unif, String... parameters) Description copied from interface:AccumulateDescrBuilderFor accumulate CEs that use accumulate functions, this call instantiate one accumulate function call. Example: ... accumulate( X(), $sum : sum( $value ) ) Requires the call to this method with parameters: function( "sum", "$sum", new String[] { "$value" } ) Please note that accumulate supports multiple function calls and this method should be called for each function call. Accumulate uses either accumulate functions or the custom code blocks (init/action/reverse/result). It is not possible to mix them.- Specified by:
functionin interfaceAccumulateDescrBuilder<P extends DescrBuilder<?,?>> - Parameters:
name- the name of the function being called. Mandatory non-null parameter.bind- the name of the bound variable if there is one. Null if no binding should be made.unif- true if the bound variable is expected to unify with the result of the acc function. false otherwiseparameters- the array of parameters to the function.- Returns:
- itself, so that it can be used as a fluent API
-
init
Description copied from interface:AccumulateDescrBuilderFor accumulate CEs that use custom code blocks, this call sets the content of the init code block. Please node that the use of custom code blocks is discouraged, as they are usually a bad practice. Accumulate uses either accumulate functions or the custom code blocks (init/action/reverse/result). It is not possible to mix them.- Specified by:
initin interfaceAccumulateDescrBuilder<P extends DescrBuilder<?,?>> - Parameters:
block- the code for this block- Returns:
- itself, so that it can be used as a fluent API
-
action
Description copied from interface:AccumulateDescrBuilderFor accumulate CEs that use custom code blocks, this call sets the content of the action code block. Please node that the use of custom code blocks is discouraged, as they are usually a bad practice. Accumulate uses either accumulate functions or the custom code blocks (init/action/reverse/result). It is not possible to mix them.- Specified by:
actionin interfaceAccumulateDescrBuilder<P extends DescrBuilder<?,?>> - Parameters:
block- the code for this block- Returns:
- itself, so that it can be used as a fluent API
-
reverse
Description copied from interface:AccumulateDescrBuilderFor accumulate CEs that use custom code blocks, this call sets the content of the reverse code block. Please node that the use of custom code blocks is discouraged, as they are usually a bad practice. Accumulate uses either accumulate functions or the custom code blocks (init/action/reverse/result). It is not possible to mix them.- Specified by:
reversein interfaceAccumulateDescrBuilder<P extends DescrBuilder<?,?>> - Parameters:
block- the code for this block- Returns:
- itself, so that it can be used as a fluent API
-
result
Description copied from interface:AccumulateDescrBuilderFor accumulate CEs that use custom code blocks, this call sets the content of the result expression. Please node that the use of custom code blocks is discouraged, as they are usually a bad practice. Accumulate uses either accumulate functions or the custom code blocks (init/action/reverse/result). It is not possible to mix them.- Specified by:
resultin interfaceAccumulateDescrBuilder<P extends DescrBuilder<?,?>> - Parameters:
expr- the return expr- Returns:
- itself, so that it can be used as a fluent API
-
constraint
- Specified by:
constraintin interfaceAccumulateDescrBuilder<P extends DescrBuilder<?,?>>
-