com.irs.jam
Class Table

java.lang.Object
  |
  +--com.irs.jam.Table
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
PlanTable, SymbolTable

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

Represents a general table of String-hashed and linearly stored objects

See Also:
Serialized Form

Field Summary
protected  DList[] _hashTable
           
protected  int _hashTableSize
           
protected  int _nextID
           
static int _NullId
           
protected  TableObject[] _table
           
protected  int _tableIncrementSize
           
protected  int _tableSize
           
 
Constructor Summary
Table()
          Default constructor
Table(int tabSz, int tabIncSz, int hashTabSz)
          Constructor with suggested sizes
 
Method Summary
 TableObject add(TableObject obj)
          Add an entry to the table based on the objects name.
 TableObject add(TableObject obj, java.lang.String hashName)
          Add an entry to the table based on the name specified as a parameter.
 DList getBucket(java.lang.String name)
          Return the entire list of symbols in the table that match the specified label.
 DList getBucket(TableObject obj)
          Return the entire list of symbols in the table that match the objects label.
 int getSize()
           
protected  int hash(java.lang.String name)
          Calculate the hash for the symbol with the specified label
 TableObject lookup(int id)
          Retrieve the symbol referenced by the specified identifier
 TableObject lookup(java.lang.String name)
          Retrieve the symbol referenced by the specified label
 TableObject lookup(TableObject obj)
          Return the first symbol entry with the same hash as the specified object.
 void print(java.io.PrintStream s)
          Output information in a non inline manner.
 TableObject replace(TableObject oldObj, TableObject newObj)
          Put the new object in place of the old object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_NullId

public static final int _NullId

_table

protected TableObject[] _table

_hashTable

protected DList[] _hashTable

_tableSize

protected int _tableSize

_hashTableSize

protected int _hashTableSize

_nextID

protected int _nextID

_tableIncrementSize

protected int _tableIncrementSize
Constructor Detail

Table

public Table()
Default constructor

Table

public Table(int tabSz,
             int tabIncSz,
             int hashTabSz)
Constructor with suggested sizes
Method Detail

getSize

public int getSize()

hash

protected int hash(java.lang.String name)
Calculate the hash for the symbol with the specified label

lookup

public TableObject lookup(int id)
Retrieve the symbol referenced by the specified identifier

lookup

public TableObject lookup(java.lang.String name)
Retrieve the symbol referenced by the specified label

lookup

public TableObject lookup(TableObject obj)
Return the first symbol entry with the same hash as the specified object.

add

public TableObject add(TableObject obj)
Add an entry to the table based on the objects name.

add

public TableObject add(TableObject obj,
                       java.lang.String hashName)
Add an entry to the table based on the name specified as a parameter.

replace

public TableObject replace(TableObject oldObj,
                           TableObject newObj)
Put the new object in place of the old object.

getBucket

public DList getBucket(java.lang.String name)
Return the entire list of symbols in the table that match the specified label.

getBucket

public DList getBucket(TableObject obj)
Return the entire list of symbols in the table that match the objects label.

print

public void print(java.io.PrintStream s)
Output information in a non inline manner.