Class StringIndexOf

  • All Implemented Interfaces:
    Operator, BinaryOperator, StringOperator

    public class StringIndexOf
    extends StringOperation
    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.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected StringIndexOf()
      Builds the type.
    • Field Detail

      • INSTANCE

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

      • StringIndexOf

        protected StringIndexOf()
        Builds the type. This constructor is visible to allow subclassing: instances of this class should be unique, and the singleton can be retrieved through field INSTANCE.
    • Method Detail

      • toString

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

        protected Type resultType​(TypeSystem types)
        Description copied from class: StringOperation
        Yields the Type of this operation's result.
        Specified by:
        resultType in class StringOperation
        Parameters:
        types - the type system knowing about the types of the currentprogram
        Returns:
        the type