edu.cornell.cs.sam.core
Class SamReferenceTable

java.lang.Object
  extended by edu.cornell.cs.sam.core.SamReferenceTable
All Implemented Interfaces:
ReferenceTable, java.io.Serializable

public class SamReferenceTable
extends java.lang.Object
implements ReferenceTable, java.io.Serializable

Reference table implementation using a hashtable of array lists with references.

See Also:
Serialized Form

Constructor Summary
SamReferenceTable()
           
 
Method Summary
 void add(java.lang.String symbol, int ref_address)
          Adds a new reference to a symbol
 void deleteSymbol(java.lang.String symbol)
          Deletes a symbol and all references to it
 java.util.Collection<java.lang.Integer> getReferences(java.lang.String symbol)
          Returns the addresses to all references to a particular symbol.
 int size()
          Returns the size of the reference table
 java.lang.String toString()
          Returns a string version of the table
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SamReferenceTable

public SamReferenceTable()
Method Detail

add

public void add(java.lang.String symbol,
                int ref_address)
Description copied from interface: ReferenceTable
Adds a new reference to a symbol

Specified by:
add in interface ReferenceTable

deleteSymbol

public void deleteSymbol(java.lang.String symbol)
Description copied from interface: ReferenceTable
Deletes a symbol and all references to it

Specified by:
deleteSymbol in interface ReferenceTable

getReferences

public java.util.Collection<java.lang.Integer> getReferences(java.lang.String symbol)
Description copied from interface: ReferenceTable
Returns the addresses to all references to a particular symbol.

Specified by:
getReferences in interface ReferenceTable

size

public int size()
Description copied from interface: ReferenceTable
Returns the size of the reference table

Specified by:
size in interface ReferenceTable

toString

public java.lang.String toString()
Description copied from interface: ReferenceTable
Returns a string version of the table

Specified by:
toString in interface ReferenceTable
Overrides:
toString in class java.lang.Object