1 3 import org.ozoneDB.*; 4 5 6 public class AutoImpl extends OzoneObject implements Auto { 7 8 12 final static long serialVersionUID = 1L; 13 14 String name = "Ford"; 15 16 int age = 0; 17 18 Auto link; 19 20 21 public AutoImpl() { 22 System.out.println( getClass().getName() + " ctor..." ); 23 } 24 25 26 public boolean equals( Object obj ) { 27 Auto auto = (Auto)obj; 28 return name.equals( auto.name() ); 29 } 30 31 32 public Auto doSomething( Auto auto ) throws Exception { 33 System.out.println( "got: " + auto.toString() + " (" + auto.getClass().getName() + ")" ); 34 return this; 35 } 36 37 38 public Auto setLink( Auto auto ) throws Exception { 39 link = auto; 41 return this; 42 } 43 44 45 public void print() { 46 System.out.println( toString() ); 47 } 48 49 50 public void setName( String newName ) { 51 name = newName; 52 } 53 54 55 public String name() { 56 return name; 57 } 58 59 60 public void setAge( Integer newAge ) { 61 age = newAge.intValue(); 62 } 64 65 66 public int setAge( int newAge ) { 67 int result = age; 68 age = newAge; 69 return result; 70 } 71 72 73 public Integer age() { 74 return new Integer ( age ); 75 } 76 77 78 public String toString() { 79 return "Auto:" + name + ", " + String.valueOf( age ); 81 } 82 83 84 public void done() throws Exception { 85 } 87 88 } 89 | Popular Tags |