1 10 11 package com.triactive.jdo.test; 12 13 import javax.jdo.JDOHelper; 14 15 16 public class ElementWidget extends Widget 17 { 18 private SetWidget owner; 19 20 21 24 protected ElementWidget() {} 25 26 public ElementWidget(SetWidget owner) 27 { 28 super(); 29 30 this.owner = owner; 31 } 32 33 34 public SetWidget getOwner() 35 { 36 return owner; 37 } 38 39 40 public void setOwner(SetWidget owner) 41 { 42 this.owner = owner; 43 } 44 45 46 57 58 public boolean compareTo(Object obj) 59 { 60 if (this == obj) 61 return true; 62 63 if (!(obj instanceof ElementWidget) || !super.compareTo(obj)) 64 return false; 65 else 66 return true; 67 } 68 69 70 76 77 public String toString() 78 { 79 StringBuffer s = new StringBuffer (super.toString()); 80 81 s.append(" owner = ").append(JDOHelper.getObjectId(owner)); 82 s.append('\n'); 83 84 return s.toString(); 85 } 86 } 87 | Popular Tags |