Package ru.ewc.decita
Class DecisionTable
java.lang.Object
ru.ewc.decita.DecisionTable
- All Implemented Interfaces:
Locator
I am a collection of
Rule
s used to compute any kind of decision. My main responsibility
is to orchestrate the computation and choose the only satisfied Rule
.- Since:
- 0.1
-
Field Summary
Fields inherited from interface ru.ewc.decita.Locator
CONSTANT_VALUES
-
Constructor Summary
ConstructorDescriptionDecisionTable
(Iterable<Rule> rules) Ctor.DecisionTable
(Iterable<Rule> rules, Rule elserule) Ctor. -
Method Summary
Modifier and TypeMethodDescriptionfragmentBy
(String fragment, ComputationContext context) Determines the system's state - the value of a single property, described by its name.outcome
(ComputationContext context) Computes this table's outcomes by checking all of itsRule
s.
-
Constructor Details
-
Method Details
-
fragmentBy
Description copied from interface:Locator
Determines the system's state - the value of a single property, described by its name.- Specified by:
fragmentBy
in interfaceLocator
- Parameters:
fragment
- The String identifier of the required property.context
- TheComputationContext
to use in property retrieval.- Returns:
- The value of the requested property as a
String
. - Throws:
DecitaException
- When the requestedCoordinate
cannot be found.
-
outcome
Description copied from interface:Locator
Computes this table's outcomes by checking all of itsRule
s.- Specified by:
outcome
in interfaceLocator
- Parameters:
context
- The specificComputationContext
to make a decision in.- Returns:
- The simple dictionary of the table's outcomes.
- Throws:
DecitaException
- If any of theRule
s cannot be checked.
-