KickJava   Java API By Example, From Geeks To Geeks.

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


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 Reptile implements InterfaceAnimal, Serializable JavaDoc
10 {
11     private int animalId;
12     private int age;
13     private String JavaDoc name;
14     private String JavaDoc color;
15     private int zooId;
16     /**
17      * Constructor for Plant.
18      */

19     public Reptile()
20     {
21         super();
22     }
23
24     public Reptile(int age, String JavaDoc name, String JavaDoc color)
25     {
26      this.age = age;
27      this.name = name;
28      this.color = color;
29     }
30
31     public int getAge()
32     {
33         return age;
34     }
35
36     public String JavaDoc getName()
37     {
38         return name;
39     }
40
41     public String JavaDoc getColor()
42     {
43         return color;
44     }
45
46    public String JavaDoc toString()
47     {
48         return "Reptile: id = " + animalId + "\n name = " + name +
49                 "\n age = " + age +
50                 "\n color = " + color +
51                 "\n zooId = " + zooId;
52     }
53
54     /**
55      * Returns the animalId.
56      * @return int
57      */

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

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

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

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

94     public void setColor(String JavaDoc color)
95     {
96         this.color = color;
97     }
98
99     /**
100      * Sets the name.
101      * @param name The name to set
102      */

103     public void setName(String JavaDoc name)
104     {
105         this.name = name;
106     }
107
108     /**
109      * Sets the zooId.
110      * @param zooId The zooId to set
111      */

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