1 21 22 package org.apache.derby.impl.sql.compile; 23 24 import org.apache.derby.iapi.error.StandardException; 25 26 import org.apache.derby.iapi.services.sanity.SanityManager; 27 28 import java.util.Hashtable ; 29 import java.util.Enumeration ; 30 31 32 39 40 41 public abstract class HashNodeList extends QueryTreeNode 42 { 43 private Hashtable hashtable = new Hashtable (); 44 45 51 58 public void add( Object key, Object value ) 59 { 60 hashtable.put( key, value ); 61 } 62 63 64 69 public int size() { return hashtable.size(); } 70 71 76 public Enumeration elements() 77 { 78 return hashtable.elements(); 79 } 80 81 82 91 public Object get( Object key ) 92 { 93 return hashtable.get( key ); 94 } 95 96 97 103 109 110 public String toString() 111 { 112 if (SanityManager.DEBUG) 113 { 114 Enumeration iterator; 115 StringBuffer buffer = new StringBuffer (""); 116 Object item; 117 118 for (iterator = elements(); iterator.hasMoreElements() == true; ) 119 { 120 item = iterator.nextElement(); 121 buffer.append(item.toString()); 122 buffer.append("\n"); 123 } 124 125 return buffer.toString(); 126 } 127 else 128 { 129 return ""; 130 } 131 } 132 133 139 148 153 161 public boolean needsSavepoint() 162 { 163 if (SanityManager.DEBUG) 164 { 165 SanityManager.ASSERT(false, 166 "needsSavepoint() not expected to be called."); 167 } 168 return false; 169 } 170 } 171 | Popular Tags |