Tea Java Runtime API
Version 3.2.4

com.pdmfc.tea.modules.tos
Class STosMethodVarArg

java.lang.Object
  extended by com.pdmfc.tea.modules.tos.STosMethodVarArg
All Implemented Interfaces:
SObjFunction

public class STosMethodVarArg
extends java.lang.Object
implements SObjFunction

This class implements a TOS method with a variable number of arguments.


Constructor Summary
STosMethodVarArg(STosClass theClass, SObjSymbol methodName, SObjSymbol argName, SObjBlock body)
          Defines a method associated with the TOS class className.
 
Method Summary
 java.lang.Object exec(SObjFunction func, SContext context, java.lang.Object[] args)
          Executes the TOS method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

STosMethodVarArg

public STosMethodVarArg(STosClass theClass,
                        SObjSymbol methodName,
                        SObjSymbol argName,
                        SObjBlock body)
Defines a method associated with the TOS class className.

Parameters:
methodName - The name to associate with this TOS method.
theClass - The TOS class where this TOS method is being defined.
argName - Name of the function formal parameter that is initialized with a list containin the arguments for the invocation.
body - Block of code, representing the body of the method.
Method Detail

exec

public java.lang.Object exec(SObjFunction func,
                             SContext context,
                             java.lang.Object[] args)
                      throws STeaException
Executes the TOS method. A new context is created, descending from the context where the block was created. Local variables, named after the formal command parameters are initialized with the values received as arguments. This method is supposed to be called with args having at least one element.

Specified by:
exec in interface SObjFunction
Parameters:
context - The context where this command is being invoked.
args - Array with the arguments passed to the command.
func - The SObjFunction that led to call this function. Most of the time is the same as the this object.
Returns:
An Object object.
Throws:
STeaException - Thrown if there is not two arguments for the command.

Tea Java Runtime API
Version 3.2.4

© 2009 PDM&FC, All Rights Reserved.