Package me.hsgamer.hscore.expression
Class ExpressionUtils
java.lang.Object
me.hsgamer.hscore.expression.ExpressionUtils
The expression manager
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidapplyLazyFunction(@NotNull com.udojava.evalex.Expression expression) Apply functions to the expressionstatic voidapplyLazyOperator(@NotNull com.udojava.evalex.Expression expression) Apply operators to the expressionstatic @NotNull com.udojava.evalex.ExpressioncreateExpression(@NotNull String input) Create an expression from a stringstatic @Nullable BigDecimalGet the result of the expressionstatic booleanCheck if the expression is a Boolean expressionstatic booleanisValidExpression(@NotNull String input) Check if it's a valid expressionstatic voidregisterLazyFunction(@NotNull com.udojava.evalex.LazyFunction lazyFunction) Register a function to the expression systemstatic voidregisterLazyOperator(@NotNull com.udojava.evalex.LazyOperator lazyOperator) Register an operator to the expression system
-
Method Details
-
isBoolean
Check if the expression is a Boolean expression- Parameters:
input- the expression- Returns:
- whether it's a Boolean expression
-
getResult
Get the result of the expression- Parameters:
input- the expression- Returns:
- the result
-
createExpression
@NotNull public static @NotNull com.udojava.evalex.Expression createExpression(@NotNull @NotNull String input) Create an expression from a string- Parameters:
input- the string- Returns:
- the expression
-
isValidExpression
Check if it's a valid expression- Parameters:
input- the expression- Returns:
- whether it's valid
-
applyLazyFunction
public static void applyLazyFunction(@NotNull @NotNull com.udojava.evalex.Expression expression) Apply functions to the expression- Parameters:
expression- the expression
-
registerLazyFunction
public static void registerLazyFunction(@NotNull @NotNull com.udojava.evalex.LazyFunction lazyFunction) Register a function to the expression system- Parameters:
lazyFunction- the function
-
applyLazyOperator
public static void applyLazyOperator(@NotNull @NotNull com.udojava.evalex.Expression expression) Apply operators to the expression- Parameters:
expression- the expression
-
registerLazyOperator
public static void registerLazyOperator(@NotNull @NotNull com.udojava.evalex.LazyOperator lazyOperator) Register an operator to the expression system- Parameters:
lazyOperator- the function
-