1 25 29 package org.jresearch.gossip.am.ban; 30 31 import java.util.HashMap ; 32 import java.util.HashSet ; 33 import java.util.Map ; 34 35 39 public class BanMap implements Cloneable { 40 41 private HashMap map = new HashMap (); 42 43 47 public void add(String mask, int type) { 48 String key = Integer.toString(type); 49 if (!map.containsKey(key)) { 50 map.put(key, new HashSet ()); 51 } 52 ((HashSet ) map.get(key)).add(mask); 53 } 54 55 59 public HashSet get(int type) { 60 return (HashSet ) map.get(Integer.toString(type)); 61 62 } 63 64 69 protected Object clone() throws CloneNotSupportedException { 70 return super.clone(); 71 } 72 73 public Map getMap() { 74 return (Map ) map.clone(); 75 } 76 } | Popular Tags |