gpsys
Class TypeToFunctionsTable

java.lang.Object
  |
  +--gpsys.TypeToFunctionsTable

public class TypeToFunctionsTable
extends java.lang.Object
implements java.io.Serializable

A Table that maps a given Type to an array of Functions returning that type.

Version:
$Revision: 1.1 $, $Date: 2000/07/05 16:21:25 $
Author:
Adil Qureshi
Department of Computer Science,
University College London,
Gower St,
London WC1E 6BT,
UK.
See Also:
Serialized Form

Field Summary
(package private)  java.util.Hashtable theTable
          The hash table used to store the Function arrays.
 
Constructor Summary
TypeToFunctionsTable(int initialCapacity)
          Creates a table of the specified initial capacity.
 
Method Summary
 Function[] get(Type t)
          Get all the Functions that return the specified type.
 void put(Type t, Function[] functions)
          Put the specified Functions array in the table.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

theTable

java.util.Hashtable theTable
The hash table used to store the Function arrays. The key used is the return type of the Functions.
Constructor Detail

TypeToFunctionsTable

public TypeToFunctionsTable(int initialCapacity)
Creates a table of the specified initial capacity. The table is automatically increased in size if the number of entries exceed 50% of the initial capacity.
Parameters:
initialCapacity - The initial capacity of the table.
Method Detail

get

public final Function[] get(Type t)
Get all the Functions that return the specified type.
Parameters:
t - The return type of the Functions.

put

public final void put(Type t,
                      Function[] functions)
Put the specified Functions array in the table. The functions all return the type t which is the key to be used for retrieval via get().
Parameters:
t - The return type of the Functions.
functions - The array of functions return the above type.