Class Expression

java.lang.Object
com.aquima.interactions.rule.parser.Expression
All Implemented Interfaces:
IExpression, Serializable
Direct Known Subclasses:
Condition

public class Expression extends Object implements IExpression
This class holds a single expression.
Since:
5.0
Author:
O. Kerpershoek
See Also:
  • Constructor Details

    • Expression

      protected Expression(IExpr expr)
  • Method Details

    • getExpressionObj

      protected IExpr getExpressionObj()
    • getExpression

      public String getExpression()
      Description copied from interface: IExpression
      This method return the original (unparsed) expression.
      Specified by:
      getExpression in interface IExpression
      Returns:
      String containing the original expression.
    • getScopeObjects

      public String[] getScopeObjects()
      Description copied from interface: IExpression
      Returns a list of the entity names which could be used as root scope during expression evaluation. This does not necessarily mean these scope objects will be used. All returned scope objects are lowercase, since the expression evaluator is case-insensitive it sees them as lowercase.
      Specified by:
      getScopeObjects in interface IExpression
      Returns:
      Never null
    • getResultTypeName

      public String getResultTypeName()
    • evaluateWith

      public IValue evaluateWith(InferenceContext context)
      Description copied from interface: IExpression
      This method will evaluate the expression and return the result as a value object.
      Specified by:
      evaluateWith in interface IExpression
      Parameters:
      context - object containing the objects that are visible for the expression.
      Returns:
      Value object with the result of the expression.
    • getDataType

      public DataType getDataType()
      Description copied from interface: IExpression
      This method will return the expected output data type of the expression. Never null but in some cases it can be DataType.ANY if it is unknown.
      Specified by:
      getDataType in interface IExpression
      Returns:
      DataType
    • isMultivalue

      public boolean isMultivalue()
      Description copied from interface: IExpression
      Returns whether the output of the expression is a list.
      Specified by:
      isMultivalue in interface IExpression
      Returns:
      boolean
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object