01: package org.apache.ojb.broker;
02:
03: import java.io.Serializable;
04:
05: /**
06: * class used in testing polymorphic m:n collections
07: * @author <a href="mailto:schneider@mendel.imp.univie.ac.at">Georg Schneider</a>
08: *
09: */
10: public class Fish implements InterfaceFood, Serializable {
11: int foodId;
12: String name;
13: int calories;
14: String typeOfWater;
15:
16: /**
17: * Constructor for Fish.
18: */
19: public Fish() {
20: super ();
21: }
22:
23: public Fish(String name, int calories, String typeOfWater) {
24: this .calories = calories;
25: this .name = name;
26: this .typeOfWater = typeOfWater;
27: }
28:
29: /**
30: * @see org.apache.ojb.broker.InterfaceFood#getName()
31: */
32: public String getName() {
33: return name;
34: }
35:
36: /**
37: * @see org.apache.ojb.broker.InterfaceFood#getCalories()
38: */
39: public int getCalories() {
40: return calories;
41: }
42:
43: /**
44: * Returns the typeOfWater.
45: * @return String
46: */
47: public String getTypeOfWater() {
48: return typeOfWater;
49: }
50:
51: /**
52: * Returns the foodId.
53: * @return int
54: */
55: public int getFoodId() {
56: return foodId;
57: }
58:
59: public String toString() {
60: return "Fish: id = " + foodId + "\n name = " + name
61: + "\n calories = " + calories + "\n Type of water = "
62: + typeOfWater;
63: }
64:
65: /**
66: * Sets the calories.
67: * @param calories The calories to set
68: */
69: public void setCalories(int calories) {
70: this .calories = calories;
71: }
72:
73: /**
74: * Sets the foodId.
75: * @param foodId The foodId to set
76: */
77: public void setFoodId(int foodId) {
78: this .foodId = foodId;
79: }
80:
81: /**
82: * Sets the name.
83: * @param name The name to set
84: */
85: public void setName(String name) {
86: this .name = name;
87: }
88:
89: /**
90: * Sets the typeOfWater.
91: * @param typeOfWater The typeOfWater to set
92: */
93: public void setTypeOfWater(String typeOfWater) {
94: this.typeOfWater = typeOfWater;
95: }
96:
97: }
|