1 25 26 package org.objectweb.jorm.mapper.rdb.inheritance; 27 28 import org.objectweb.jorm.pobject.inheritance.extent.MammalAccessor; 29 import org.objectweb.jorm.api.PException; 30 31 public abstract class Mammal extends Vertebrate implements MammalAccessor { 32 int gestationLength; 33 34 public Mammal(boolean isMale, int size, int gestationLength) { 35 super(isMale, size); 36 this.gestationLength = gestationLength; 37 } 38 public void paSetGestationLength(int val) throws PException { 40 gestationLength = val; 41 } 42 43 public int paGetGestationLength() throws PException { 44 return gestationLength; 45 } 46 public boolean equals(Object o) { 47 if (!super.equals(o)) { 48 return false; 49 } 50 51 if (o instanceof Mammal) { 52 Mammal mammal = (Mammal) o; 53 return (mammal.gestationLength == gestationLength); 54 } 55 return false; 56 } 57 58 } 59 | Popular Tags |