scale.common
Class StringTable

java.lang.Object
  extended by scale.common.StringTable

public class StringTable
extends java.lang.Object

This class maps from an integer value to a String.

$Id: StringTable.java,v 1.13 2007-01-04 16:57:59 burrill Exp $

Copyright 2006 by the Scale Compiler Group,
Department of Computer Science
University of Massachusetts,
Amherst MA. 01003, USA
All Rights Reserved.


Constructor Summary
StringTable(int capacity)
           
 
Method Summary
 void clear()
          Remove all entries from the map.
 void clear(int flag)
          Remove all entries with the specified flag value from the map.
 java.util.Enumeration<java.lang.String> elements()
          Return an enumeration of all of the elements in the map.
 java.lang.String get(long key)
          Find an entry in the map.
 java.lang.String put(long key, java.lang.String value, int flag)
          Place an entry in the map unless it is already there.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringTable

public StringTable(int capacity)
Parameters:
capacity - initial capacity - should be prime
Method Detail

clear

public void clear()
Remove all entries from the map.


clear

public void clear(int flag)
Remove all entries with the specified flag value from the map.

See Also:
put(long, java.lang.String, int)

put

public java.lang.String put(long key,
                            java.lang.String value,
                            int flag)
Place an entry in the map unless it is already there. There can be only one tuple with this key.

Parameters:
key - map from this key to the value
flag - is a separate integer value attached to the mapping
Returns:
the previous value

get

public java.lang.String get(long key)
Find an entry in the map. There can be only one tuple with this key.

Parameters:
key - map from this key to the value
Returns:
the value

elements

public java.util.Enumeration<java.lang.String> elements()
Return an enumeration of all of the elements in the map.