Tea Java Runtime API
Version 3.2.4

com.pdmfc.tea.tos
Class STosTeaClass

java.lang.Object
  extended by com.pdmfc.tea.tos.STosTeaClass
All Implemented Interfaces:
STosClass

public class STosTeaClass
extends java.lang.Object
implements STosClass

Represents a TOS class implemented in Tea.


Field Summary
 
Fields inherited from interface com.pdmfc.tea.tos.STosClass
CONSTRUCTOR_NAME
 
Constructor Summary
STosTeaClass(STosClass superClass, SObjSymbol[] members)
           
 
Method Summary
 void addMethod(SObjSymbol methodName, STosMethod method)
          Associates a new TOS method with this TOS class.
 STosMethod getConstructor()
          Fetches the constructor method for this TOS class.
 SObjSymbol[] getMemberNames()
          Retrieves the member names of this TOS class.
 STosMethod getMethod(SObjSymbol methodName)
          Retrieves the STosMethod corresponding to the specified method for this TOS class.
 java.util.Iterator getMethods()
          Fetches all the methods this TOS class implements.
 java.lang.String getName()
          Fetches the name associated with the class.
 STosClass getSuperClass()
          Retrieves the TOS base class of this TOS class.
 STosObj newInstance(SContext context, java.lang.Object[] args)
          Creates a new instance of an object of this TOS class.
 void setConstructor(STosMethod method)
          Specifies the constructor for this TOS class.
 void setName(java.lang.String name)
          Associates a name with the class object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

STosTeaClass

public STosTeaClass(STosClass superClass,
                    SObjSymbol[] members)
Parameters:
superClass - The TOS base classe for this TOS class. If null it means this TOS class is a root class.
members - The member names for this class.
Method Detail

getSuperClass

public STosClass getSuperClass()
Retrieves the TOS base class of this TOS class. This will be the same STosClass object that was passed to the constructor.

Specified by:
getSuperClass in interface STosClass
Returns:
An STosClass object representing the TOS base class of this TOS class. If it is null it means this TOS class has no base class.

getMemberNames

public SObjSymbol[] getMemberNames()
Retrieves the member names of this TOS class. This set of names does not include the member names of the TOS base class.

Specified by:
getMemberNames in interface STosClass
Returns:
An array with the member names for this class.

setConstructor

public void setConstructor(STosMethod method)
Specifies the constructor for this TOS class.

Specified by:
setConstructor in interface STosClass
Parameters:
method - A reference to the SObjFunction object that implements the TOS method.

getConstructor

public STosMethod getConstructor()
Description copied from interface: STosClass
Fetches the constructor method for this TOS class.

Specified by:
getConstructor in interface STosClass
Returns:
The STosMethod object corresponding to the constructor method for this TOS class. The null object is returned if this TOS class has no constructor.

addMethod

public void addMethod(SObjSymbol methodName,
                      STosMethod method)
Associates a new TOS method with this TOS class. If a method with the same name already existed then it is superceded by this new method.

Specified by:
addMethod in interface STosClass
Parameters:
methodName - A symbol standing for the name of the method being defined.
method - A reference to the SObjFunction object that implements the TOS method.

getMethod

public STosMethod getMethod(SObjSymbol methodName)
                     throws SNoSuchMethodException
Retrieves the STosMethod corresponding to the specified method for this TOS class. The method is looked for in this TOS class and in its base classes.

Specified by:
getMethod in interface STosClass
Returns:
The STosMethod object that implements the specified method.
Throws:
com.pdmfc.tea.modules.tos.STosNoSuchMethodException - Thrown if the method had not been defined for this TOS class or in any of the base classes.
SNoSuchMethodException

getMethods

public java.util.Iterator getMethods()
Description copied from interface: STosClass
Fetches all the methods this TOS class implements. These methods will include all the methods of the base classes.

Specified by:
getMethods in interface STosClass
Returns:
A java.util.Iterator containing the all the STosMethods associated with this TOS class.

newInstance

public STosObj newInstance(SContext context,
                           java.lang.Object[] args)
                    throws STeaException
Description copied from interface: STosClass
Creates a new instance of an object of this TOS class.

Specified by:
newInstance in interface STosClass
Returns:
A new STosObj object, representing a new instance of this TOS class.
Throws:
STeaException - Throw if there were any problems instantiating the new object.

setName

public void setName(java.lang.String name)
Associates a name with the class object. A name can be associated to the class just for informational purposes. Currently this name is only used in error messages generated by the TOS class object. Note that there is no restriction on the contents of the name. There may even be more than one class with the same name.

Parameters:
name - The name that will be associated with the class.

getName

public java.lang.String getName()
Fetches the name associated with the class. This is the string passed to last call to the setName<(String) method.

Specified by:
getName in interface STosClass
Returns:
The name associated with the class.

Tea Java Runtime API
Version 3.2.4

© 2009 PDM&FC, All Rights Reserved.