de.cesr.lara.components.container.storage.impl
Class LDefaultLimitedCapacityStorage<PropertyType extends LaraProperty<PropertyType,?>>
java.lang.Object
de.cesr.lara.components.container.storage.impl.LDefaultStorage<PropertyType>
de.cesr.lara.components.container.storage.impl.LDefaultLimitedCapacityStorage<PropertyType>
- Type Parameters:
PropertyType
-
- All Implemented Interfaces:
- LaraCapacityManageableContainer<PropertyType>, LaraContainer<PropertyType>, LaraStorage<PropertyType>, Iterable<PropertyType>
public class LDefaultLimitedCapacityStorage<PropertyType extends LaraProperty<PropertyType,?>>
- extends LDefaultStorage<PropertyType>
- implements LaraCapacityManageableContainer<PropertyType>
TODO implement observer management for other events than AUTO_REMOVED!
Methods inherited from class de.cesr.lara.components.container.storage.impl.LDefaultStorage |
addStoragePropertyListener, clear, contains, contains, contains, contains, contains, fetch, fetch, fetch, fetch, fetchAll, fetchAll, fetchAll, fetchAll, getAllPropertyKeys, getPropertyListeners, getSize, isEmpty, iterator, propListenersContainsEventKey, remove, remove, removeAll, removeAll, removeStoragePropertyListener, toString |
DEFAULT_INITIAL_CAPACITY
public static final int DEFAULT_INITIAL_CAPACITY
- The storage's initial capacity in amount of entries
- See Also:
- Constant Field Values
LDefaultLimitedCapacityStorage
public LDefaultLimitedCapacityStorage(LaraCapacityManager<PropertyType> capacityManager)
- Parameters:
capacityManager
-
LDefaultLimitedCapacityStorage
public LDefaultLimitedCapacityStorage(LaraCapacityManager<PropertyType> capacityManager,
int initialCapacity)
- Parameters:
capacityManager
- initialCapacity
-
getCapacity
public int getCapacity()
- Description copied from interface:
LaraContainer
- Returns the capacity of this container, i.e. the number of items that can
be stored or
LaraContainer.UNLIMITED_CAPACITY
(the default) if it is
(virtually) unlimited.
- Specified by:
getCapacity
in interface LaraContainer<PropertyType extends LaraProperty<PropertyType,?>>
- Overrides:
getCapacity
in class LDefaultStorage<PropertyType extends LaraProperty<PropertyType,?>>
- Returns:
- the capacity of this storage.
- See Also:
LDefaultStorage.getCapacity()
getCapacityManagementView
public LaraCapacityManagementView<PropertyType> getCapacityManagementView()
- Specified by:
getCapacityManagementView
in interface LaraCapacityManageableContainer<PropertyType extends LaraProperty<PropertyType,?>>
- Returns:
- See Also:
LaraCapacityManageableContainer.getCapacityManagementView()
getCapacityManager
public LaraCapacityManager<PropertyType> getCapacityManager()
- Specified by:
getCapacityManager
in interface LaraCapacityManageableContainer<PropertyType extends LaraProperty<PropertyType,?>>
- Returns:
- See Also:
LaraCapacityManageableContainer.getCapacityManager()
isFull
public boolean isFull()
- Description copied from interface:
LaraContainer
- Returns true, if and only if this container is full (see also
LaraCapacityManager
).
- Specified by:
isFull
in interface LaraContainer<PropertyType extends LaraProperty<PropertyType,?>>
- Overrides:
isFull
in class LDefaultStorage<PropertyType extends LaraProperty<PropertyType,?>>
- Returns:
- true, if and only if this container is full.
- See Also:
LDefaultStorage.isFull()
setCapacity
public boolean setCapacity(int capacity)
- Specified by:
setCapacity
in interface LaraCapacityManageableContainer<PropertyType extends LaraProperty<PropertyType,?>>
- Returns:
- See Also:
LaraCapacityManageableContainer.setCapacity(int)
setCapacityManager
public void setCapacityManager(LaraCapacityManager<PropertyType> manager)
- Specified by:
setCapacityManager
in interface LaraCapacityManageableContainer<PropertyType extends LaraProperty<PropertyType,?>>
- See Also:
LaraCapacityManageableContainer.setCapacityManager(de.cesr.lara.components.container.LaraCapacityManager)
store
public void store(PropertyType propertyToStore)
- Description copied from interface:
LaraStorage
- Tries to add the specified property to this storage. In case the storage
already contains a property of the same key for the same time-stamp the
"old" property is overwritten.
- Specified by:
store
in interface LaraStorage<PropertyType extends LaraProperty<PropertyType,?>>
- Overrides:
store
in class LDefaultStorage<PropertyType extends LaraProperty<PropertyType,?>>
- Parameters:
propertyToStore
- the property to be stored.- See Also:
LDefaultStorage.store(de.cesr.lara.components.LaraProperty)