Class StringOperation
- java.lang.Object
-
- it.unive.lisa.symbolic.value.operator.binary.StringOperation
-
- All Implemented Interfaces:
Operator
,BinaryOperator
,StringOperator
- Direct Known Subclasses:
StringConcat
,StringContains
,StringEndsWith
,StringEquals
,StringIndexOf
,StringStartsWith
public abstract class StringOperation extends java.lang.Object implements StringOperator, BinaryOperator
A common implementation for classes implementingBinaryOperator
andStringOperator
, providing atypeInference(TypeSystem, Set, Set)
implementation that returns an empty set if noStringType
can be found in one of the arguments, and a singleton set containing their result type otherwise.
-
-
Constructor Summary
Constructors Constructor Description StringOperation()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract Type
resultType(TypeSystem types)
Yields theType
of this operation's result.java.util.Set<Type>
typeInference(TypeSystem types, java.util.Set<Type> left, java.util.Set<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.
-
-
-
Method Detail
-
typeInference
public java.util.Set<Type> typeInference(TypeSystem types, java.util.Set<Type> left, java.util.Set<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 interfaceBinaryOperator
- Parameters:
types
- the type system knowing about the types of the current programleft
- the set of types of the left-most argument of this expressionright
- the set of types of the right-most argument of this expression- Returns:
- the runtime types of this expression
-
resultType
protected abstract Type resultType(TypeSystem types)
Yields theType
of this operation's result.- Parameters:
types
- the type system knowing about the types of the currentprogram- Returns:
- the type
-
-