public enum Calc extends Enum<Calc>
Enum Constant and Description |
---|
DIV
Division.
|
IDIV
Integer division.
|
MINUS
Subtraction.
|
MOD
Modulo.
|
MULT
Multiplication.
|
PLUS
Addition.
|
Modifier and Type | Method and Description |
---|---|
abstract Item |
eval(Item item1,
Item item2,
InputInfo ii)
Performs the calculation.
|
abstract Calc |
invert()
Inverts the operator.
|
static Type |
numType(Type type1,
Type type2)
Returns the numeric type with the highest precedence.
|
abstract Expr |
optimize(Expr expr1,
Expr expr2,
InputInfo info,
CompileContext cc)
Optimizes the expressions.
|
String |
toString() |
abstract Type |
type(Type type1,
Type type2)
Returns the result type of this calculation.
|
static Calc |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static Calc[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final Calc PLUS
public static final Calc MINUS
public static final Calc MULT
public static final Calc DIV
public static final Calc IDIV
public static final Calc MOD
public static Calc[] values()
for (Calc c : Calc.values()) System.out.println(c);
public static Calc valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic abstract Item eval(Item item1, Item item2, InputInfo ii) throws QueryException
item1
- first itemitem2
- second itemii
- input infoQueryException
- query exceptionpublic abstract Expr optimize(Expr expr1, Expr expr2, InputInfo info, CompileContext cc) throws QueryException
expr1
- first expressionexpr2
- second expressioninfo
- input infocc
- compilation contextnull
if expression cannot be optimizedQueryException
- query exceptionpublic abstract Type type(Type type1, Type type2)
type1
- first item typetype2
- second item typenull
if expression cannot be optimizedpublic abstract Calc invert()
null
public static Type numType(Type type1, Type type2)
type1
- first item typetype2
- second item typeCopyright © 2005–2023 BaseX Team. All rights reserved.