Interface VehicleFleetManager


public interface VehicleFleetManager
  • Method Details

    • lock

      void lock(Vehicle vehicle)
      Locks vehicle.

      This indicates that this vehicle is being used. Thus it is not in list of available vehicles.

      Parameters:
      vehicle - to lock
    • unlock

      void unlock(Vehicle vehicle)
      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

      boolean isLocked(Vehicle vehicle)
      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 VehicleTypeKey to figure out whether two vehicles are equal or not.

      Returns:
      collection of available vehicles
    • getAvailableVehicles

      Collection<Vehicle> getAvailableVehicles(Vehicle withoutThisType)
    • getAvailableVehicle

      Vehicle getAvailableVehicle(VehicleTypeKey vehicleTypeIdentifier)