Class And

  • All Implemented Interfaces:
    Expression

    class And
    extends java.lang.Object
    implements Expression
    Expression for the logical "and" operator.
    Since:
    0.7.0
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private Expression left
      The left-hand operand of expression.
      private Expression right
      The right-hand operand of expression.
    • Constructor Summary

      Constructors 
      Constructor Description
      And​(Expression left, Expression right)
      Constructs a And expression with the left-hand and right-hand operands.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean interpret​(Version version)
      Checks if both operands evaluate to true.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • left

        private final Expression left
        The left-hand operand of expression.
      • right

        private final Expression right
        The right-hand operand of expression.
    • Constructor Detail

      • And

        And​(Expression left,
            Expression right)
        Constructs a And expression with the left-hand and right-hand operands.
        Parameters:
        left - the left-hand operand of expression
        right - the right-hand operand of expression
    • Method Detail

      • interpret

        public boolean interpret​(Version version)
        Checks if both operands evaluate to true.
        Specified by:
        interpret in interface Expression
        Parameters:
        version - the version to interpret against
        Returns:
        true if both operands evaluate to true or false otherwise