Enum ExpressionFactory.BinaryOperator
- java.lang.Object
-
- java.lang.Enum<ExpressionFactory.BinaryOperator>
-
- org.glassfish.pfl.dynamic.codegen.impl.ExpressionFactory.BinaryOperator
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<ExpressionFactory.BinaryOperator>
- Enclosing class:
- ExpressionFactory
public static enum ExpressionFactory.BinaryOperator extends java.lang.Enum<ExpressionFactory.BinaryOperator>
Representation of binary operators. We only support a limited set of operators as follows:- Basic arithmetic: PLUS, MINUS, TIMES, DIV, REM
- Relational operators (LT, GT, LE, GE, EQ, NE)
- == and != on references (e.g. obj == null) and primitives.
- AND and OR on booleans
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
javaRepresentation
-
Constructor Summary
Constructors Modifier Constructor Description private
BinaryOperator(java.lang.String javaRepresentation)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract Expression
create(ExpressionFactory ef, Expression left, Expression right)
private static Expression
createEqualityExpression(ExpressionFactory.BinaryOperator op, ExpressionFactory ef, Expression left, Expression right)
private static Expression
createNumericExpression(ExpressionFactory.BinaryOperator op, ExpressionFactory ef, Expression left, Expression right)
java.lang.String
javaRepresentation()
ExpressionFactory.BinaryOperatorKind
kind()
static ExpressionFactory.BinaryOperator
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static ExpressionFactory.BinaryOperator[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
PLUS
public static final ExpressionFactory.BinaryOperator PLUS
-
TIMES
public static final ExpressionFactory.BinaryOperator TIMES
-
DIV
public static final ExpressionFactory.BinaryOperator DIV
-
MINUS
public static final ExpressionFactory.BinaryOperator MINUS
-
REM
public static final ExpressionFactory.BinaryOperator REM
-
GT
public static final ExpressionFactory.BinaryOperator GT
-
GE
public static final ExpressionFactory.BinaryOperator GE
-
LT
public static final ExpressionFactory.BinaryOperator LT
-
LE
public static final ExpressionFactory.BinaryOperator LE
-
EQ
public static final ExpressionFactory.BinaryOperator EQ
-
NE
public static final ExpressionFactory.BinaryOperator NE
-
AND
public static final ExpressionFactory.BinaryOperator AND
-
OR
public static final ExpressionFactory.BinaryOperator OR
-
-
Method Detail
-
values
public static ExpressionFactory.BinaryOperator[] 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 (ExpressionFactory.BinaryOperator c : ExpressionFactory.BinaryOperator.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ExpressionFactory.BinaryOperator 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
-
createNumericExpression
private static Expression createNumericExpression(ExpressionFactory.BinaryOperator op, ExpressionFactory ef, Expression left, Expression right)
-
createEqualityExpression
private static Expression createEqualityExpression(ExpressionFactory.BinaryOperator op, ExpressionFactory ef, Expression left, Expression right)
-
javaRepresentation
public java.lang.String javaRepresentation()
-
create
public abstract Expression create(ExpressionFactory ef, Expression left, Expression right)
-
kind
public ExpressionFactory.BinaryOperatorKind kind()
-
-