ro.polak.multilevelcarpark.controllers
Class CarContainerController

java.lang.Object
  extended by ro.polak.multilevelcarpark.controllers.BusyElement
      extended by ro.polak.multilevelcarpark.controllers.CarContainerController

public class CarContainerController
extends BusyElement

CarCointainer is the element placed at the end of CointarnerArm providing a mechanism to load/unload a car into it

Author:
Piotr Polak

Constructor Summary
CarContainerController(ArmController parent)
          The default constructor
 
Method Summary
 Car dropCar()
          Drops the car
 void free()
          Frees the resources
 boolean hasCar()
          Tells whenever the container contains a car
 void lock()
          Locks the container
 void putCar(Car car)
          Puts the car in the container
 void unlock()
          Unlocks the container
 
Methods inherited from class ro.polak.multilevelcarpark.controllers.BusyElement
isBusy, makeBusy, makeFree
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CarContainerController

public CarContainerController(ArmController parent)
The default constructor

Parameters:
parent -
Method Detail

lock

public void lock()
          throws IllegalOperationException
Locks the container

Throws:
IllegalOperationException

unlock

public void unlock()
            throws IllegalOperationException
Unlocks the container

Throws:
IllegalOperationException

hasCar

public boolean hasCar()
Tells whenever the container contains a car


putCar

public void putCar(Car car)
            throws IllegalOperationException
Puts the car in the container

Parameters:
car -
Throws:
IllegalOperationException

dropCar

public Car dropCar()
            throws IllegalOperationException
Drops the car

Returns:
car
Throws:
IllegalOperationException

free

public void free()
Frees the resources