1 6 7 package org.webjmx.example; 8 9 import java.util.*; 10 11 16 public class SimpleStandardType extends com.sun.jdmk.Enumerated 17 { 18 private static String strings[] = { "Type 1", "Type2" }; 19 private static Map stringMap = new HashMap(); 20 private static Map intMap = new HashMap(); 21 22 static 23 { 24 for(int i =0; i < strings.length; i++) 25 { 26 intMap.put(new Integer (i), strings[i]); 27 stringMap.put(strings[i], new Integer (i)); 28 } 29 } 30 31 32 public SimpleStandardType() 33 { } 34 35 36 public SimpleStandardType(String type) 37 throws java.lang.IllegalArgumentException 38 { 39 super(type); 40 } 41 42 protected java.util.Hashtable getIntTable() 43 { 44 return new Hashtable(intMap); 45 } 46 47 protected java.util.Hashtable getStringTable() 48 { 49 return new Hashtable(stringMap); 50 } 51 52 public java.util.Enumeration valueIndexes() 53 { 54 return (new Hashtable(intMap)).keys(); 55 } 56 57 public java.util.Enumeration valueStrings() 58 { 59 return (new Hashtable(stringMap)).keys(); 60 } 61 62 } 63 | Popular Tags |