Class BetweenExpression

java.lang.Object
com.espertech.esper.common.client.soda.ExpressionBase
com.espertech.esper.common.client.soda.BetweenExpression
All Implemented Interfaces:
Expression, Serializable

public class BetweenExpression extends ExpressionBase
Between checks that a given value is in a range between a low endpoint and a high endpoint.

Closed and open ranges (endpoint included or excluded) are supported by this class, as is not-between.

See Also:
  • Constructor Details

    • BetweenExpression

      public BetweenExpression()
      Ctor.
    • BetweenExpression

      public BetweenExpression(Expression datapoint, Expression lower, Expression higher)
      Ctor, creates a between range check.
      Parameters:
      datapoint - provides the datapoint
      lower - provides lower boundary
      higher - provides upper boundary
    • BetweenExpression

      public BetweenExpression(boolean lowEndpointIncluded, boolean highEndpointIncluded, boolean notBetween)
      Ctor - for use to create an expression tree, without child expression.

      Use add methods to add child expressions to acts upon.

      Parameters:
      lowEndpointIncluded - true if the low endpoint is included, false if not
      highEndpointIncluded - true if the high endpoint is included, false if not
      notBetween - true for not-between, false for between
    • BetweenExpression

      public BetweenExpression(Expression datapoint, Expression lower, Expression higher, boolean lowEndpointIncluded, boolean highEndpointIncluded, boolean notBetween)
      Ctor.
      Parameters:
      datapoint - provides the datapoint
      lower - provides lower boundary
      higher - provides upper boundary
      lowEndpointIncluded - true if the low endpoint is included, false if not
      highEndpointIncluded - true if the high endpoint is included, false if not
      notBetween - true for not-between, false for between
  • Method Details

    • getPrecedence

      public ExpressionPrecedenceEnum getPrecedence()
      Description copied from interface: Expression
      Returns precedence.
      Returns:
      precedence
    • toPrecedenceFreeEPL

      public void toPrecedenceFreeEPL(StringWriter writer)
      Renders the clause in textual representation.
      Specified by:
      toPrecedenceFreeEPL in class ExpressionBase
      Parameters:
      writer - to output to
    • isLowEndpointIncluded

      public boolean isLowEndpointIncluded()
      True if the low endpoint is included.
      Returns:
      true for inclusive range.
    • setLowEndpointIncluded

      public void setLowEndpointIncluded(boolean lowEndpointIncluded)
      Set to true to indicate that the low endpoint is included (the default).
      Parameters:
      lowEndpointIncluded - true for inclusive
    • isHighEndpointIncluded

      public boolean isHighEndpointIncluded()
      True if the high endpoint is included.
      Returns:
      true for inclusive range.
    • setHighEndpointIncluded

      public void setHighEndpointIncluded(boolean highEndpointIncluded)
      Set to true to indicate that the high endpoint is included (the default).
      Parameters:
      highEndpointIncluded - true for inclusive
    • isNotBetween

      public boolean isNotBetween()
      Returns true for not-between, or false for between range.
      Returns:
      false is the default range check, true checks if the value is outside of the range
    • setNotBetween

      public void setNotBetween(boolean notBetween)
      Set to true for not-between, or false for between range.
      Parameters:
      notBetween - false is the default range check, true checks if the value is outside of the range