/* File: HashedSet.java * Contains: A set collector based on Hashtables. * Author: Jeff Dalton * Created: March 1998 * Updated: Sun May 20 17:22:19 2001 by Jeff Dalton * Copyright: (c) 1998, AIAI, University of Edinburgh */ package ix.ileed; import java.util.Hashtable; import java.util.Enumeration; import ix.util.Collector; /** * A set collector based on Hashtables. * * A HashSet can used to collect objects when (a) the same object might * be added more than once, (b) no object should appear more than once * in an enumeration of the collected elements, and (c) the order of * objects in the element-enumeration doesn't matter. * * @see ix.util.Seq * @see ix.util.lisp.LListCollector */ public class HashedSet extends Hashtable implements Collector { public HashedSet() { super(); } public void addElement(Object e) { put(e, e); } public Object result() { return this; // /\/ } }