1 21 22 package org.apache.derby.impl.store.access; 23 24 import org.apache.derby.iapi.reference.SQLState; 25 26 import org.apache.derby.iapi.services.io.ArrayInputStream; 27 28 import org.apache.derby.iapi.services.sanity.SanityManager; 29 30 import org.apache.derby.iapi.services.io.Storable; 31 32 import org.apache.derby.iapi.services.io.FormatIdUtil; 33 import org.apache.derby.iapi.services.io.StoredFormatIds; 34 35 import org.apache.derby.iapi.error.StandardException; 36 37 import org.apache.derby.iapi.types.DataValueDescriptor; 38 39 import org.apache.derby.iapi.types.Orderable; 40 41 import org.apache.derby.iapi.services.cache.ClassSize; 42 43 import org.apache.derby.iapi.types.DataType; 44 45 import java.sql.ResultSet ; 46 import java.sql.SQLException ; 47 48 import java.io.ObjectOutput ; 49 import java.io.ObjectInput ; 50 import java.io.IOException ; 51 52 public class StorableFormatId extends DataType 53 { 54 55 private int format_id; 56 57 private static final int BASE_MEMORY_USAGE = ClassSize.estimateBaseFromCatalog( StorableFormatId.class); 58 59 public int estimateMemoryUsage() 60 { 61 return BASE_MEMORY_USAGE; 62 } 63 64 65 66 public StorableFormatId() 67 { 68 } 69 70 public StorableFormatId(int value) 71 { 72 this.format_id = value; 73 } 74 75 76 77 public int getValue() 78 { 79 return format_id; 81 } 82 83 public void setValue(int input_value) 84 { 85 this.format_id = input_value; 86 } 87 88 91 92 97 public int getTypeFormatId() 98 { 99 return StoredFormatIds.ACCESS_FORMAT_ID; 100 } 101 102 public boolean isNull() 103 { 104 return false; 105 } 106 107 public void writeExternal(ObjectOutput out) throws IOException 108 { 109 FormatIdUtil.writeFormatIdInteger(out, format_id); 110 } 111 112 113 public void readExternal(ObjectInput in) throws IOException 114 { 115 format_id = FormatIdUtil.readFormatIdInteger(in); 116 } 117 public void readExternalFromArray(ArrayInputStream in) throws IOException 118 { 119 format_id = FormatIdUtil.readFormatIdInteger(in); 120 } 121 122 123 public void restoreToNull() 124 { 125 format_id = 0; 126 } 127 128 132 133 148 public int getLength() 149 throws StandardException 150 { 151 throw(StandardException.newException( 152 SQLState.HEAP_UNIMPLEMENTED_FEATURE)); 153 } 154 164 public String getString() throws StandardException 165 { 166 throw(StandardException.newException( 167 SQLState.HEAP_UNIMPLEMENTED_FEATURE)); 168 } 169 170 184 public Object getObject() throws StandardException 185 { 186 return(this); 187 } 188 189 203 public DataValueDescriptor getClone() 204 { 205 if (SanityManager.DEBUG) 206 SanityManager.THROWASSERT("Not implemented!."); 207 208 return(null); 209 } 210 211 216 public DataValueDescriptor getNewNull() 217 { 218 if (SanityManager.DEBUG) 219 SanityManager.THROWASSERT("Not implemented!."); 220 221 return(null); 222 } 223 224 238 public void setValueFromResultSet( 239 ResultSet resultSet, 240 int colNumber, 241 boolean isNullable) 242 throws StandardException, SQLException 243 { 244 throw(StandardException.newException( 245 SQLState.HEAP_UNIMPLEMENTED_FEATURE)); 246 } 247 248 255 protected void setFrom(DataValueDescriptor theValue) 256 throws StandardException 257 { 258 throw(StandardException.newException( 259 SQLState.HEAP_UNIMPLEMENTED_FEATURE)); 260 } 261 262 269 public String getTypeName() 270 { 271 if (SanityManager.DEBUG) 272 SanityManager.THROWASSERT("Not implemented!."); 273 274 return(null); 275 } 276 277 295 public int compare(DataValueDescriptor other) 296 throws StandardException 297 { 298 throw(StandardException.newException( 299 SQLState.HEAP_UNIMPLEMENTED_FEATURE)); 300 } 301 302 303 } 304 | Popular Tags |