org.intranet.elevator.model.operate.controller
Class MetaController

java.lang.Object
  extended byorg.intranet.elevator.model.operate.controller.MetaController
All Implemented Interfaces:
Controller

public class MetaController
extends java.lang.Object
implements Controller


Field Summary
private  java.util.List carControllers
           
 
Constructor Summary
MetaController()
           
 
Method Summary
 void addCar(Car car, float stoppingDistance)
           
 boolean arrive(Car car)
          To be called only once when a car arrives at a location.
private  CarController findBestCar(Floor floor, Direction direction)
           
private  CarController getController(Car car)
           
 void initialize(EventQueue eQ)
           
 void requestCar(Floor newFloor, Direction d)
           
 void setNextDestination(Car car)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

carControllers

private java.util.List carControllers
Constructor Detail

MetaController

public MetaController()
Method Detail

initialize

public void initialize(EventQueue eQ)
Specified by:
initialize in interface Controller

addCar

public void addCar(Car car,
                   float stoppingDistance)
Specified by:
addCar in interface Controller

requestCar

public void requestCar(Floor newFloor,
                       Direction d)
Specified by:
requestCar in interface Controller

findBestCar

private CarController findBestCar(Floor floor,
                                  Direction direction)

toString

public java.lang.String toString()

arrive

public boolean arrive(Car car)
Description copied from interface: Controller
To be called only once when a car arrives at a location. This allows the controller to update any internal data structures that were keeping track of where the car was going to.

Specified by:
arrive in interface Controller
Parameters:
car - The car that is arriving.
Returns:
Whether the car is going up after this arrival. Can be used to set the direction light on the entrance.

setNextDestination

public void setNextDestination(Car car)
Specified by:
setNextDestination in interface Controller

getController

private CarController getController(Car car)