1 package org.jacorb.test.orb.rmi; 2 3 public class Zoo implements java.io.Serializable { 4 public String id; 5 public String name; 6 public Zoo inner; 7 private transient Object hidden = "hidden"; 8 public Zoo(String id, String name) { 9 this.id = id; 10 this.name = name; 11 this.inner = null; 12 } 13 public Zoo(String id, String name, Zoo inner) { 14 this.id = id; 15 this.name = name; 16 this.inner = inner; 17 } 18 public String toString() { 19 return "Zoo(" + id + ", \"" + name + "\"" + 20 ((inner == null) ? "" : ", " + inner.toString()) + ")"; 21 } 22 public boolean equals(Object o) { 23 return (o instanceof Zoo) 24 && (((Zoo)o).id.equals(id)) 25 && (((Zoo)o).name.equals(name)) 26 && ((((Zoo)o).inner == null && inner == null) 27 || (((Zoo)o).inner != null && ((Zoo)o).inner.equals(inner))); 28 } 29 private synchronized void writeObject(java.io.ObjectOutputStream s) 30 throws java.io.IOException { 31 id = id + "!"; 32 s.defaultWriteObject(); 33 } 34 } 35 | Popular Tags |