001: package org.apache.ojb.broker;
002:
003: import java.io.Serializable;
004:
005: /**
006: * @author <a href="mailto:schneider@mendel.imp.univie.ac.at">Georg Schneider</a>
007: *
008: */
009: public class Mammal implements InterfaceAnimal, Serializable {
010: private int animalId;
011: private int age;
012: private String name;
013: private int numLegs;
014: private int zooId;
015:
016: /**
017: * Constructor for Animal.
018: */
019: public Mammal() {
020: super ();
021: }
022:
023: public Mammal(int age, String name, int numLegs) {
024: this .age = age;
025: this .name = name;
026: this .numLegs = numLegs;
027: }
028:
029: public int getAge() {
030: return age;
031: }
032:
033: public String getName() {
034: return name;
035: }
036:
037: public int getNumLegs() {
038: return numLegs;
039: }
040:
041: public String toString() {
042: return "Mammal: id = " + animalId + "\n name = " + name
043: + "\n age = " + age + "\n Number of legs = " + numLegs
044: + "\n zooId = " + zooId;
045: }
046:
047: /**
048: * Returns the animalId.
049: * @return int
050: */
051: public int getAnimalId() {
052: return animalId;
053: }
054:
055: /**
056: * Returns the zooId.
057: * @return int
058: */
059: public int getZooId() {
060: return zooId;
061: }
062:
063: /**
064: * Sets the age.
065: * @param age The age to set
066: */
067: public void setAge(int age) {
068: this .age = age;
069: }
070:
071: /**
072: * Sets the animalId.
073: * @param animalId The animalId to set
074: */
075: public void setAnimalId(int animalId) {
076: this .animalId = animalId;
077: }
078:
079: /**
080: * Sets the name.
081: * @param name The name to set
082: */
083: public void setName(String name) {
084: this .name = name;
085: }
086:
087: /**
088: * Sets the numLegs.
089: * @param numLegs The numLegs to set
090: */
091: public void setNumLegs(int numLegs) {
092: this .numLegs = numLegs;
093: }
094:
095: /**
096: * Sets the zooId.
097: * @param zooId The zooId to set
098: */
099: public void setZooId(int zooId) {
100: this.zooId = zooId;
101: }
102:
103: }
|