Package ru.ewc.decita

Class ComputationContext

java.lang.Object
ru.ewc.decita.ComputationContext

public final class ComputationContext extends Object
I am the container for all the things, required for TruthTable evaluation. My main responsibility is to provide the set of Locators in order to find all the required Coordinates.
Since:
0.1
  • Constructor Details

    • ComputationContext

      public ComputationContext(Locators locators)
      Ctor.
      Parameters:
      locators - The Locators instance to use.
  • Method Details

    • valueFor

      public String valueFor(String locator, String fragment) throws DecitaException
      Finds a Coordinate's value using internal set of Locator's.
      Parameters:
      locator - String identifier of the Locator to use.
      fragment - String identifier of the value to find.
      Returns:
      The String value containing requested state.
      Throws:
      DecitaException - If the Locator wasn't found in the context.
    • decisionFor

      public Map<String,String> decisionFor(String name) throws DecitaException
      Computes the specified DecisionTable result as a Dictionary.
      Parameters:
      name - The name of the table to compute.
      Returns:
      The Dictionary containing the decision result.
      Throws:
      DecitaException - If the table could not be found or computed.