Tea Java Runtime API
Version 3.1.0

com.pdmfc.tea.modules.tos
Class STosObj

java.lang.Object
  |
  +--com.pdmfc.tea.modules.tos.STosObj
All Implemented Interfaces:
SObjFunction
Direct Known Subclasses:
SConnection, SDate, SHashtable, SInput, SOutput, SResultSet, SServerSocketPlain, SSocketPlain, SStatement, SVector, SXmlParser, SZipFile

public class STosObj
extends java.lang.Object
implements SObjFunction

This class implements a Tea command that behaves like an TOS object.


Constructor Summary
STosObj(STosClass theClass)
          Initializes a new TOS object.
 
Method Summary
 java.lang.Object exec(SObjFunction obj, SContext context, java.lang.Object[] args)
          This is the dispatch method.
 STosClass getTosClass()
          Retrieves the class object this TOS object is an instance of.
 void init(SContext context, java.lang.Object[] args)
           
 STosObj part(int level)
          Retrieves the part of this TOS object at level level.
 STosObj selfObj()
          Retrieves the TOS object this object is part of.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

STosObj

public STosObj(STosClass theClass)
        throws STeaException
Initializes a new TOS object.

The creation of an TOS object is done in two steps. First the object is instantiated. Then it is initialized with a call to the init() method.

Parameters:
theClass - The TOS class of the TOS object represented by this Java object.
Method Detail

init

public void init(SContext context,
                 java.lang.Object[] args)
          throws STeaException
Parameters:
context - The context where the constructor was called.
args - The arguments to the constructor.
Throws:
STeaException - Only thrown by the call to the constructor method.

selfObj

public STosObj selfObj()
Retrieves the TOS object this object is part of.
Returns:
A reference to the TOS object this object is part of.

part

public STosObj part(int level)
Retrieves the part of this TOS object at level level.
Parameters:
level - The index of the part to retrieve.
Returns:
The part of this TOS object at level level.

getTosClass

public STosClass getTosClass()
Retrieves the class object this TOS object is an instance of.
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.
Returns:
The object returned by the execution of the method.
Throws:
com.pdmfc.tea.runtime.STException - Only thrown by the execution of the method.

Tea Java Runtime API
Version 3.1.0

© 2002 PDM&FC, All Rights Reserved.