1 package org.apache.torque.om; 2 3 21 22 import java.io.Serializable ; 23 import org.apache.torque.TorqueException; 24 25 34 public abstract class ObjectKey implements Serializable , Comparable 35 { 36 39 protected Object key; 40 41 44 protected ObjectKey() 45 { 46 key = null; 47 } 48 49 55 public int hashCode() 56 { 57 if (key == null) 58 { 59 return super.hashCode(); 60 } 61 return key.hashCode(); 62 } 63 64 69 public Object getValue() 70 { 71 return key; 72 } 73 74 79 public void appendTo(StringBuffer sb) 80 { 81 sb.append(this.toString()); 82 } 83 84 90 public int compareTo(Object obj) 91 { 92 return toString().compareTo(obj.toString()); 93 } 94 95 101 public abstract void setValue(String s) throws TorqueException; 102 } 103 | Popular Tags |