edu.lmu.liftor
Class Building

java.lang.Object
  |
  +--edu.lmu.liftor.Place.PlaceImpl
        |
        +--edu.lmu.liftor.Building
All Implemented Interfaces:
Place

public class Building
extends Place.PlaceImpl

A collection of floors, elevators and visitors.


Nested Class Summary
 
Nested classes inherited from class edu.lmu.liftor.Place
Place.PlaceFullException, Place.PlaceImpl
 
Field Summary
 int height
           
 
Fields inherited from interface edu.lmu.liftor.Place
LIMBO
 
Constructor Summary
Building(java.lang.String name, int floors, int elevators)
          Construct a new building with the given name, number of floors and number of elevators.
 
Method Summary
 void enter(Visitor e)
          Add the visitor to this place.
 Floor getFloor(int number)
           
 Floor getTopFloor()
           
 void render()
          This renders the building as ASCII art.
 void seed(Visitor e)
           
 java.lang.String toString()
           
 
Methods inherited from class edu.lmu.liftor.Place.PlaceImpl
exit, getPlaceCapacity, getPlaceName, getVisitorCount, isFull
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

height

public final int height
Constructor Detail

Building

public Building(java.lang.String name,
                int floors,
                int elevators)
Construct a new building with the given name, number of floors and number of elevators.

Method Detail

getTopFloor

public Floor getTopFloor()

enter

public void enter(Visitor e)
Description copied from interface: Place
Add the visitor to this place. Upon success, it will notify new visitors that they are here.

Specified by:
enter in interface Place
Overrides:
enter in class Place.PlaceImpl

seed

public void seed(Visitor e)

getFloor

public Floor getFloor(int number)

render

public void render()
This renders the building as ASCII art. It is limited to a 1000 story building before it will misalign. Also, buildings with more than 6 elevators won't print in 80 characters.


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object