home *** CD-ROM | disk | FTP | other *** search
Java Source | 1996-08-14 | 798 b | 42 lines |
- // Maplikes.java
- // 23.02.96
- //
- // a group of Maplike objects
-
- package cybcerone.orient;
-
- import java.util.Hashtable;
- import java.util.Vector;
- import java.util.Enumeration;
-
- /**
- * A group of Maplike objects, lets us search by name.
- */
- public class Maplikes {
- private Hashtable theMaps;
-
- public Maplikes () {
- theMaps = new Hashtable ();
- }
-
- public Maplikes (Vector someMaps) {
- theMaps = new Hashtable ();
- add (someMaps);
- }
-
- public void add (Maplike aMap) {
- aMap.setMaplikes (this);
- theMaps.put (aMap.getName (), aMap);
- }
-
- public void add (Vector someMaps) {
- for (Enumeration e = someMaps.elements ();
- e.hasMoreElements ();)
- add ((Maplike)e.nextElement ());
- }
-
- public Maplike findMap (String name) {
- return (Maplike)theMaps.get (name);
- }
- }
-