1 package org.apache.ojb.broker; 2 3 import java.io.Serializable ; 4 5 9 public class Mammal implements InterfaceAnimal, Serializable 10 { 11 private int animalId; 12 private int age; 13 private String name; 14 private int numLegs; 15 private int zooId; 16 17 18 21 public Mammal() 22 { 23 super(); 24 } 25 26 public Mammal(int age, String name, int numLegs) 27 { 28 this.age = age; 29 this.name = name; 30 this.numLegs = numLegs; 31 } 32 33 34 public int getAge() 35 { 36 return age; 37 } 38 39 public String getName() 40 { 41 return name; 42 } 43 44 public int getNumLegs() 45 { 46 return numLegs; 47 } 48 49 public String toString() 50 { 51 return "Mammal: id = " + animalId + "\n name = " + name + 52 "\n age = " + age + 53 "\n Number of legs = " + numLegs + 54 "\n zooId = " + zooId; 55 } 56 60 public int getAnimalId() 61 { 62 return animalId; 63 } 64 65 69 public int getZooId() 70 { 71 return zooId; 72 } 73 74 78 public void setAge(int age) 79 { 80 this.age = age; 81 } 82 83 87 public void setAnimalId(int animalId) 88 { 89 this.animalId = animalId; 90 } 91 92 96 public void setName(String name) 97 { 98 this.name = name; 99 } 100 101 105 public void setNumLegs(int numLegs) 106 { 107 this.numLegs = numLegs; 108 } 109 110 114 public void setZooId(int zooId) 115 { 116 this.zooId = zooId; 117 } 118 119 } 120 | Popular Tags |