/**
*
* Aviary.java
*
* Revisions: 1.0 Sep. 26, 2002
* Created the Aviary class
* 1.1 Sep. 28, 2002
* Finished, Compiled, Commented
*
*
*
* Collaboration Statement:
* I worked on the homework assignment alone, using only
* course materials.
*
* Created with JCreatorLE, some indents are off when viewed through notepad
* or EMACS
*
* @author Jose Manuel Caban
* @version Version 1.1, Sep. 28, 2002
*/
public class Aviary extends ZooBuilding{
/**
*whether or not the net is closed
*/
boolean netClosed;
////////////////
//Constructors//
////////////////
/**
*Constructor for Aviary
*@param name the name of the Aviary
*/
public Aviary(String name){
super(name);
}
///////////////////////
//Accessors/Modifiers//
///////////////////////
/**
*@return value of netClosed
*/
public boolean getNetClosed(){
return netClosed;
}
/**
*@param netClosed, the new value of netClosed
*/
public void setNetClosed(boolean netClosed){
this.netClosed = netClosed;
}
/////////////
//.Methods.//
/////////////
/**
*@return the value of netClosed
*/
public boolean isSafeToEnter(){
Animal aTemp;
FlyingType fTemp;
boolean bSafe = true;
for(int i=0; i
* @param args a String array of command line arguments.
*/
public static void main(String[] args) {
Aviary dancedance = new Aviary("Stinky");
dancedance.getTheAnimals().addToBack(new Duck("Bob"));
dancedance.getTheAnimals().addToFront(new Bat("Ronald"));
dancedance.getTheAnimals().addToFront(new Bat("McDonald"));
dancedance.getTheAnimals().listOut();
System.out.println();
dancedance.setNetClosed(true);
System.out.println(dancedance.getHungryAnimals());
System.out.println();
dancedance.getTheAnimals().listOut();
Animal temp = (Animal)dancedance.getTheAnimals().getFirst();
temp.setIsHungry(true);
System.out.println();
dancedance.getTheAnimals().listOut();
System.out.println();
dancedance.setNetClosed(true);
System.out.println(dancedance.getHungryAnimals());
System.out.println();
dancedance.getTheAnimals().listOut();
System.out.println();
dancedance.getTheAnimals().listOut();
System.out.println();
dancedance.setNetClosed(false);
dancedance.feedAnimals("insects");
dancedance.setNetClosed(true);
dancedance.feedAnimals("insects");
System.out.println();
dancedance.getTheAnimals().listOut();
System.out.println();
System.out.println(dancedance);
}// end of main(String[] args)
}// end of class Aviary