public interface VehicleFleetManager
| Modifier and Type | Method and Description |
|---|---|
Vehicle |
getAvailableVehicle(VehicleTypeKey vehicleTypeIdentifier) |
Collection<Vehicle> |
getAvailableVehicles()
Returns a collection of available vehicles.
|
Collection<Vehicle> |
getAvailableVehicles(Vehicle withoutThisType) |
boolean |
isLocked(Vehicle vehicle)
Returns true if locked.
|
void |
lock(Vehicle vehicle)
Locks vehicle.
|
void |
unlock(Vehicle vehicle)
Unlocks vehicle.
|
void |
unlockAll()
Unlocks all locked vehicles.
|
void lock(Vehicle vehicle)
This indicates that this vehicle is being used. Thus it is not in list of available vehicles.
vehicle - void unlock(Vehicle vehicle)
This indicates that this vehicle is not being used anymore. Thus it is in list of available vehicles.
vehicle - boolean isLocked(Vehicle vehicle)
vehicle - void unlockAll()
Collection<Vehicle> getAvailableVehicles()
Note that this does not return ALL available vehicles that were added to the fleetmanager. Vehicles are clustered according
to VehicleTypeKey. If there are two unlocked vehicle with the same VehicleTypeKey then only one of them will be returned.
This is to avoid returning too many vehicles that are basically equal.
Look at VehicleTypeKey to figure out whether two vehicles are equal or not.
Collection<Vehicle> getAvailableVehicles(Vehicle withoutThisType)
Vehicle getAvailableVehicle(VehicleTypeKey vehicleTypeIdentifier)
Copyright © 2013–2016. All rights reserved.