scale.clef.decl
Class DeclTable

java.lang.Object
  |
  +--scale.clef.decl.DeclTable
All Implemented Interfaces:
java.io.Serializable

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

This class maps from an integer value to a Clef Declaration.

$Id: DeclTable.java,v 1.4 2002/01/03 21:42:41 burrill Exp $

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

See Also:
Serialized Form

Constructor Summary
DeclTable(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 elements()
           
 Declaration get(int key)
          Find an entry in the map.
 Declaration put(int key, Declaration 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

DeclTable

public DeclTable(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(int, scale.clef.decl.Declaration, int)

put

public Declaration put(int key,
                       Declaration 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 Declaration get(int 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 elements()
Returns:
an Enumeration of all of the elements in the map.