Class And

  • All Implemented Interfaces:
    Cond

    class And
    extends java.lang.Object
    implements Cond
    Represents the And type, a conditional which returns true if both left and right values are true. This operator short circuits, which means if the first value is false, the right value is not evaluated
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private Cond lVal  
      private Cond rVal  
    • Constructor Summary

      Constructors 
      Constructor Description
      And​(Cond lVal, Cond rVal)
      Constructor for the And conditional.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean eval()
      Evaluates the given conditional.
      Cond neg()
      negates the value of the conditional, without evaluating it.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

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

      • lVal

        private Cond lVal
      • rVal

        private Cond rVal
    • Constructor Detail

      • And

        public And​(Cond lVal,
                   Cond rVal)
        Constructor for the And conditional.
        Parameters:
        lVal - the left value in the And Operation.
        rVal - This is only evaluated if lVal is true
    • Method Detail

      • eval

        public boolean eval()
        Description copied from interface: Cond
        Evaluates the given conditional.
        Specified by:
        eval in interface Cond
        Returns:
        the boolean result of the evaluation
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • neg

        public Cond neg()
        Description copied from interface: Cond
        negates the value of the conditional, without evaluating it.
        Specified by:
        neg in interface Cond
        Returns:
        a new conditional, with the negated value