org.drools.lang.api.impl
Class AccumulateDescrBuilderImpl<P extends DescrBuilder<?,?>>

java.lang.Object
  extended by org.drools.lang.api.impl.BaseDescrBuilderImpl<P,AccumulateDescr>
      extended by org.drools.lang.api.impl.AccumulateDescrBuilderImpl<P>
All Implemented Interfaces:
AccumulateDescrBuilder<P>, DescrBuilder<P,AccumulateDescr>

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.lang.api.impl.BaseDescrBuilderImpl
descr, parent
 
Constructor Summary
AccumulateDescrBuilderImpl(P parent)
           
 
Method Summary
 AccumulateDescrBuilder<P> action(String block)
          For accumulate CEs that use custom code blocks, this call sets the content of the action code block.
 AccumulateDescrBuilder<P> function(String name, String bind, String[] parameters)
          For accumulate CEs that use accumulate functions, this call instantiate one accumulate function call.
 AccumulateDescrBuilder<P> init(String block)
          For accumulate CEs that use custom code blocks, this call sets the content of the init code block.
 AccumulateDescrBuilder<P> multiFunction(boolean multifunct)
           
 PatternDescrBuilder<AccumulateDescrBuilder<P>> pattern()
          
 PatternDescrBuilder<AccumulateDescrBuilder<P>> pattern(String type)
          
 AccumulateDescrBuilder<P> result(String expr)
          For accumulate CEs that use custom code blocks, this call sets the content of the result expression.
 AccumulateDescrBuilder<P> reverse(String block)
          For accumulate CEs that use custom code blocks, this call sets the content of the reverse code block.
 CEDescrBuilder<AccumulateDescrBuilder<P>,AndDescr> source()
          Defines the source CE for the Accumulate CE.
 
Methods inherited from class org.drools.lang.api.impl.BaseDescrBuilderImpl
end, endCharacter, endLocation, getDescr, startCharacter, startLocation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.drools.lang.api.AccumulateDescrBuilder
end
 
Methods inherited from interface org.drools.lang.api.DescrBuilder
endCharacter, endLocation, getDescr, startCharacter, startLocation
 

Constructor Detail

AccumulateDescrBuilderImpl

public AccumulateDescrBuilderImpl(P parent)
Method Detail

pattern

public PatternDescrBuilder<AccumulateDescrBuilder<P>> pattern(String type)


pattern

public PatternDescrBuilder<AccumulateDescrBuilder<P>> pattern()


source

public CEDescrBuilder<AccumulateDescrBuilder<P>,AndDescr> source()
Description copied from interface: AccumulateDescrBuilder
Defines the source CE for the Accumulate CE. It is always an AND descriptor that contains one or more Patterns and other CEs.

Specified by:
source in interface AccumulateDescrBuilder<P extends DescrBuilder<?,?>>
Returns:
the CEDescrBuilder for the source CE

function

public AccumulateDescrBuilder<P> function(String name,
                                          String bind,
                                          String[] parameters)
Description copied from interface: AccumulateDescrBuilder
For 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:
function in interface AccumulateDescrBuilder<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.
parameters - the array of parameters to the function.
Returns:
itself, so that it can be used as a fluent API

init

public AccumulateDescrBuilder<P> init(String block)
Description copied from interface: AccumulateDescrBuilder
For 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:
init in interface AccumulateDescrBuilder<P extends DescrBuilder<?,?>>
Parameters:
block - the code for this block
Returns:
itself, so that it can be used as a fluent API

action

public AccumulateDescrBuilder<P> action(String block)
Description copied from interface: AccumulateDescrBuilder
For 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:
action in interface AccumulateDescrBuilder<P extends DescrBuilder<?,?>>
Parameters:
block - the code for this block
Returns:
itself, so that it can be used as a fluent API

reverse

public AccumulateDescrBuilder<P> reverse(String block)
Description copied from interface: AccumulateDescrBuilder
For 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:
reverse in interface AccumulateDescrBuilder<P extends DescrBuilder<?,?>>
Parameters:
block - the code for this block
Returns:
itself, so that it can be used as a fluent API

result

public AccumulateDescrBuilder<P> result(String expr)
Description copied from interface: AccumulateDescrBuilder
For 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:
result in interface AccumulateDescrBuilder<P extends DescrBuilder<?,?>>
Parameters:
expr - the return expr
Returns:
itself, so that it can be used as a fluent API

multiFunction

public AccumulateDescrBuilder<P> multiFunction(boolean multifunct)
Specified by:
multiFunction in interface AccumulateDescrBuilder<P extends DescrBuilder<?,?>>


Copyright © 2001-2013 JBoss Inc.. All Rights Reserved.