Class Operator

    • Constructor Detail

      • Operator

        protected Operator​(java.lang.String op)
        Constructs the Operator.
      • Operator

        protected Operator​(java.lang.String op,
                           int precedence)
      • Operator

        protected Operator​(java.lang.String op,
                           int precedence,
                           int set_type)
    • Method Detail

      • is

        public boolean is​(java.lang.String given_op)
        Returns true if this operator is equal to the operator string.
      • precedence

        public int precedence()
      • isCondition

        public boolean isCondition()
      • isMathematical

        public boolean isMathematical()
      • isPattern

        public boolean isPattern()
      • isLogical

        public boolean isLogical()
      • isNot

        public boolean isNot()
      • isSubQuery

        public boolean isSubQuery()
      • reverse

        public Operator reverse()
        Returns an Operator that is the reverse of this Operator. This is used for reversing a conditional expression. eg. 9 > id becomes id < 9.
      • isNotInversible

        public boolean isNotInversible()
        Returns true if this operator is not inversible.
      • inverse

        public Operator inverse()
        Returns the inverse operator of this operator. For example, = becomes <>, > becomes <=, AND becomes OR.
      • isSubQueryForm

        public boolean isSubQueryForm​(int type)
        Given a parameter of either NONE, ANY, ALL or SINGLE, this returns true if this operator is of the given type.
      • getSubQueryFormRepresentation

        int getSubQueryFormRepresentation()
        Returns the sub query representation of this operator.
      • getSubQueryForm

        public Operator getSubQueryForm​(int type)
        Returns the ANY or ALL form of this operator.
      • getSubQueryForm

        public Operator getSubQueryForm​(java.lang.String type_str)
        Same as above only it handles the type as a string.
      • returnTType

        public TType returnTType()
        The type of object this Operator evaluates to.
      • stringRepresentation

        java.lang.String stringRepresentation()
        Returns the string value of this operator.
      • toString

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

        public boolean equals​(java.lang.Object ob)
        Overrides:
        equals in class java.lang.Object
      • get

        public static Operator get​(java.lang.String op)
        Returns an Operator with the given string.
      • isTrue

        private static boolean isTrue​(TObject bool)
        Returns true if the given TObject is a boolean and is true. If the TObject is not a boolean value or is null or is false, then it returns false.