1 9 package test.odmg; 10 11 import org.ozoneDB.*; 12 13 14 public class Auto extends OzoneObject implements OzoneRemote { 15 16 protected String name = "Ford"; 17 18 protected int age = 0; 19 20 protected Auto link; 21 22 23 public Auto( String _name ) throws Exception { 24 name = _name; 25 } 26 27 28 public boolean equals( Object obj ) { 29 Auto auto = (Auto)obj; 30 return name.equals( auto.name() ); 31 } 32 33 34 public Auto doSomthing( Auto auto ) throws Exception { 35 System.out.println( "got: " + auto.toString() + " (" + auto.getClass().getName() + ")" ); 36 return this; 37 } 38 39 40 public Auto setLink( Auto auto ) throws Exception { 41 link = auto; 43 return this; 44 } 45 46 47 public void print() { 48 System.out.println( toString() ); 49 } 50 51 52 public void setName( String newName ) { 53 name = newName; 54 } 55 56 57 public String name() { 58 return name; 59 } 60 61 62 public void setAge( Integer newAge ) { 63 age = newAge.intValue(); 64 } 66 67 68 public int setAge( int newAge ) { 69 int ret = age; 70 age = newAge; 71 return age; 72 } 73 74 75 public Integer age() { 76 return new Integer ( age ); 77 } 78 79 80 public String toString() { 81 return "Auto:" + name + ", " + String.valueOf( age ); 83 } 84 85 86 public void done() throws Exception { 87 } 89 90 } 91 | Popular Tags |