Class Engine.Sub<R>

java.lang.Object
com.scriptbasic.Engine.Sub<R>
All Implemented Interfaces:
Subroutine<R>
Enclosing class:
Engine

public class Engine.Sub<R> extends Object implements Subroutine<R>
  • Method Details

    • numberOfArguments

      public int numberOfArguments()
      Specified by:
      numberOfArguments in interface Subroutine<R>
      Returns:
      the number of arguments the subroutine expects when invoked
    • name

      public String name()
      Description copied from interface: Subroutine
      Get the name of the subroutine. Even though the instance of the interface is usually acquired knowing the name of the subroutine this method can be used to access this information.
      Specified by:
      name in interface Subroutine<R>
      Returns:
      the name of the subroutine
    • call

      public R call(Object... args) throws ScriptBasicException
      Description copied from interface: Subroutine
      Call the subroutine.
      Specified by:
      call in interface Subroutine<R>
      Parameters:
      args - the arguments passed to the subroutine
      Returns:
      the return value of the subroutine
      Throws:
      ScriptBasicException - when an BASIC error happens during the execution of the subroutine
    • call

      public R call() throws ScriptBasicException
      Description copied from interface: Subroutine
      Call a subroutine without any argument.
      Specified by:
      call in interface Subroutine<R>
      Returns:
      the return value of the subroutine
      Throws:
      ScriptBasicException - in case of exception