1 24 25 package com.mckoi.database; 26 27 import com.mckoi.database.global.SQLTypes; 28 import com.mckoi.database.global.ByteLongObject; 29 30 35 36 public class TJavaObjectType extends TType { 37 38 static final long serialVersionUID = -4413863997719593305L; 39 40 44 private String class_type; 45 46 49 public TJavaObjectType(String class_type) { 50 super(SQLTypes.JAVA_OBJECT); 51 this.class_type = class_type; 52 } 53 54 58 public String getJavaClassTypeString() { 59 return class_type; 60 } 61 62 public boolean comparableTypes(TType type) { 63 return (type instanceof TJavaObjectType); 64 } 65 66 public int compareObs(Object ob1, Object ob2) { 67 throw new Error ("Java object types can not be compared."); 68 } 69 70 public int calculateApproximateMemoryUse(Object ob) { 71 if (ob != null) { 72 return ((ByteLongObject) ob).length() + 4; 73 } 74 else { 75 return 4 + 8; 76 } 77 } 78 79 public Class javaClass() { 80 return ByteLongObject.class; 81 } 82 83 } 84 | Popular Tags |