public enum OperationType extends java.lang.Enum<OperationType>
| Enum Constant and Description |
|---|
ADDITION |
AND |
DIVISION |
EQUAL |
GREATER_OR_EQUAL_THAN |
GREATER_THAN |
LESS_OR_EQUAL_THAN |
LESS_THAN |
MULTIPLICATION |
NEGATE |
NOT_EQUAL |
OR |
SUBTRACTION |
| Modifier and Type | Method and Description |
|---|---|
protected java.lang.Double |
convertToDouble(Operand operand)
Used to convert decimal and floating point numbers to a Double value.
|
protected java.lang.Long |
convertToLong(Operand operand)
Used to convert decimal numbers to a Long value.
|
protected java.lang.String |
convertToString(Operand operand)
Converts an operand to a String value by using it's toString method.
|
protected void |
doBaseChecks(OperationType operationType,
Operand[] operands,
boolean doNullCheck,
boolean doSupportedTypesCheck)
This method is used to do some base checks that must be done before most operations.
|
abstract Operand |
doOperation(Operand... operands)
Abstract base method to execute an operation.
|
int |
getOperationExecutionOrder()
Gets the operations execution order weight.
|
java.util.regex.Pattern |
getOperationPattern()
Gets the operations pattern.
|
static OperationType[] |
getOperationsByOperationTypeMode(OperationTypeMode operationTypeMode)
Gets the operations by OperationTypeMode.
|
OperationTypeMode |
getOperationTypeMode()
Gets the operations type mode.
|
static OperationType |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static OperationType[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final OperationType NEGATE
public static final OperationType AND
public static final OperationType OR
public static final OperationType EQUAL
public static final OperationType NOT_EQUAL
public static final OperationType LESS_OR_EQUAL_THAN
public static final OperationType GREATER_OR_EQUAL_THAN
public static final OperationType LESS_THAN
public static final OperationType GREATER_THAN
public static final OperationType ADDITION
public static final OperationType SUBTRACTION
public static final OperationType MULTIPLICATION
public static final OperationType DIVISION
public static OperationType[] values()
for (OperationType c : OperationType.values()) System.out.println(c);
public static OperationType valueOf(java.lang.String name)
name - the name of the enum constant to be returned.java.lang.IllegalArgumentException - if this enum type has no constant with the specified namejava.lang.NullPointerException - if the argument is nullpublic OperationTypeMode getOperationTypeMode()
public java.util.regex.Pattern getOperationPattern()
public int getOperationExecutionOrder()
public static OperationType[] getOperationsByOperationTypeMode(OperationTypeMode operationTypeMode)
operationTypeMode - the OperationTypepublic abstract Operand doOperation(Operand... operands)
operands - The number of operands depends on the OperationTypejava.lang.IllegalArgumentException - if base checks for OperationType fail (like number of operands, null value checks,...)protected void doBaseChecks(OperationType operationType, Operand[] operands, boolean doNullCheck, boolean doSupportedTypesCheck)
operationType - the operation type to check foroperands - the operands of the operationdoNullCheck - Defines if null checks for operand values should be donedoSupportedTypesCheck - Defines if operand types should be checked for conformity with operationjava.lang.IllegalArgumentException - if a constraint is violatedprotected java.lang.String convertToString(Operand operand)
operand - protected java.lang.Double convertToDouble(Operand operand)
operand - protected java.lang.Long convertToLong(Operand operand)
operand - Copyright © 2017-2018 Holisticon AG. All Rights Reserved.