de.cesr.lara.components.container.memory.impl
Class LDefaultLimitedCapacityMemory<PropertyType extends LaraProperty<? extends PropertyType,?>>
java.lang.Object
de.cesr.lara.components.container.memory.impl.LDefaultMemory<PropertyType>
de.cesr.lara.components.container.memory.impl.LDefaultLimitedCapacityMemory<PropertyType>
- Type Parameters:
PropertyType
-
- All Implemented Interfaces:
- LaraCapacityManageableContainer<PropertyType>, LaraContainer<PropertyType>, LaraMemory<PropertyType>, LaraStorageListener, Iterable<PropertyType>
- Direct Known Subclasses:
- LDefaultLimitedCapacityBOMemory
public class LDefaultLimitedCapacityMemory<PropertyType extends LaraProperty<? extends PropertyType,?>>
- extends LDefaultMemory<PropertyType>
- implements LaraCapacityManageableContainer<PropertyType>
Methods inherited from class de.cesr.lara.components.container.memory.impl.LDefaultMemory |
addMemoryPropertyObserver, clear, contains, contains, contains, contains, contains, createBackingStorage, forget, forget, forgetAll, forgetAll, getAllPropertyKeys, getDefaultRetentionTime, getName, getRetentionTime, getSize, isEmpty, iterator, recall, recall, recall, recall, recallAll, recallAll, recallAll, refresh, refresh, refresh, refresh, refresh, removeMemoryPropertyObserver, setDefaultRetentionTime, storageEventOccured, toString |
DEFAULT_INITIAL_CAPACITY
public static final int DEFAULT_INITIAL_CAPACITY
- The memory's initial capacity in amount of entries
- See Also:
- Constant Field Values
LDefaultLimitedCapacityMemory
public LDefaultLimitedCapacityMemory(LaraCapacityManager<PropertyType> capacityManager)
- Parameters:
capacityManager
-
LDefaultLimitedCapacityMemory
public LDefaultLimitedCapacityMemory(LaraCapacityManager<PropertyType> capacityManager,
int initialCapacity)
- Parameters:
capacityManager
- initialCapacity
-
LDefaultLimitedCapacityMemory
public LDefaultLimitedCapacityMemory(LaraCapacityManager<PropertyType> capacityManager,
int initialCapacity,
String name)
- Parameters:
capacityManager
- initialCapacity
- name
- the memory's name
LDefaultLimitedCapacityMemory
public LDefaultLimitedCapacityMemory(LaraCapacityManager<PropertyType> capacityManager,
String name)
- Parameters:
capacityManager
- name
- the memory's name
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<? extends PropertyType,?>>
- Overrides:
getCapacity
in class LDefaultMemory<PropertyType extends LaraProperty<? extends PropertyType,?>>
- Returns:
- the capacity of this storage.
- See Also:
LDefaultMemory.getCapacity()
getCapacityManagementView
public LaraCapacityManagementView<PropertyType> getCapacityManagementView()
- Specified by:
getCapacityManagementView
in interface LaraCapacityManageableContainer<PropertyType extends LaraProperty<? extends PropertyType,?>>
- Returns:
- See Also:
LaraCapacityManageableContainer.getCapacityManagementView()
getCapacityManager
public LaraCapacityManager<PropertyType> getCapacityManager()
- Specified by:
getCapacityManager
in interface LaraCapacityManageableContainer<PropertyType extends LaraProperty<? extends 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<? extends PropertyType,?>>
- Overrides:
isFull
in class LDefaultMemory<PropertyType extends LaraProperty<? extends PropertyType,?>>
- Returns:
- true, if and only if this container is full.
- See Also:
LDefaultMemory.isFull()
memorize
public void memorize(PropertyType propertyToMemorize)
- Description copied from interface:
LaraMemory
- Tries to add the specified property to this memory applying the default
retention time. In case the memory already contains a property of the
same key for the same time-stamp the "old" property is overwritten.
- Specified by:
memorize
in interface LaraMemory<PropertyType extends LaraProperty<? extends PropertyType,?>>
- Overrides:
memorize
in class LDefaultMemory<PropertyType extends LaraProperty<? extends PropertyType,?>>
- Parameters:
propertyToMemorize
- the property to be memorised.- See Also:
LDefaultMemory.memorize(de.cesr.lara.components.LaraProperty)
memorize
public void memorize(PropertyType propertyToMemorize,
int retentionTime)
- Description copied from interface:
LaraMemory
- Tries to add the specified property to this memory with the given
retention time. In case the memory already contains a property of the
same key for the same time-stamp the "old" property is overwritten.
- Specified by:
memorize
in interface LaraMemory<PropertyType extends LaraProperty<? extends PropertyType,?>>
- Overrides:
memorize
in class LDefaultMemory<PropertyType extends LaraProperty<? extends PropertyType,?>>
- Parameters:
propertyToMemorize
- the property to be memorised.- See Also:
LDefaultMemory.memorize(de.cesr.lara.components.LaraProperty,
int)
setCapacity
public boolean setCapacity(int capacity)
- Specified by:
setCapacity
in interface LaraCapacityManageableContainer<PropertyType extends LaraProperty<? extends PropertyType,?>>
- Returns:
- See Also:
LaraCapacityManageableContainer.setCapacity(int)
setCapacityManager
public void setCapacityManager(LaraCapacityManager<PropertyType> manager)
- Specified by:
setCapacityManager
in interface LaraCapacityManageableContainer<PropertyType extends LaraProperty<? extends PropertyType,?>>
- See Also:
LaraCapacityManageableContainer.setCapacityManager(de.cesr.lara.components.container.LaraCapacityManager)