Tea Java Runtime API
Version 3.2.4

com.pdmfc.tea.modules.util
Class SHashtable

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

public class SHashtable
extends STosObj

Implements an TOS object that acts like a java Hashtable.


Constructor Summary
SHashtable(STosClass myClass)
          Initializes the object internal state.
 
Method Summary
 java.lang.Object clear(SObjFunction obj, SContext context, java.lang.Object[] args)
          The implementation for the "clear" TOS method.
 java.lang.Object constructor(SObjFunction obj, SContext context, java.lang.Object[] args)
          The implementation for the "constructor" TOS method.
 java.lang.Object get(SObjFunction obj, SContext context, java.lang.Object[] args)
          The implementation for the "get" TOS method.
 java.lang.Object getElements(SObjFunction obj, SContext context, java.lang.Object[] args)
          The implementation for the "getElements" TOS method.
 java.util.Map getInternalMap()
          Fetches the java.util.Map used to store the hashtable elements.
 java.lang.Object getKeys(SObjFunction obj, SContext context, java.lang.Object[] args)
          The implementation for the "getKeys" TOS method.
static java.lang.String getTosClassName()
          Retrieves the recomended name for the TOS class.
 java.lang.Object isKey(SObjFunction obj, SContext context, java.lang.Object[] args)
          The implementation for the "isKey" TOS method.
static SHashtable newInstance(SContext context)
          Creates a TOS THashtable instance.
static SHashtable newInstance(SContext context, java.util.Map contents)
          Creates a TOS THashtable instance and supplies the java.util.Map used to store the hashtable elements.
 java.lang.Object put(SObjFunction obj, SContext context, java.lang.Object[] args)
          The implementation for the "put" TOS method.
 java.lang.Object remove(SObjFunction obj, SContext context, java.lang.Object[] args)
          The implementation for the "remove" TOS method.
 
Methods inherited from class com.pdmfc.tea.modules.tos.STosObj
exec, getTosClass, init, part, selfObj
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SHashtable

public SHashtable(STosClass myClass)
           throws STeaException
Initializes the object internal state. The TOS class assigned to this object is supposed to generate instances of TOS objects that are SHashtable instances.

Parameters:
myClass - The TOS class to assign to the TOS objects.
Throws:
STeaException
Method Detail

getInternalMap

public java.util.Map getInternalMap()
Fetches the java.util.Map used to store the hashtable elements. The returned java.util.Map may be modified at will. Nevertheless, concurrent use from within multiple threads must be avoided.

Returns:
The java.util.Map used to store the hashtable elements.

constructor

public java.lang.Object constructor(SObjFunction obj,
                                    SContext context,
                                    java.lang.Object[] args)
                             throws STeaException
The implementation for the "constructor" TOS method.

Parameters:
obj - Reference to the object the TOS method was invoked for.
context - The context where the method invocation is taking place.
args - The arguments the TOS method was called with.
Throws:
STeaException

put

public java.lang.Object put(SObjFunction obj,
                            SContext context,
                            java.lang.Object[] args)
                     throws STeaException
The implementation for the "put" TOS method.

Parameters:
obj - Reference to the object the TOS method was invoked for.
context - The context where the method invocation is taking place.
args - The arguments the TOS method was called with.
Throws:
STeaException

get

public java.lang.Object get(SObjFunction obj,
                            SContext context,
                            java.lang.Object[] args)
                     throws STeaException
The implementation for the "get" TOS method.

Parameters:
obj - Reference to the object the TOS method was invoked for.
context - The context where the method invocation is taking place.
args - The arguments the TOS method was called with.
Throws:
STeaException

getKeys

public java.lang.Object getKeys(SObjFunction obj,
                                SContext context,
                                java.lang.Object[] args)
                         throws STeaException
The implementation for the "getKeys" TOS method.

Parameters:
obj - Reference to the object the TOS method was invoked for.
context - The context where the method invocation is taking place.
args - The arguments the TOS method was called with.
Throws:
STeaException

getElements

public java.lang.Object getElements(SObjFunction obj,
                                    SContext context,
                                    java.lang.Object[] args)
                             throws STeaException
The implementation for the "getElements" TOS method.

Parameters:
obj - Reference to the object the TOS method was invoked for.
context - The context where the method invocation is taking place.
args - The arguments the TOS method was called with.
Throws:
STeaException

isKey

public java.lang.Object isKey(SObjFunction obj,
                              SContext context,
                              java.lang.Object[] args)
                       throws STeaException
The implementation for the "isKey" TOS method.

Parameters:
obj - Reference to the object the TOS method was invoked for.
context - The context where the method invocation is taking place.
args - The arguments the TOS method was called with.
Throws:
STeaException

clear

public java.lang.Object clear(SObjFunction obj,
                              SContext context,
                              java.lang.Object[] args)
                       throws STeaException
The implementation for the "clear" TOS method.

Parameters:
obj - Reference to the object the TOS method was invoked for.
context - The context where the method invocation is taking place.
args - The arguments the TOS method was called with.
Throws:
STeaException

remove

public java.lang.Object remove(SObjFunction obj,
                               SContext context,
                               java.lang.Object[] args)
                        throws STeaException
The implementation for the "remove" TOS method.

Parameters:
obj - Reference to the object the TOS method was invoked for.
context - The context where the method invocation is taking place.
args - The arguments the TOS method was called with.
Throws:
STeaException

getTosClassName

public static java.lang.String getTosClassName()
Retrieves the recomended name for the TOS class. This method is expected to exist when the TOS class is loaded into a Tea runtime by calling the Tea "load-class" method.

Returns:
The name for the TOS class.

newInstance

public static SHashtable newInstance(SContext context)
                              throws STeaException
Creates a TOS THashtable instance. The context is used to retrieve the TOS class object to assign to the THashtable.

The internal java.util.Map where the hashtable elements will be stored is automatically created.

Parameters:
context - The context where the THashtable instance is being created.
Returns:
A newly created and initialized SHashtable.
Throws:
STeaException

newInstance

public static SHashtable newInstance(SContext context,
                                     java.util.Map contents)
                              throws STeaException
Creates a TOS THashtable instance and supplies the java.util.Map used to store the hashtable elements.

Parameters:
context - The context where the THashtable instance is being created.
contents - The java.util.Map that will be used to store the hashtable elements.
Returns:
A newly created and initialized SHashtable.
Throws:
STeaException

Tea Java Runtime API
Version 3.2.4

© 2009 PDM&FC, All Rights Reserved.