ro.polak.multilevelcarpark.generic
Class ParkingRing

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

public class ParkingRing
extends java.lang.Object

Representation of parking ring

Author:
Piotr Polak

Field Summary
 ParkingPlace[] parkingPlaces
          A vector of parking places
 
Constructor Summary
ParkingRing()
          The default constructor
ParkingRing(int capacity)
          Creates parking ring of the given capacity
 
Method Summary
 int getFreeParkingPlace()
          Returns the index of the first found parking place
 void makeGate()
          This makes the ring "having" the gate as the first place
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

parkingPlaces

public ParkingPlace[] parkingPlaces
A vector of parking places

Constructor Detail

ParkingRing

public ParkingRing(int capacity)
Creates parking ring of the given capacity

Parameters:
capacity - capacity of the parking ring

ParkingRing

public ParkingRing()
The default constructor

Method Detail

getFreeParkingPlace

public int getFreeParkingPlace()
Returns the index of the first found parking place

Returns:
-1 if place not found

makeGate

public void makeGate()
This makes the ring "having" the gate as the first place