home *** CD-ROM | disk | FTP | other *** search
/ ActiveX Programming Unleashed CD / AXU.iso / jgl_1_1 / jgl_1_1.exe / src / Set.java < prev    next >
Encoding:
Java Source  |  1996-09-10  |  1.1 KB  |  41 lines

  1. // Copyright(c) 1996 ObjectSpace, Inc.
  2. // Portions Copyright(c) 1995, 1996 Hewlett-Packard Company.
  3.  
  4. package jgl;
  5.  
  6. /**
  7.  * Set is the interface that is implemented by all of the
  8.  * Java Generic Library sets. 
  9.  * <p>
  10.  * @see jgl.HashSet
  11.  * @see jgl.OrderedSet
  12.  * @version 1.1
  13.  * @author ObjectSpace, Inc.
  14.  */
  15.  
  16. public interface Set extends Container
  17.   {
  18.   /**
  19.    * Return the first object that matches the given object, or null if no match exists.
  20.    * @param object The object to match against.
  21.    * @see Set#put
  22.    */
  23.   public Object get( Object object );
  24.  
  25.   /**
  26.    * If the object doesn't exist, add the object and return null, otherwise replace the 
  27.    * first object that matches and return the old object. 
  28.    * @param object The object to add.
  29.    * @see Set#get
  30.    */
  31.   public Object put( Object object );
  32.  
  33.   /**
  34.    * Remove all objects that match the given object.
  35.    * @param object The object to match for removals
  36.    * @return the object removed, or null if the object was not found.
  37.    */
  38.    public Object remove( Object key );
  39.   }
  40.  
  41.