home *** CD-ROM | disk | FTP | other *** search
/ The Net: Ultimate Internet Guide / WWLCD1.ISO / pc / java / unuy2wen / cybcerone / orient / maplikes.java < prev    next >
Encoding:
Java Source  |  1996-08-14  |  798 b   |  42 lines

  1. // Maplikes.java
  2. // 23.02.96
  3. //
  4. // a group of Maplike objects
  5.  
  6. package cybcerone.orient;
  7.  
  8. import java.util.Hashtable;
  9. import java.util.Vector;
  10. import java.util.Enumeration;
  11.  
  12. /** 
  13.  * A group of Maplike objects, lets us search by name.
  14.  */
  15. public class Maplikes {
  16.   private Hashtable theMaps;
  17.  
  18.   public Maplikes () {
  19.     theMaps = new Hashtable ();
  20.   }
  21.  
  22.   public Maplikes (Vector someMaps) {
  23.     theMaps = new Hashtable ();
  24.     add (someMaps);
  25.   }
  26.  
  27.   public void add (Maplike aMap) {
  28.     aMap.setMaplikes (this);
  29.     theMaps.put (aMap.getName (), aMap);
  30.   }
  31.  
  32.   public void add (Vector someMaps) {
  33.     for (Enumeration e = someMaps.elements ();
  34.      e.hasMoreElements ();)
  35.       add ((Maplike)e.nextElement ());
  36.   }
  37.  
  38.   public Maplike findMap (String name) {
  39.     return (Maplike)theMaps.get (name);
  40.   }
  41. }
  42.