cz/vutbr/fit/dudka/SGVis/Data/UrlMap.java

Go to the documentation of this file.
00001 package cz.vutbr.fit.dudka.SGVis.Data;
00002 
00003 import java.net.URL;
00004 import java.util.HashMap;
00005 
00011 public class UrlMap<KEY> {
00012   private HashMap<KEY, UrlSet> map;
00013   
00014   public UrlMap() {
00015     map = new HashMap<KEY, UrlSet>();
00016   }
00017   
00022   public UrlMap(UrlMap<KEY> ref) {
00023     map = new HashMap<KEY, UrlSet>(ref.map);
00024   }
00025   
00029   public UrlMap<KEY> clone() {
00030     return new UrlMap<KEY>(this);
00031   }
00032 
00038   public UrlSet get(Object key) {
00039     UrlSet uset = map.get(key);
00040     if (null==uset)
00041       uset = new UrlSet();
00042     return uset;
00043   }
00044   
00050   public void addToSet(KEY key, URL url) {
00051     UrlSet rl = this.get(key);
00052     rl.add(url);
00053     map.put(key, rl);
00054   }
00055   
00059   public Iterable<KEY> getKeys() {
00060     return map.keySet();
00061   }
00062 }

Generated on Sat May 3 22:56:09 2008 for SGVis by  doxygen 1.5.4