Class ExpressionUtils

java.lang.Object
me.hsgamer.hscore.expression.ExpressionUtils

public final class ExpressionUtils extends Object
The expression manager
  • Method Details

    • isBoolean

      public static boolean isBoolean(@NotNull @NotNull String input)
      Check if the expression is a Boolean expression
      Parameters:
      input - the expression
      Returns:
      whether it's a Boolean expression
    • getResult

      @Nullable public static @Nullable BigDecimal getResult(@NotNull @NotNull String input)
      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

      public static boolean isValidExpression(@NotNull @NotNull String input)
      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