Package com.blackrook.expression.node
Enum ExpressionDirectiveType
- java.lang.Object
-
- java.lang.Enum<ExpressionDirectiveType>
-
- com.blackrook.expression.node.ExpressionDirectiveType
-
- All Implemented Interfaces:
Serializable
,Comparable<ExpressionDirectiveType>
public enum ExpressionDirectiveType extends Enum<ExpressionDirectiveType>
Expression directive.- Author:
- Matthew Tropiano
-
-
Enum Constant Summary
Enum Constants Enum Constant Description ABSOLUTE
Absolute.ADD
Add.AND
Bitwise And.DIVIDE
Divide.EQUAL
Equal.GREATER
Greater than.GREATER_OR_EQUAL
Greater than or equal.LEFT_SHIFT
Left Bit Shift.LESS
Less than.LESS_OR_EQUAL
Less than or equal.LOGICAL_AND
Logical And.LOGICAL_NOT
Logical Not.LOGICAL_OR
Logical Or.MODULO
Modulo.MULTIPLY
Multiply.NEGATE
Negate.NOT
Bitwise NOT.NOT_EQUAL
Not Equal.OR
Bitwise Or.POP
POP into variable.PUSH
PUSH value.PUSH_VARIABLE
PUSH variable.RETURN
Return value.RIGHT_SHIFT
Right Bit Shift.RIGHT_SHIFT_PADDED
Right Bit Shift Padded.STRICT_EQUAL
Strict Equal.STRICT_NOT_EQUAL
Strict Not Equal.SUBTRACT
Subtract.XOR
Bitwise Xor.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract boolean
execute(ExpressionStack stack, ExpressionVariableContext context, Object operand)
Executes this node.boolean
isCollapsable()
Checks if this node type is collapsable.static ExpressionDirectiveType
valueOf(String name)
Returns the enum constant of this type with the specified name.static ExpressionDirectiveType[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
RETURN
public static final ExpressionDirectiveType RETURN
Return value. No operand.
-
PUSH
public static final ExpressionDirectiveType PUSH
PUSH value. Operand is Boolean, Double, or Long.
-
PUSH_VARIABLE
public static final ExpressionDirectiveType PUSH_VARIABLE
PUSH variable. Operand is String.
-
POP
public static final ExpressionDirectiveType POP
POP into variable. Operand is String.
-
NOT
public static final ExpressionDirectiveType NOT
Bitwise NOT.
-
NEGATE
public static final ExpressionDirectiveType NEGATE
Negate.
-
ABSOLUTE
public static final ExpressionDirectiveType ABSOLUTE
Absolute.
-
LOGICAL_NOT
public static final ExpressionDirectiveType LOGICAL_NOT
Logical Not.
-
ADD
public static final ExpressionDirectiveType ADD
Add.
-
SUBTRACT
public static final ExpressionDirectiveType SUBTRACT
Subtract.
-
MULTIPLY
public static final ExpressionDirectiveType MULTIPLY
Multiply.
-
DIVIDE
public static final ExpressionDirectiveType DIVIDE
Divide.
-
MODULO
public static final ExpressionDirectiveType MODULO
Modulo.
-
AND
public static final ExpressionDirectiveType AND
Bitwise And.
-
OR
public static final ExpressionDirectiveType OR
Bitwise Or.
-
XOR
public static final ExpressionDirectiveType XOR
Bitwise Xor.
-
LOGICAL_AND
public static final ExpressionDirectiveType LOGICAL_AND
Logical And.
-
LOGICAL_OR
public static final ExpressionDirectiveType LOGICAL_OR
Logical Or.
-
LEFT_SHIFT
public static final ExpressionDirectiveType LEFT_SHIFT
Left Bit Shift.
-
RIGHT_SHIFT
public static final ExpressionDirectiveType RIGHT_SHIFT
Right Bit Shift.
-
RIGHT_SHIFT_PADDED
public static final ExpressionDirectiveType RIGHT_SHIFT_PADDED
Right Bit Shift Padded.
-
LESS
public static final ExpressionDirectiveType LESS
Less than.
-
LESS_OR_EQUAL
public static final ExpressionDirectiveType LESS_OR_EQUAL
Less than or equal.
-
GREATER
public static final ExpressionDirectiveType GREATER
Greater than.
-
GREATER_OR_EQUAL
public static final ExpressionDirectiveType GREATER_OR_EQUAL
Greater than or equal.
-
EQUAL
public static final ExpressionDirectiveType EQUAL
Equal.
-
NOT_EQUAL
public static final ExpressionDirectiveType NOT_EQUAL
Not Equal.
-
STRICT_EQUAL
public static final ExpressionDirectiveType STRICT_EQUAL
Strict Equal.
-
STRICT_NOT_EQUAL
public static final ExpressionDirectiveType STRICT_NOT_EQUAL
Strict Not Equal.
-
-
Method Detail
-
values
public static ExpressionDirectiveType[] 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 (ExpressionDirectiveType c : ExpressionDirectiveType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ExpressionDirectiveType valueOf(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:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
isCollapsable
public boolean isCollapsable()
Checks if this node type is collapsable.- Returns:
- true if so, false if not.
-
execute
public abstract boolean execute(ExpressionStack stack, ExpressionVariableContext context, Object operand)
Executes this node.- Parameters:
stack
- the stack to use.context
- the context for added variables.operand
- the operand, if any.- Returns:
- if false, terminate the calculation, else if true, continue.
-
-