Enum BinaryOperator

    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      COMPARISON_EQ
      Given two values, check whether they have same values and same type.
      COMPARISON_GE
      Given two numeric values n1 and n2 of type NumericType, this operator checks if n1 is in relation through the "greater or equal than" relation with n2.
      COMPARISON_GT
      Given two numeric values n1 and n2, this operator checks if n1 is in relation through the "greater than" relation with n2.
      COMPARISON_LE
      Given two numeric values n1 and n2, this operator checks if n1 is in relation through the "less or equal than" relation with n2.
      COMPARISON_LT
      Given two numeric values n1 and n2, this operator checks if n1 is in relation through the "less than" relation with n2.
      COMPARISON_NE
      Given two values, check whether they have different values or different type.
      LOGICAL_AND
      Given two Boolean values b1 and b2 of type BooleanType, this operator returns the logical and between b1 and b2.
      LOGICAL_OR
      Given two Boolean values b1 and b2 of type BooleanType, this operator returns the logical or between b1 and b2.
      NUMERIC_ADD
      Given two integers values n1 and n2 of type NumericType, this operator returns the addition of n1 with n2.
      NUMERIC_DIV
      Given two integers values n1 and n2, with n2 not equal to zero, of type NumericType, this operator returns the division of i1 with n2.
      NUMERIC_MOD
      Given two integers values n1 and n2 of type NumericType, this operator returns the modulo of n1 with n2.
      NUMERIC_MUL
      Given two integers values n1 and n2 of type NumericType, this operator returns the multiplication of i1 with n2.
      NUMERIC_SUB
      Given two integers values n1 and n2 of type NumericType, this operator returns the subtraction of n1 with n2.
      STRING_CONCAT
      Given two string values s1 and s2 of type StringType, this operator return the concatenation of s1 with s2.
      STRING_CONTAINS
      Given two string values s1 and s2 of type StringType, this operator checks whether s1 contains s2.
      STRING_ENDS_WITH
      Given two string values s1 and s2 of type StringType, this operator checks whether s1 ends with s2, namely if s2 is the suffix of s1.
      STRING_EQUALS
      Given two string values s1 and s2 of type StringType, this operator checks if the two strings are equals.
      STRING_INDEX_OF
      Given two string values s1 and s2 of type StringType, this operator return the position of the first occurrence of s1 in s2.
      STRING_STARTS_WITH
      Given two string values s1 and s2 of type StringType, this operator checks whether s1 starts with s2, namely if s2 is the prefix of s1.
      TYPE_CAST
      Casts the type of the left-hand side of this expression to the type of the right-hand side.
      TYPE_CHECK
      Tests if the type of the left-hand side of this expression is the same as, or a subtype of, the type of the right-hand side.
      TYPE_CONV
      Converts the type of the left-hand side of this expression to the type of the right-hand side.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getStringRepresentation()
      Yields the string representation of the operator.
      java.lang.String toString()  
      static BinaryOperator valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static BinaryOperator[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • NUMERIC_SUB

        public static final BinaryOperator NUMERIC_SUB
        Given two integers values n1 and n2 of type NumericType, this operator returns the subtraction of n1 with n2. The return type of this operator is NumericType.
      • NUMERIC_ADD

        public static final BinaryOperator NUMERIC_ADD
        Given two integers values n1 and n2 of type NumericType, this operator returns the addition of n1 with n2. The return type of this operator is NumericType.
      • NUMERIC_DIV

        public static final BinaryOperator NUMERIC_DIV
        Given two integers values n1 and n2, with n2 not equal to zero, of type NumericType, this operator returns the division of i1 with n2. The return type of this operator is NumericType. If n1 is divisible by n2, the return type is the Type.commonSupertype(it.unive.lisa.type.Type) between the types of n1 and n2.
      • NUMERIC_MUL

        public static final BinaryOperator NUMERIC_MUL
        Given two integers values n1 and n2 of type NumericType, this operator returns the multiplication of i1 with n2. The return type of this operator is NumericType.
      • NUMERIC_MOD

        public static final BinaryOperator NUMERIC_MOD
        Given two integers values n1 and n2 of type NumericType, this operator returns the modulo of n1 with n2. The return type of this operator is a 32 bit unsigned integer NumericType.
      • LOGICAL_OR

        public static final BinaryOperator LOGICAL_OR
        Given two Boolean values b1 and b2 of type BooleanType, this operator returns the logical or between b1 and b2. No short-circuit mechanism is provided, hence both b1 and b2 are evaluated The return type of this operator is BooleanType.
      • LOGICAL_AND

        public static final BinaryOperator LOGICAL_AND
        Given two Boolean values b1 and b2 of type BooleanType, this operator returns the logical and between b1 and b2. No short-circuit mechanism is provided, hence both b1 and b2 are evaluated The return type of this operator is BooleanType.
      • COMPARISON_NE

        public static final BinaryOperator COMPARISON_NE
        Given two values, check whether they have different values or different type. If so, true value is returned, false otherwise. This operator corresponds to the logical negation of COMPARISON_EQ. The return type of this operator is BooleanType.
      • COMPARISON_EQ

        public static final BinaryOperator COMPARISON_EQ
        Given two values, check whether they have same values and same type. If so, true value is returned, false otherwise. This operator corresponds to the logical negation of COMPARISON_NE. The return type of this operator is BooleanType.
      • COMPARISON_GE

        public static final BinaryOperator COMPARISON_GE
        Given two numeric values n1 and n2 of type NumericType, this operator checks if n1 is in relation through the "greater or equal than" relation with n2. If so, true value is returned, false otherwise. The return type of this operator is BooleanType.
      • COMPARISON_GT

        public static final BinaryOperator COMPARISON_GT
        Given two numeric values n1 and n2, this operator checks if n1 is in relation through the "greater than" relation with n2. If so, true value is returned, false otherwise. The return type of this operator is BooleanType.
      • COMPARISON_LE

        public static final BinaryOperator COMPARISON_LE
        Given two numeric values n1 and n2, this operator checks if n1 is in relation through the "less or equal than" relation with n2. If so, true value is returned, false otherwise. The return type of this operator is BooleanType.
      • COMPARISON_LT

        public static final BinaryOperator COMPARISON_LT
        Given two numeric values n1 and n2, this operator checks if n1 is in relation through the "less than" relation with n2. If so, true value is returned, false otherwise. The return type of this operator is BooleanType.
      • STRING_CONCAT

        public static final BinaryOperator STRING_CONCAT
        Given two string values s1 and s2 of type StringType, this operator return the concatenation of s1 with s2. The neutral element is the empty string. The return type of this operator is StringType.
      • STRING_CONTAINS

        public static final BinaryOperator STRING_CONTAINS
        Given two string values s1 and s2 of type StringType, this operator checks whether s1 contains s2. If s2 is the empty string, then true is returned. The return type of this operator is BooleanType.
      • STRING_STARTS_WITH

        public static final BinaryOperator STRING_STARTS_WITH
        Given two string values s1 and s2 of type StringType, this operator checks whether s1 starts with s2, namely if s2 is the prefix of s1. The empty string is the prefix of any string, hence if s2 is the empty string, true is returned. The return type of this operator is BooleanType.
      • STRING_ENDS_WITH

        public static final BinaryOperator STRING_ENDS_WITH
        Given two string values s1 and s2 of type StringType, this operator checks whether s1 ends with s2, namely if s2 is the suffix of s1. The empty string is the suffix of any string, hence if s2 is the empty string, true is returned. The return type of this operator is BooleanType.
      • STRING_INDEX_OF

        public static final BinaryOperator STRING_INDEX_OF
        Given two string values s1 and s2 of type StringType, this operator return the position of the first occurrence of s1 in s2. If s1 does not contains s2, then -1 is returned. The return type of this operator is a 32 bit signed NumericType.
      • STRING_EQUALS

        public static final BinaryOperator STRING_EQUALS
        Given two string values s1 and s2 of type StringType, this operator checks if the two strings are equals. The return type of this operator is StringType.
      • TYPE_CAST

        public static final BinaryOperator TYPE_CAST
        Casts the type of the left-hand side of this expression to the type of the right-hand side. The returned value is exactly the left-hand side, but with its runtime types filtered to be instances of the right-hand side type. Indeed, this operation on types is a narrowing operator, namely the destination type is smaller than the source type.
      • TYPE_CONV

        public static final BinaryOperator TYPE_CONV
        Converts the type of the left-hand side of this expression to the type of the right-hand side. The returned value is exactly the right-hand side, if the left-hand side type an be converted to the right-hand side one. Indeed, this operation on types is a widening operator, namely the destination type is greater than the source type.
      • TYPE_CHECK

        public static final BinaryOperator TYPE_CHECK
        Tests if the type of the left-hand side of this expression is the same as, or a subtype of, the type of the right-hand side. The returned value is a boolean of type BooleanType expressing this relation.
    • Method Detail

      • values

        public static BinaryOperator[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (BinaryOperator c : BinaryOperator.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static BinaryOperator valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • getStringRepresentation

        public java.lang.String getStringRepresentation()
        Description copied from interface: Operator
        Yields the string representation of the operator.
        Specified by:
        getStringRepresentation in interface Operator
        Returns:
        the string representation
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Enum<BinaryOperator>