Package dev.cel.common
Enum Operator
- java.lang.Object
-
- java.lang.Enum<Operator>
-
- dev.cel.common.Operator
-
-
Enum Constant Summary
Enum Constants Enum Constant Description ADDALLCONDITIONALDIVIDEEQUALSEXISTSEXISTS_ONEDeprecated.EXISTS_ONE_NEWFILTERGREATERGREATER_EQUALSHASININDEXLESSLESS_EQUALSLOGICAL_ANDLOGICAL_NOTLOGICAL_ORMAPMODULOMULTIPLYNEGATENOT_EQUALSNOT_STRICTLY_FALSEOLD_INDeprecated.OLD_NOT_STRICTLY_FALSEDeprecated.OPTIONAL_INDEXOPTIONAL_SELECTSUBTRACT
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.util.Optional<Operator>find(java.lang.String text)Lookup an operator by its unmangled name, as used with the source text of an expression.static java.util.Optional<Operator>findReverse(java.lang.String op)Lookup an operator by its mangled name (ex: _&&_), as used within the AST.java.lang.StringgetFunction()Returns the mangled operator name, as used within the AST.static java.util.Optional<java.lang.String>lookupBinaryOperator(java.lang.String op)Looks up the associated binary operator based on its function name (Ex: _||_ -> ||)static intlookupPrecedence(java.lang.String op)Returns the precedence of the operator.static java.util.Optional<java.lang.String>lookupUnaryOperator(java.lang.String op)Looks up the associated unary operator based on its function name (Ex: !_ -> !)static OperatorvalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static Operator[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
CONDITIONAL
public static final Operator CONDITIONAL
-
LOGICAL_AND
public static final Operator LOGICAL_AND
-
LOGICAL_OR
public static final Operator LOGICAL_OR
-
LOGICAL_NOT
public static final Operator LOGICAL_NOT
-
EQUALS
public static final Operator EQUALS
-
NOT_EQUALS
public static final Operator NOT_EQUALS
-
LESS
public static final Operator LESS
-
LESS_EQUALS
public static final Operator LESS_EQUALS
-
GREATER
public static final Operator GREATER
-
GREATER_EQUALS
public static final Operator GREATER_EQUALS
-
ADD
public static final Operator ADD
-
SUBTRACT
public static final Operator SUBTRACT
-
MULTIPLY
public static final Operator MULTIPLY
-
DIVIDE
public static final Operator DIVIDE
-
MODULO
public static final Operator MODULO
-
NEGATE
public static final Operator NEGATE
-
INDEX
public static final Operator INDEX
-
HAS
public static final Operator HAS
-
ALL
public static final Operator ALL
-
EXISTS
public static final Operator EXISTS
-
EXISTS_ONE
@Deprecated public static final Operator EXISTS_ONE
Deprecated.
-
EXISTS_ONE_NEW
public static final Operator EXISTS_ONE_NEW
-
MAP
public static final Operator MAP
-
FILTER
public static final Operator FILTER
-
NOT_STRICTLY_FALSE
public static final Operator NOT_STRICTLY_FALSE
-
IN
public static final Operator IN
-
OPTIONAL_INDEX
public static final Operator OPTIONAL_INDEX
-
OPTIONAL_SELECT
public static final Operator OPTIONAL_SELECT
-
OLD_NOT_STRICTLY_FALSE
@Deprecated public static final Operator OLD_NOT_STRICTLY_FALSE
Deprecated.
-
OLD_IN
@Deprecated public static final Operator OLD_IN
Deprecated.
-
-
Method Detail
-
values
public static Operator[] 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 (Operator c : Operator.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static Operator 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
-
getFunction
public java.lang.String getFunction()
Returns the mangled operator name, as used within the AST.
-
find
public static java.util.Optional<Operator> find(java.lang.String text)
Lookup an operator by its unmangled name, as used with the source text of an expression.
-
findReverse
public static java.util.Optional<Operator> findReverse(java.lang.String op)
Lookup an operator by its mangled name (ex: _&&_), as used within the AST.
-
lookupPrecedence
public static int lookupPrecedence(java.lang.String op)
Returns the precedence of the operator.- Returns:
- Integer value describing precedence. Higher value means higher precedence. Returns 0 if the operator is not found.
-
lookupUnaryOperator
public static java.util.Optional<java.lang.String> lookupUnaryOperator(java.lang.String op)
Looks up the associated unary operator based on its function name (Ex: !_ -> !)
-
lookupBinaryOperator
public static java.util.Optional<java.lang.String> lookupBinaryOperator(java.lang.String op)
Looks up the associated binary operator based on its function name (Ex: _||_ -> ||)
-
-