Tea Java Runtime API
Version 3.2.4

com.pdmfc.tea.tos
Class STosTeaObj

java.lang.Object
  extended by com.pdmfc.tea.tos.STosTeaObj
All Implemented Interfaces:
SObjFunction, STosObj

public class STosTeaObj
extends java.lang.Object
implements STosObj


Constructor Summary
STosTeaObj()
           
 
Method Summary
 java.lang.Object exec(SObjFunction obj, SContext context, java.lang.Object[] args)
          This is the dispatch method.
 SContext getMembers(int level)
          Fetches the members for this TOS object corresponding to a given TOS class in the TOS object class hierarchy.
 STosClass getTosClass()
          Retrieves the class object this TOS object is an instance of.
 void init(STosClass tosClass, SContext context, java.lang.Object[] constructorArgs)
          Initializes the object internal state.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

STosTeaObj

public STosTeaObj()
           throws STeaException
Throws:
STeaException
Method Detail

init

public void init(STosClass tosClass,
                 SContext context,
                 java.lang.Object[] constructorArgs)
          throws STeaException
Description copied from interface: STosObj
Initializes the object internal state.

Specified by:
init in interface STosObj
Parameters:
tosClass - The TOS class the TOS object belong to.
context - The context where the TOS object is being instantiated.
constructorArgs - The arguments to pass the constructor of this TOS object.
Throws:
STeaException

getMembers

public SContext getMembers(int level)
Description copied from interface: STosObj
Fetches the members for this TOS object corresponding to a given TOS class in the TOS object class hierarchy. The returned SContext has no parent.

Specified by:
getMembers in interface STosObj
Parameters:
level - Identifies the TOS class in the TOS object class hierarchy of this TOS object. A value of zero means the root class in the hierarchy.
Returns:
The set of members (names and values) for this object related to a specific TOS class.

getTosClass

public STosClass getTosClass()
Retrieves the class object this TOS object is an instance of.

Specified by:
getTosClass in interface STosObj
Returns:
The STosClass object this TOS object is an instance of.

exec

public java.lang.Object exec(SObjFunction obj,
                             SContext context,
                             java.lang.Object[] args)
                      throws STeaException
This is the dispatch method. It will call the TOS method of this TOS object. The TOS method is specified by the first argument to the Tea command this object implements. So, args[0] is a reference to this Java object, args[1] is a symbol that references the TOS method to be called, the remaining arguments are passed to the TOS method.

A TOS method is implemented by an STosMethod object.

Specified by:
exec in interface SObjFunction
Parameters:
context - The context inside which this command was invoked.
args - The array of arguments passed to the command.
obj - The SObjFunction that led to call this function. Most of the time is the same as the this object.
Returns:
The object returned by the execution of the method.
Throws:
com.pdmfc.tea.runtime.STException - Only thrown by the execution of the method.
STeaException - Thrown if there were problems executing the command.

Tea Java Runtime API
Version 3.2.4

© 2009 PDM&FC, All Rights Reserved.