Class GroovyCycleFunction<T>
java.lang.Object
io.nosqlbench.adapters.api.evalctx.GroovyCycleFunction<T>
- All Implemented Interfaces:
CycleFunction<T>,ExpressionDetails,VariableInjectable,LongFunction<T>
- Direct Known Subclasses:
GroovyBooleanCycleFunction,GroovyObjectEqualityFunction
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionGroovyCycleFunction(String name, ParsedTemplateString template, List<String> imports, List<Class<?>> staticImports, groovy.lang.Binding binding) GroovyCycleFunction(String name, String scriptText, Map<String, String> bindingSpecs, List<String> imports, List<Class<?>> staticImports, groovy.lang.Binding binding) Instantiate a cycle function from basic types -
Method Summary
Modifier and TypeMethodDescriptionapply(long value) Produce a result from a cycle.protected String[]expandClassNames(List<String> groovyImportedClasses) Create an instance of an executable function which is based on the current one, with all of the per-cycle bindings as well as the variable bindings duplicated (shared).<V> voidsetVariable(String name, V value) Set a variable by name.
-
Field Details
-
scriptText
-
script
protected final groovy.lang.Script script -
variableBindings
protected final groovy.lang.Binding variableBindings -
bindingFunctions
-
-
Constructor Details
-
GroovyCycleFunction
public GroovyCycleFunction(String name, String scriptText, Map<String, String> bindingSpecs, List<String> imports, List<Class<?>> staticImports, groovy.lang.Binding binding) Instantiate a cycle function from basic types- Parameters:
scriptText- The raw script text, not including any bind point or capture point syntaxbindingSpecs- The names and recipes of bindings which are referenced in the scriptTextimports- The package imports to be installed into the execution environment
-
GroovyCycleFunction
-
-
Method Details
-
expandClassNames
-
getExpressionDetails
- Specified by:
getExpressionDetailsin interfaceExpressionDetails
-
setVariable
Description copied from interface:VariableInjectableSet a variable by name.- Specified by:
setVariablein interfaceVariableInjectable
-
apply
Description copied from interface:CycleFunctionProduce a result from a cycle. This is an encapsulating type for any implementations which need to- Specified by:
applyin interfaceCycleFunction<T>- Specified by:
applyin interfaceLongFunction<T>- Parameters:
value- the function argument- Returns:
-
newInstance
Create an instance of an executable function which is based on the current one, with all of the per-cycle bindings as well as the variable bindings duplicated (shared).- Specified by:
newInstancein interfaceCycleFunction<T>- Returns:
-