de.cesr.lara.components.container
Interface LaraCapacityManager<PropertyType extends LaraProperty<? extends PropertyType,?>>

Type Parameters:
PropertyType - The type of properties the according container stores

public interface LaraCapacityManager<PropertyType extends LaraProperty<? extends PropertyType,?>>

Interface for classes that implement a capacity management strategy for LaraStorages, i.e. to remove an item from the storage at some position or increase the storages capacity whenever the storage is full and a new item is to be stored.


Method Summary
 boolean freeSpace(LaraCapacityManagementView<PropertyType> view)
          Tries to apply this manager's capacity management strategy to the storage provided and seeks to free space for an additional property.
 

Method Detail

freeSpace

boolean freeSpace(LaraCapacityManagementView<PropertyType> view)
Tries to apply this manager's capacity management strategy to the storage provided and seeks to free space for an additional property. Storages using a capacity manager should always call this method before each item they try to add (i.e. they should make the following call manager.manage(this)) in case the storage is full. They should only try to add the new item if the capacity manager has returned true.

Parameters:
view - view to the container to free space withing
Returns:
true if management was successful, i.e. if at least one more (additional) new item can be added to the storage than before, false otherwise.