1 package org.apache.ojb.broker; 2 3 import java.io.Serializable ; 4 5 6 11 public class Fish implements InterfaceFood, Serializable 12 { 13 int foodId; 14 String name; 15 int calories; 16 String typeOfWater; 17 18 21 public Fish() 22 { 23 super(); 24 } 25 26 public Fish(String name, int calories, String typeOfWater) 27 { 28 this.calories = calories; 29 this.name = name; 30 this.typeOfWater = typeOfWater; 31 } 32 33 36 public String getName() 37 { 38 return name; 39 } 40 41 44 public int getCalories() 45 { 46 return calories; 47 } 48 49 50 51 55 public String getTypeOfWater() 56 { 57 return typeOfWater; 58 } 59 60 64 public int getFoodId() 65 { 66 return foodId; 67 } 68 69 public String toString() 70 { 71 return "Fish: id = " + foodId + "\n name = " + name + 72 "\n calories = " + calories + 73 "\n Type of water = " + typeOfWater; 74 } 75 76 77 81 public void setCalories(int calories) 82 { 83 this.calories = calories; 84 } 85 86 90 public void setFoodId(int foodId) 91 { 92 this.foodId = foodId; 93 } 94 95 99 public void setName(String name) 100 { 101 this.name = name; 102 } 103 104 108 public void setTypeOfWater(String typeOfWater) 109 { 110 this.typeOfWater = typeOfWater; 111 } 112 113 } 114 | Popular Tags |