Tea Java Runtime API
Version 3.2.5

com.pdmfc.tea.modules.tos
Class STosMethod

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

public class STosMethod
extends java.lang.Object
implements SObjFunction

This class implements a TOS method.


Constructor Summary
STosMethod(STosClass theClass, SObjSymbol methodName, SObjSymbol[] argNames, 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

STosMethod

public STosMethod(STosClass theClass,
                  SObjSymbol methodName,
                  SObjSymbol[] argNames,
                  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.
argNames - The names of the formal parameters.
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.5

© 2009 PDM&FC, All Rights Reserved.