1 26 package org.objectweb.util.monolog.provider.lib.topics; 27 28 import java.util.HashMap ; 29 30 31 36 public class TopicsMap implements TopicsPool { 37 40 private HashMap binding_name = new HashMap (); 41 private HashMap binding_desc = new HashMap (); 42 private HashMap binding_ref = new HashMap (); 43 44 47 public TopicsMap() { 48 } 49 50 55 public String getName(Class ref) { 56 return (String ) binding_name.get(ref); 57 } 58 59 64 public String [] getDescription(String name) { 65 return (String []) binding_desc.get(name); 66 } 67 68 public String [] getAllName() { 69 Object [] tmp = binding_name.values().toArray(); 70 String res[] = new String [tmp.length]; 71 for (int i = 0; i < tmp.length; i++) 72 res[i] = (String ) tmp[i]; 73 return res; 74 } 75 76 81 public int put(TopicsValue value) { 82 binding_name.put(value.getRef(), value.getName()); 83 binding_desc.put(value.getRef(), value.getDescription()); 84 binding_ref.put(value.getName(), value.getRef()); 85 return 0; 86 } 87 88 95 public int put(Class ref, String name, String [] description) { 96 return put(new TopicsValue(ref,name,description)); 97 } 98 99 public HashMap getTopicsByRef() { 100 return binding_name; 101 } 102 } 103 | Popular Tags |