home *** CD-ROM | disk | FTP | other *** search
/ Symantec Visual Cafe for Java 2.5 / symantec-visual-cafe-2.5-database-dev-edition.iso / Extras / OSpace / jgl.exe / jgl_2_0 / src / COM / objectspace / jgl / Map.java < prev    next >
Encoding:
Java Source  |  1997-03-14  |  2.8 KB  |  111 lines

  1. // Copyright(c) 1997 ObjectSpace, Inc.
  2.  
  3. package COM.objectspace.jgl;
  4.  
  5. import java.util.Dictionary;
  6. import java.util.Enumeration;
  7.  
  8. /**
  9.  * Map is the abstract class that in implemented by all JGL maps.
  10.  * <p>
  11.  * This abstract class was deprecated because it wasn't deemed to give
  12.  * enough value for the added complexity.  No functionality is lost from the
  13.  * concrete classes as Map is effectively just an interface.
  14.  * <p>
  15.  * @deprecated
  16.  * @see COM.objectspace.jgl.HashMap
  17.  * @see COM.objectspace.jgl.OrderedMap
  18.  * @version 2.0.2
  19.  * @author ObjectSpace, Inc.
  20.  */
  21.  
  22. public abstract class Map extends Dictionary implements Container
  23.   {
  24.   /**
  25.    * Return the number of key/value pairs that match a particular key.
  26.    * @param key The key to match against.
  27.    */
  28.   public abstract int count( Object key );
  29.  
  30.   /**
  31.    * Return the number of values that match a given object.
  32.    * @param value The value to match against.
  33.    */
  34.   public abstract int countValues( Object value );
  35.  
  36.   /**
  37.    * Return an Enumeration of all my keys that are associated with a particular value.
  38.    * @param value The value to match.
  39.    */
  40.   public abstract Enumeration keys( Object value );
  41.  
  42.   /**
  43.    * Return an Enumeration of all my values that are associated with a particular key.
  44.    * @param key The key to match.
  45.    */
  46.   public abstract Enumeration values( Object key );
  47.  
  48.   //
  49.   // The following methods are all from the Container interface.
  50.   // They are listed here again to avoid a compiler bug.
  51.   //
  52.  
  53.   /**
  54.    * Return a shallow copy of myself.
  55.    */
  56.   public abstract Object clone();
  57.  
  58.   /**
  59.    * Return a string that describes me.
  60.    */
  61.   public abstract String toString();
  62.  
  63.   /**
  64.    * Return true if I'm equal to a specified object.
  65.    * @param object The object to compare myself against.
  66.    * @return true if I'm equal to the specified object.
  67.    */
  68.   public abstract boolean equals( Object object );
  69.  
  70.   /**
  71.    * Return the number of objects that I contain.
  72.    */
  73.   public abstract int size();
  74.  
  75.   /**
  76.    * Return the maximum number of objects that I can contain.
  77.    */
  78.   public abstract int maxSize();
  79.  
  80.   /**
  81.    * Return true if I contain no objects.
  82.    */
  83.   public abstract boolean isEmpty();
  84.  
  85.   /**
  86.    * Remove all of my objects.
  87.    */
  88.   public abstract void clear();
  89.  
  90.   /**
  91.    * Return an Enumeration of the components in this container
  92.    */
  93.   public abstract Enumeration elements();
  94.  
  95.   /**
  96.    * Return an iterator positioned at my first item.
  97.    */
  98.   public abstract ForwardIterator start();
  99.  
  100.   /**
  101.    * Return an iterator positioned immediately after my last item.
  102.    */
  103.   public abstract ForwardIterator finish();
  104.  
  105.   /**
  106.    * Add an object to myself. If appropriate, return the object that it replaced, otherwise
  107.    * return null.
  108.    */
  109.   public abstract Object add( Object object );
  110.   }
  111.