Interface Subroutine<R>

All Known Implementing Classes:
Engine.Sub

public interface Subroutine<R>
Interface to manage a BASIC subroutine. An instance of this interface can be acquired calling the method ScriptBasic.subroutine(String). It is also possible to get all the subroutines calling the method ScriptBasic.subroutines().
Author:
Peter Verhas
  • Method Summary

    Modifier and Type Method Description
    R call()
    Call a subroutine without any argument.
    R call​(java.lang.Object... args)
    Call the subroutine.
    java.lang.String name()
    Get the name of the subroutine.
    int numberOfArguments()  
  • Method Details

    • numberOfArguments

      int numberOfArguments()
      Returns:
      the number of arguments the subroutine expects when invoked
    • name

      java.lang.String name()
      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.
      Returns:
      the name of the subroutine
    • call

      R call​(java.lang.Object... args) throws ScriptBasicException
      Call the subroutine.
      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

      R call() throws ScriptBasicException
      Call a subroutine without any argument.
      Returns:
      the return value of the subroutine
      Throws:
      ScriptBasicException - in case of exception