Enum CommonFunctions
- All Implemented Interfaces:
ExpressionFunctionType, Serializable, Comparable<CommonFunctions>
Expression functions.
- Author:
- Matthew Tropiano
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionConvert to boolean.Clamp.Color (byte) components to ARGB.Color (float) components to ARGB.Cosine.Degrees to radians.Returns Euler's constant.Convert to floating point (double, internally).Convert to integer (long, internally).Linear-interpolate.Maximum.Minimum.Returns PI.Radians to degrees.Sine.Wrap. -
Method Summary
Modifier and TypeMethodDescriptionabstract booleanexecute(ExpressionStack stack, ExpressionVariableContext context) Executes this node.intstatic final ExpressionFunctionResolverbooleanChecks if this node type is collapsable.static CommonFunctionsReturns the enum constant of this type with the specified name.static CommonFunctions[]values()Returns an array containing the constants of this enum type, in the order they are declared.Methods inherited from class Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOfMethods inherited from interface ExpressionFunctionType
name
-
Enum Constant Details
-
MIN
Minimum. -
MAX
Maximum. -
SIN
Sine. -
COS
Cosine. -
CLAMP
Clamp. -
WRAP
Wrap. -
LERP
Linear-interpolate. -
BOOL
Convert to boolean. -
INT
Convert to integer (long, internally). -
FLOAT
Convert to floating point (double, internally). -
COLOR
Color (byte) components to ARGB. -
COLORF
Color (float) components to ARGB. -
DEG2RAD
Degrees to radians. -
RAD2DEG
Radians to degrees. -
PI
Returns PI. -
E
Returns Euler's constant.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
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
-
getArgumentCount
public int getArgumentCount()- Specified by:
getArgumentCountin interfaceExpressionFunctionType- Returns:
- the amount of arguments this takes.
-
isCollapsable
public boolean isCollapsable()Checks if this node type is collapsable.- Specified by:
isCollapsablein interfaceExpressionFunctionType- Returns:
- true if so, false if not.
-
execute
Executes this node.- Specified by:
executein interfaceExpressionFunctionType- Parameters:
stack- the stack to use.context- the context for added variables.- Returns:
- if false, this halts script execution, else if true, continue.
-
getResolver
- Returns:
- a function resolver that handles all of the functions in this enum.
-