1 21 package com.db4o.test.types; 22 23 import com.db4o.*; 24 import com.db4o.test.*; 25 26 public class PrivateConstructor implements RTestable 27 { 28 public String s; 29 30 private PrivateConstructor() { 31 } 32 33 public void compare(ObjectContainer con, Object obj, int ver){ 34 Compare.compare(con, set(newInstance(), ver), obj,"", null); 35 } 36 37 static public PrivateConstructor construct(){ 38 return new PrivateConstructor(); 39 } 40 41 public boolean equals(Object obj){ 42 if(obj != null){ 43 if(obj instanceof PrivateConstructor){ 44 return s.equals(((PrivateConstructor)obj).s); 45 } 46 } 47 return false; 48 } 49 50 public boolean jdk2(){ 51 return true; 52 } 53 54 public Object newInstance(){ 55 return new PrivateConstructor(); 56 } 57 58 public Object set(Object obj, int ver){ 59 ((PrivateConstructor)obj).set(ver); 60 return obj; 61 } 62 63 public void set(int ver){ 64 s = "set" + ver; 65 } 66 67 public boolean ver3(){ 68 return false; 69 } 70 71 } 72 | Popular Tags |