/*
 * $Log: Set.java,v $
 * Revision 1.1  1996/03/18  19:08:23  rlj1
 * Initial revision
 *
 */
//////////////////////////////////////////////////
package general;

// Standard packages.
import java.util.Hashtable;

// Packages specific to Network Design Tool.
import general.GenericException;
//////////////////////////////////////////////////
public class Set extends Hashtable {

private Class ClassOfMembers;	    // Type of set members.
//************************************************
public Set(Class SetOfClass) {	   
// REQUIRES:
// 1. SetOfClass is the runtime representation of the class, obtained by
// getClass() 
// RETURNS: nothing.
// PROMISES: 1. This set contains objects of type only SetOfClass.

  ClassOfMembers = SetOfClass;
}

//************************************************
public synchronized Object putIn(Object key, Object value) {
// REQUIRES: nothing.
// RETURNS: nothing.
// PROMISES: 1. Throws GenericException if value is not of the type with
// which set was created.

  if(value.getClass() != ClassOfMembers) 
    throw(new GenericException("Trying to put illegal value in Set!"));
  
  return super.put(key,value);
}
//************************************************

//************************************************
private synchronized Object put(Object key, Object value) {
// REQUIRES: nothing.
// RETURNS: nothing.
// PROMISES: there will be no use of the original put function
}
//************************************************

}
//////////////////////////////////////////////////




