1 18 package org.apache.tools.ant.util; 19 20 import java.util.Hashtable ; 21 import java.util.Enumeration ; 22 23 31 public class LazyHashtable extends Hashtable { 32 protected boolean initAllDone = false; 34 36 37 public LazyHashtable() { 38 super(); 39 } 40 41 45 protected void initAll() { 46 if (initAllDone) { 47 return; 48 } 49 initAllDone = true; 50 } 51 52 53 57 public Enumeration elements() { 58 initAll(); 59 return super.elements(); 60 } 61 62 66 public boolean isEmpty() { 67 initAll(); 68 return super.isEmpty(); 69 } 70 71 75 public int size() { 76 initAll(); 77 return super.size(); 78 } 79 80 85 public boolean contains(Object value) { 86 initAll(); 87 return super.contains(value); 88 } 89 90 95 public boolean containsKey(Object value) { 96 initAll(); 97 return super.containsKey(value); 98 } 99 100 105 public boolean containsValue(Object value) { 106 return contains(value); 107 } 108 109 113 public Enumeration keys() { 114 initAll(); 115 return super.keys(); 116 } 117 118 } 121 | Popular Tags |