|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--Dog
One of several animal types, in this case, a canine. This class of Dogs is special because it can also do Acrobat functions.
| Constructor Summary | |
Dog(java.lang.String theName)
Create a new Dog with default characteristics. |
|
Dog(java.lang.String theName,
double serving,
double weight)
Create a new Dog, using supplied parameter values. |
|
| Method Summary | |
void |
clap(int k)
Clap as instructed. |
int |
compareTo(java.lang.Object obj)
Compares this object with the specified object for order. |
void |
eat(double pounds)
Eat some goodies. |
boolean |
equals(java.lang.Object obj)
Compares this Dog to the specified object. |
int |
getActionCount()
Tell the caller how many things we've done so far. |
double |
getCurrentWeight()
get the current weight of this animal. |
double |
getMealSize()
get the meal size defined for this animal. |
java.lang.String |
getName()
get the name of this animal. |
int |
hashCode()
Returns a hash code for this Dog. |
java.lang.String |
toString()
Return a descriptive String. |
void |
twirl(int k)
Twirl around as instructed. |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public Dog(java.lang.String theName)
theName - name of this animal
public Dog(java.lang.String theName,
double serving,
double weight)
theName - name of this animalserving - the size of a single meal for this animal in poundsweight - the initial weight of this animal in pounds| Method Detail |
public void eat(double pounds)
pounds - the number of pounds of food provided.public double getMealSize()
public double getCurrentWeight()
public java.lang.String getName()
public void twirl(int k)
twirl in interface Acrobatk - the number of times to twirlpublic void clap(int k)
clap in interface Acrobatk - the number of times to clappublic int getActionCount()
getActionCount in interface Acrobatpublic int compareTo(java.lang.Object obj)
compareTo in interface java.lang.Comparablepublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectobj - the Dog to compare this Dog against.
public int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||