|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--Animal
abstract class at root of shore animal hierarchy provides functionality for animal ages and when they die also defines abstract methods makeMove() and getPrintChar() field int age - animal's age (private) field int maxAge - maximun age this animal can attain (private)
Method Summary | |
int |
getAge()
observer of animal's age |
int |
getmaxAge()
observer of animal's maximum age; can be called by simulation clients |
abstract char |
getPrintChar()
function returns printable character representation of animal |
void |
incrAge()
mutator of animal's age; can be called by simulation clients |
abstract Location |
makeMove(Location l,
World w)
function returns new Location (position) to move to for an animal; if there is nowhere legal to move, then the function returns null; if an animal is sessile, then the function returns null; |
protected void |
setmaxAge(int age)
mutator of animal's maximum age; called by descendent classes |
boolean |
timeToDie()
function calculates whether or not the animal attains its maximum age on this time step; if so then it dies; if not it survives |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Method Detail |
public int getAge()
public void incrAge()
protected void setmaxAge(int age)
public int getmaxAge()
public boolean timeToDie()
public abstract char getPrintChar()
public abstract Location makeMove(Location l, World w)
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |