Enum Class MapFunctions

java.lang.Object
java.lang.Enum<MapFunctions>
com.blackrook.rookscript.functions.common.MapFunctions
All Implemented Interfaces:
ScriptFunctionType, Serializable, Comparable<MapFunctions>, java.lang.constant.Constable

public enum MapFunctions extends Enum<MapFunctions> implements ScriptFunctionType
RookScript map functions.
Author:
Matthew Tropiano
  • Enum Constant Details

    • MAPKEYS

      public static final MapFunctions MAPKEYS
    • MAPGET

      public static final MapFunctions MAPGET
      Since:
      1.4.0
    • MAPSET

      public static final MapFunctions MAPSET
      Since:
      1.4.0
    • MAPVALUE

      public static final MapFunctions MAPVALUE
      Since:
      1.4.0, added "default" parameter.
    • MAPMERGE

      public static final MapFunctions MAPMERGE
  • Method Details

    • values

      public static MapFunctions[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static MapFunctions valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified name
      NullPointerException - if the argument is null
    • createResolver

      public static final ScriptFunctionResolver createResolver()
      Returns:
      a function resolver that handles all of the functions in this enum.
    • getParameterCount

      public int getParameterCount()
      Specified by:
      getParameterCount in interface ScriptFunctionType
      Returns:
      the total amount of parameters this takes.
    • getUsage

      public ScriptFunctionType.Usage getUsage()
      Specified by:
      getUsage in interface ScriptFunctionType
      Returns:
      this function's usage instructions.
    • execute

      public abstract boolean execute(ScriptInstance scriptInstance, ScriptValue returnValue)
      Description copied from interface: ScriptFunctionType
      Executes this function. The value in returnValue is automatically pushed onto the stack after the call. If a Throwable is thrown from this call, it is wrapped in a ScriptExecutionException. ScriptExecutionExceptions are thrown as-is.
      Specified by:
      execute in interface ScriptFunctionType
      Parameters:
      scriptInstance - the originating script instance.
      returnValue - the value pushed to the stack on return.
      Returns:
      if false, this halts script execution, else if true, continue.
    • usage

      protected abstract ScriptFunctionType.Usage usage()