ro.polak.multilevelcarpark.generic
Class ParkingPlace

java.lang.Object
  extended by ro.polak.multilevelcarpark.generic.ParkingPlace

public class ParkingPlace
extends java.lang.Object

Representation of parking place. Each parking ring consists of a certain number of parking places

Author:
Piotr Polak

Constructor Summary
ParkingPlace()
           
 
Method Summary
 void free()
          Frees the resources
 Car getCar()
          Returns the current car
 boolean insertCar(Car car)
          Places the car.
 boolean isFree()
          Tells thenever the place is free
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ParkingPlace

public ParkingPlace()
Method Detail

insertCar

public boolean insertCar(Car car)
                  throws IllegalOperationException
Places the car.

Parameters:
car - a car to be placed
Returns:
false on illegal operation
Throws:
IllegalOperationException

getCar

public Car getCar()
Returns the current car

Returns:
current car

free

public void free()
Frees the resources


isFree

public boolean isFree()
Tells thenever the place is free

Returns:
true when place is free