Interface VehicleFleetManager
public interface VehicleFleetManager
-
Method Summary
Modifier and TypeMethodDescriptiongetAvailableVehicle(VehicleTypeKey vehicleTypeIdentifier) Returns a collection of available vehicles.getAvailableVehicles(Vehicle withoutThisType) booleanReturns true if locked.voidLocks vehicle.voidUnlocks vehicle.voidUnlocks all locked vehicles.
-
Method Details
-
lock
Locks vehicle.This indicates that this vehicle is being used. Thus it is not in list of available vehicles.
- Parameters:
vehicle- to lock
-
unlock
Unlocks vehicle.This indicates that this vehicle is not being used anymore. Thus it is in list of available vehicles.
- Parameters:
vehicle- to unlock
-
isLocked
Returns true if locked.- Parameters:
vehicle- vehicle to lock- Returns:
- true if locked
-
unlockAll
void unlockAll()Unlocks all locked vehicles. -
getAvailableVehicles
Collection<Vehicle> getAvailableVehicles()Returns a collection of available vehicles.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
VehicleTypeKeyto figure out whether two vehicles are equal or not.- Returns:
- collection of available vehicles
-
getAvailableVehicles
-
getAvailableVehicle
-