public class Java8Engine extends Engine
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.DEFAULT_INPUT_NAME, inputName, javascriptFilesToLoad, parsedRules, poolSize, throwExceptionIfCompilationFails, uniqueOutcomes| Constructor and Description |
|---|
Java8Engine(Collection<Rule> rules,
boolean throwExceptionIfCompilationFails)
See
#Engine(java.util.Collection, boolean). |
Java8Engine(Stream<Rule> rules,
boolean throwExceptionIfCompilationFails)
See
#Engine(java.util.Collection, boolean). |
| 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, executeAllActions, executeAllActions, executeBestAction, executeBestAction, getBestOutcome, getBestOutcome, getMatchingRules, getMatchingRules, initpublic Java8Engine(Stream<Rule> rules, boolean throwExceptionIfCompilationFails) throws DuplicateNameException, CompileException, ParseException
public Java8Engine(Collection<Rule> rules, boolean throwExceptionIfCompilationFails) throws DuplicateNameException, CompileException, ParseException
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.