KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > ojb > broker > Mammal


1 package org.apache.ojb.broker;
2
3 import java.io.Serializable JavaDoc;
4
5 /**
6  * @author <a HREF="mailto:schneider@mendel.imp.univie.ac.at">Georg Schneider</a>
7  *
8  */

9 public class Mammal implements InterfaceAnimal, Serializable JavaDoc
10 {
11     private int animalId;
12     private int age;
13     private String JavaDoc name;
14     private int numLegs;
15     private int zooId;
16
17
18     /**
19      * Constructor for Animal.
20      */

21     public Mammal()
22     {
23         super();
24     }
25
26     public Mammal(int age, String JavaDoc 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 JavaDoc getName()
40     {
41         return name;
42     }
43
44     public int getNumLegs()
45     {
46         return numLegs;
47     }
48
49     public String JavaDoc 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     /**
57      * Returns the animalId.
58      * @return int
59      */

60     public int getAnimalId()
61     {
62         return animalId;
63     }
64
65     /**
66      * Returns the zooId.
67      * @return int
68      */

69     public int getZooId()
70     {
71         return zooId;
72     }
73
74     /**
75      * Sets the age.
76      * @param age The age to set
77      */

78     public void setAge(int age)
79     {
80         this.age = age;
81     }
82
83     /**
84      * Sets the animalId.
85      * @param animalId The animalId to set
86      */

87     public void setAnimalId(int animalId)
88     {
89         this.animalId = animalId;
90     }
91
92     /**
93      * Sets the name.
94      * @param name The name to set
95      */

96     public void setName(String JavaDoc name)
97     {
98         this.name = name;
99     }
100
101     /**
102      * Sets the numLegs.
103      * @param numLegs The numLegs to set
104      */

105     public void setNumLegs(int numLegs)
106     {
107         this.numLegs = numLegs;
108     }
109
110     /**
111      * Sets the zooId.
112      * @param zooId The zooId to set
113      */

114     public void setZooId(int zooId)
115     {
116         this.zooId = zooId;
117     }
118
119 }
120
Popular Tags