1 25 26 package org.objectweb.jorm.mapper.rdb.inheritance; 27 28 import org.objectweb.jorm.pobject.inheritance.extent.KoalaAccessor; 29 import org.objectweb.jorm.api.PException; 30 31 public class Koala extends Mammal implements KoalaAccessor { 32 int lifeTimeAverage; 33 34 public Koala(boolean isMale, int size, int gestationLength, 35 int lifeTimeAverage) { 36 super(isMale, size, gestationLength); 37 this.lifeTimeAverage = lifeTimeAverage; 38 } 39 public void paSetLifetimeAverage(int val) throws PException { 41 lifeTimeAverage = val; 42 } 43 public String paGetSpecies(){ 44 return "koala"; 45 } 46 47 public int paGetLifetimeAverage() throws PException { 48 return lifeTimeAverage; 49 } 50 public boolean equals(Object o) { 51 if (!super.equals(o)) { 52 return false; 53 } 54 55 if (o instanceof Koala) { 56 Koala koala = (Koala) o; 57 return (koala.lifeTimeAverage == lifeTimeAverage); 58 } 59 return false; 60 } 61 62 } 63 | Popular Tags |