1 10 11 package com.triactive.jdo.test.views; 12 13 import com.triactive.jdo.test.*; 14 15 16 public class SetWidgetCounts extends TestObject 17 { 18 private SetWidget sw; 19 private int normalSetSize; 20 private int inverseSetSize; 21 22 23 26 protected SetWidgetCounts() {} 27 28 29 public SetWidgetCounts(SetWidget sw) 30 { 31 this.sw = sw; 32 this.normalSetSize = sw.getNormalSet().size(); 33 this.inverseSetSize = sw.getInverseSet().size(); 34 } 35 36 37 public SetWidget getSetWidget() 38 { 39 return sw; 40 } 41 42 43 public void fillRandom() 44 { 45 throw new UnsupportedOperationException (); 46 } 47 48 49 public boolean compareTo(Object obj) 50 { 51 if (obj == this) 52 return true; 53 54 if (!(obj instanceof SetWidgetCounts)) 55 return false; 56 57 SetWidgetCounts swc = (SetWidgetCounts)obj; 58 59 return sw.compareTo(swc.sw) 60 && normalSetSize == swc.normalSetSize 61 && inverseSetSize == swc.inverseSetSize; 62 } 63 64 65 public String toString() 66 { 67 StringBuffer s = new StringBuffer (super.toString()); 68 69 s.append(" sw = ").append(sw); 70 s.append('\n'); 71 s.append(" normalSetSize = ").append(normalSetSize); 72 s.append('\n'); 73 s.append(" inverseSetSize = ").append(inverseSetSize); 74 s.append('\n'); 75 76 return s.toString(); 77 } 78 } 79 | Popular Tags |