public class Java8JavascriptEngine extends JavascriptEngine
Streams being used with the engine.
//to use a lambda, construct a SamAction and pass it a lambda.
IAction action1 = new SamAction("outcome1", i -> new BigDecimal("100.0"));
IAction action2 = new SamAction("outcome2", i -> new BigDecimal("101.0"));
List> actions = Arrays.asList(action1, action2);
Engine e = new Engine(rules, true);
See Engine for more details.| Modifier and Type | Class and Description |
|---|---|
static class |
Java8JavascriptEngine.Builder |
DEFAULT_INPUT_NAME, inputName, javascriptFilesToLoad, parsedRules, poolSize, throwExceptionIfCompilationFails, uniqueOutcomes| Constructor and Description |
|---|
Java8JavascriptEngine(Collection<Rule> rules,
boolean throwExceptionIfCompilationFails,
String... javascriptFilesToLoad)
See
#JavascriptEngine(java.util.Collection, boolean, String...). |
Java8JavascriptEngine(Collection<Rule> rules,
String inputName,
boolean throwExceptionIfCompilationFails,
Integer poolSize,
boolean preloadPool,
String... javascriptFilesToLoad)
See
#JavascriptEngine(java.util.Collection, String, boolean, Integer, boolean, String...). |
Java8JavascriptEngine(Stream<Rule> rules,
boolean throwExceptionIfCompilationFails,
String... javascriptFilesToLoad)
See
#JavascriptEngine(java.util.Collection, boolean, String...). |
Java8JavascriptEngine(Stream<Rule> rules,
String inputName,
boolean throwExceptionIfCompilationFails,
Integer poolSize,
boolean preloadPool,
String... javascriptFilesToLoad)
See
#JavascriptEngine(java.util.Collection, String, boolean, Integer, boolean, String...). |
| Modifier and Type | Method and Description |
|---|---|
<Input,Output> |
executeAllActions(Input input,
Stream<IAction<Input,Output>> actions)
See
#executeAllActions(Object, java.util.Collection), supports Streams. |
<Input,Output> |
executeAllActions(String nameSpacePattern,
Input input,
Stream<IAction<Input,Output>> actions)
See
#executeAllActions(String nameSpacePattern, Object, java.util.Collection), supports Streams. |
<Input,Output> |
executeBestAction(Input input,
Stream<IAction<Input,Output>> actions)
See
#executeBestAction(Object, java.util.Collection), supports Streams. |
<Input,Output> |
executeBestAction(String nameSpacePattern,
Input input,
Stream<IAction<Input,Output>> actions)
See
#executeBestAction(String nameSpacePattern, Object, java.util.Collection), supports Streams. |
compile, getMatchingRules, getPoolConfig, getPoolSizeexecuteAllActions, executeAllActions, executeBestAction, executeBestAction, getBestOutcome, getBestOutcome, getMatchingRules, initpublic Java8JavascriptEngine(Stream<Rule> rules, boolean throwExceptionIfCompilationFails, String... javascriptFilesToLoad) throws DuplicateNameException, CompileException, ParseException
public Java8JavascriptEngine(Collection<Rule> rules, boolean throwExceptionIfCompilationFails, String... javascriptFilesToLoad) throws DuplicateNameException, CompileException, ParseException
public Java8JavascriptEngine(Stream<Rule> rules, String inputName, boolean throwExceptionIfCompilationFails, Integer poolSize, boolean preloadPool, String... javascriptFilesToLoad) throws DuplicateNameException, CompileException, ParseException
#JavascriptEngine(java.util.Collection, String, boolean, Integer, boolean, String...). Convenience constructor for use with Java 8 Streams.public Java8JavascriptEngine(Collection<Rule> rules, String inputName, boolean throwExceptionIfCompilationFails, Integer poolSize, boolean preloadPool, String... javascriptFilesToLoad) throws DuplicateNameException, CompileException, ParseException
#JavascriptEngine(java.util.Collection, String, boolean, Integer, boolean, String...). Convenience constructor for use with Java 8 Streams.public <Input,Output> Output executeBestAction(Input input,
Stream<IAction<Input,Output>> actions)
throws NoMatchingRuleFoundException,
NoActionFoundException,
DuplicateNameException
#executeBestAction(Object, java.util.Collection), supports Streams.public <Input,Output> Output executeBestAction(String nameSpacePattern, Input input, Stream<IAction<Input,Output>> actions) throws NoMatchingRuleFoundException, NoActionFoundException, DuplicateNameException
#executeBestAction(String nameSpacePattern, Object, java.util.Collection), supports Streams.public <Input,Output> void executeAllActions(Input input,
Stream<IAction<Input,Output>> actions)
throws NoMatchingRuleFoundException,
NoActionFoundException,
DuplicateNameException
#executeAllActions(Object, java.util.Collection), supports Streams.public <Input,Output> void executeAllActions(String nameSpacePattern, Input input, Stream<IAction<Input,Output>> actions) throws NoMatchingRuleFoundException, NoActionFoundException, DuplicateNameException
#executeAllActions(String nameSpacePattern, Object, java.util.Collection), supports Streams.Copyright © 2015 Ant Kutschera. All rights reserved.