Class StringIndexOf

  • All Implemented Interfaces:
    Operator, BinaryOperator, StringOperator

    public class StringIndexOf
    extends java.lang.Object
    implements StringOperator, BinaryOperator
    Given two expressions that both evaluate to string values, a BinaryExpression using this operator computes the starting index of the first occurrence of the string from the second argument inside the one of the first argument, producing -1 if no occurrence can be found.

    First argument expression type: StringType
    Second argument expression type: StringType
    Computed expression type: NumericType (integral)
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static StringIndexOf INSTANCE
      The singleton instance of this class.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String toString()  
      ExternalSet<Type> typeInference​(ExternalSet<Type> left, ExternalSet<Type> right)
      Computes the runtime types of this expression (i.e., of the result of this expression) assuming that the arguments of this expression have the given types.
      • Methods inherited from class java.lang.Object

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

      • INSTANCE

        public static final StringIndexOf INSTANCE
        The singleton instance of this class.
    • Method Detail

      • toString

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

        public ExternalSet<Type> typeInference​(ExternalSet<Type> left,
                                               ExternalSet<Type> right)
        Description copied from interface: BinaryOperator
        Computes the runtime types of this expression (i.e., of the result of this expression) assuming that the arguments of this expression have the given types.
        Specified by:
        typeInference in interface BinaryOperator
        Parameters:
        left - the set of types of the left-most argument of this expression
        right - the set of types of the right-most argument of this expression
        Returns:
        the runtime types of this expression