Class Bird

java.lang.Object
  |
  +--Bird

public class Bird
extends java.lang.Object

One of several animal types, in this case, a avian creature.


Constructor Summary
Bird(java.lang.String theName)
          Create a new Bird with default characteristics.
Bird(java.lang.String theName, double serving, double weight)
          Create a new Bird, 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

Bird

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

Parameters:
theName - name of this animal

Bird

public Bird(java.lang.String theName,
            double serving,
            double weight)
Create a new Bird, 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