Class StringLength
- java.lang.Object
-
- it.unive.lisa.symbolic.value.operator.unary.StringLength
-
- All Implemented Interfaces:
Operator
,StringOperator
,UnaryOperator
public class StringLength extends java.lang.Object implements StringOperator, UnaryOperator
Given an expression that evaluates to a string value, aUnaryExpression
using this operator computes an integral value, from0
upwards, representing the length of that value.
Argument expression type:StringType
Computed expression type:NumericType
(integral)
-
-
Field Summary
Fields Modifier and Type Field Description static StringLength
INSTANCE
The singleton instance of this class.
-
Constructor Summary
Constructors Modifier Constructor Description protected
StringLength()
Builds the operator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
toString()
java.util.Set<Type>
typeInference(TypeSystem types, java.util.Set<Type> argument)
Computes the runtime types of this expression (i.e., of the result of this expression) assuming that the argument of this expression has the given types.
-
-
-
Field Detail
-
INSTANCE
public static final StringLength INSTANCE
The singleton instance of this class.
-
-
Constructor Detail
-
StringLength
protected StringLength()
Builds the operator. This constructor is visible to allow subclassing: instances of this class should be unique, and the singleton can be retrieved through fieldINSTANCE
.
-
-
Method Detail
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
typeInference
public java.util.Set<Type> typeInference(TypeSystem types, java.util.Set<Type> argument)
Description copied from interface:UnaryOperator
Computes the runtime types of this expression (i.e., of the result of this expression) assuming that the argument of this expression has the given types.- Specified by:
typeInference
in interfaceUnaryOperator
- Parameters:
types
- the type system knowing about the types of the current programargument
- the set of types of the argument of this expression- Returns:
- the runtime types of this expression
-
-