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.
| 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. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
height
public final int height
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.
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