Class ShortLivedSessile

java.lang.Object
  |
  +--Animal
        |
        +--Sessile
              |
              +--ShortLivedSessile
Direct Known Subclasses:
Anemone, Hydroid

public abstract class ShortLivedSessile
extends Sessile
implements ReproducesbyBudding

abstract class which defines buds() for all short-lived sessile animals


Method Summary
 Set buds()
          method uses random number generator to select how many offspring of short-lived sessile animal survive; current settings are 30% 0 survivors, 30% 1 survivor; 40% 2 survivors
abstract  ShortLivedSessile getNewShortLivedSessile()
          abstract method forces all actual animal descendent classes of ShortLivedSessile to define a method that returns a new animal of their kind; allows buds() to be inherited by all these classes
 
Methods inherited from class Sessile
makeMove
 
Methods inherited from class Animal
getAge, getmaxAge, getPrintChar, incrAge, setmaxAge, timeToDie
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getNewShortLivedSessile

public abstract ShortLivedSessile getNewShortLivedSessile()
abstract method forces all actual animal descendent classes of ShortLivedSessile to define a method that returns a new animal of their kind; allows buds() to be inherited by all these classes
Returns:
ShortLivedSessile reference to a new object of a descendent class

buds

public Set buds()
method uses random number generator to select how many offspring of short-lived sessile animal survive; current settings are 30% 0 survivors, 30% 1 survivor; 40% 2 survivors
Specified by:
buds in interface ReproducesbyBudding
Returns:
Set of short-lived sessile animals of one descendent class; an empty Set indicates no survivors