Class Expression

  • All Implemented Interfaces:
    Comparable<Item>, Iterable<Item>, Debug, Display
    Direct Known Subclasses:
    Func, Operator, Selector

    public abstract class Expression
    extends Value
    A combination of operators, constants, and variables. Every Item in the Swim data model can be evaluated against a scope. An Expression is some Value that, when evaluated, may yield a different value than the Expression itself. Note that this is a stricter definition than that of a logical expression; for example, the number 2 is a valid expression, but it is not an Expression.

    An Expression can be either a Selector or an Operator. A Selector references specific attributes of a Swim model instance. An Operator identifies an operation on constants, variables, or Selector expressions. Together, these form a foundation for building expression languages that can both manipulate and read Swim objects.