gpsys
Class TypeToTerminalsTable

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

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

A Table that maps a given Type to an array of Terminals 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
           
 
Constructor Summary
TypeToTerminalsTable(int initialCapacity)
          Creates a table of the specified initial capacity.
 
Method Summary
 Terminal[] get(Type t)
          Get all the Terminals that return the specified type.
 void put(Type t, Terminal[] terminals)
          Put the specified Terminals 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
Constructor Detail

TypeToTerminalsTable

public TypeToTerminalsTable(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 Terminal[] get(Type t)
Get all the Terminals that return the specified type.
Parameters:
t - The return type of the Terminals.

put

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