Package com.blackrook.rookscript.lang
Interface ScriptFunctionType
- All Known Implementing Classes:
BufferFunctions
,DataIOFunctions
,DateFunctions
,DigestFunctions
,ErrorFunctions
,FileIOFunctions
,FileSystemFunctions
,JSONFunctions
,ListFunctions
,MapFunctions
,MathFunctions
,MiscFunctions
,PrintFunctions
,RegexFunctions
,StreamingIOFunctions
,StringFunctions
,SystemFunctions
,ZipFunctions
public interface ScriptFunctionType
Host function type for scripts.
- Author:
- Matthew Tropiano
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
Function usage info. -
Method Summary
Modifier and TypeMethodDescriptionboolean
execute
(ScriptInstance scriptInstance, ScriptValue returnValue) Executes this function.int
getUsage()
name()
Gets the name of this function.
-
Method Details
-
name
String name()Gets the name of this function. This name returned must be a valid name that can be parsed in the script ("identifier" type: starts with letter, alphanumeric plus "_").- Returns:
- the function name.
-
getParameterCount
int getParameterCount()- Returns:
- the total amount of parameters this takes.
-
getUsage
ScriptFunctionType.Usage getUsage()- Returns:
- this function's usage instructions.
-
execute
Executes this function. The value inreturnValue
is automatically pushed onto the stack after the call. If aThrowable
is thrown from this call, it is wrapped in aScriptExecutionException
.ScriptExecutionException
s are thrown as-is.- 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.
-