Package it.unive.lisa.symbolic.value
Enum UnaryOperator
- java.lang.Object
-
- java.lang.Enum<UnaryOperator>
-
- it.unive.lisa.symbolic.value.UnaryOperator
-
- All Implemented Interfaces:
Operator,java.io.Serializable,java.lang.Comparable<UnaryOperator>
public enum UnaryOperator extends java.lang.Enum<UnaryOperator> implements Operator
A unary operator that can be applied to a singleSymbolicExpression.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description LOGICAL_NOTGiven a Boolean value of typeBooleanType, this operator returns the logical negation of the value: if the Boolean value represents true, it returns false, and vice versa.NUMERIC_NEGGiven a numeric value of typeNumericType, this operator returns the negation of the numerical value.STRING_LENGTHGiven a string of typeStringTypereturns the length of that string.TYPEOFYields theTypeof an expression.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetStringRepresentation()Yields the string representation of the operator.java.lang.StringtoString()static UnaryOperatorvalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static UnaryOperator[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
LOGICAL_NOT
public static final UnaryOperator LOGICAL_NOT
Given a Boolean value of typeBooleanType, this operator returns the logical negation of the value: if the Boolean value represents true, it returns false, and vice versa. The return type of this operation isBooleanType.
-
NUMERIC_NEG
public static final UnaryOperator NUMERIC_NEG
Given a numeric value of typeNumericType, this operator returns the negation of the numerical value. The return type of this operator is a signedNumericType.
-
STRING_LENGTH
public static final UnaryOperator STRING_LENGTH
Given a string of typeStringTypereturns the length of that string. If the value represents the empty string, it returns 0. The return type of this operator is a 32 bit unsignedNumericType.
-
TYPEOF
public static final UnaryOperator TYPEOF
Yields theTypeof an expression.
-
-
Method Detail
-
values
public static UnaryOperator[] 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 (UnaryOperator c : UnaryOperator.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static UnaryOperator 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 namejava.lang.NullPointerException- if the argument is null
-
getStringRepresentation
public java.lang.String getStringRepresentation()
Description copied from interface:OperatorYields the string representation of the operator.- Specified by:
getStringRepresentationin interfaceOperator- Returns:
- the string representation
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Enum<UnaryOperator>
-
-