Class Dog

java.lang.Object
  |
  +--Dog

public class Dog
extends java.lang.Object

One of several animal types, in this case, a canine.


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 eat(double pounds)
          Eat some goodies.
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Dog

public Dog(java.lang.String theName)
Create a new Dog with default characteristics. This constructor sets a default meal size of 1 pound and an initial weight of 40 pound.

Parameters:
theName - name of this animal

Dog

public Dog(java.lang.String theName,
           double serving,
           double weight)
Create a new Dog, using supplied parameter values.

Parameters:
theName - name of this animal
serving - the size of a single meal for this animal in pounds
weight - the initial weight of this animal in pounds
Method Detail

eat

public void eat(double pounds)
Eat some goodies. There is some weight gain after eating.

Parameters:
pounds - the number of pounds of food provided.

getMealSize

public double getMealSize()
get the meal size defined for this animal.

Returns:
meal size in pounds

getCurrentWeight

public double getCurrentWeight()
get the current weight of this animal.

Returns:
weight in pounds

getName

public java.lang.String getName()
get the name of this animal.

Returns:
the name