|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.cesr.lara.components.container.storage.impl.LDefaultSimpleStorage<PropertyType>
PropertyType
- public class LDefaultSimpleStorage<PropertyType extends LaraProperty<PropertyType,?>>
A storage that does not care about time stamps since it only stores the most recent property for every key. This storage enables capacity management! NOTE: Other than LDefaultStorage this implementation does not throw LInvalidTimestampException()
Field Summary | |
---|---|
static int |
DEFAULT_INITIAL_CAPACITY
|
Fields inherited from interface de.cesr.lara.components.container.LaraContainer |
---|
UNLIMITED_CAPACITY |
Constructor Summary | |
---|---|
LDefaultSimpleStorage()
|
|
LDefaultSimpleStorage(int capacity)
|
Method Summary | ||
---|---|---|
void |
addStoragePropertyObserver(LaraStorageListener.StorageEvent eventType,
LaraStorageListener listener)
Adds a given LaraStorageListener for the specified
LaraStorageListener.StorageEvent |
|
void |
clear()
Clears the storage, i.e. removes all properties. |
|
boolean |
contains(Class<?> propertyType,
String key)
Checks whether the storage contains a property of the given type with the given key. |
|
boolean |
contains(PropertyType property)
Returns true , if, and only if, this storage contains the
given property. |
|
boolean |
contains(PropertyType property,
String key)
Checks whether the memory contains the given LaraProperty with
the given key. |
|
boolean |
contains(String key)
TODO test |
|
|
fetch(Class<RequestPropertyType> propertyType,
String key)
Generic method that returns the most recently stored property that is of the specified type and identified with key . |
|
PropertyType |
fetch(String key)
Generic method that returns the most recently stored property that is identified with key . |
|
|
fetchAll(Class<RequestPropertyType> propertyType)
Generic method that returns a collection of all properties found. |
|
Set<String> |
getAllPropertyKeys()
Returns a set of Strings that represent the keys of properties stored in the storage such that any property in the storage is represented. |
|
int |
getCapacity()
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. |
|
LaraCapacityManagementView<PropertyType> |
getCapacityManagementView()
|
|
LaraCapacityManager<PropertyType> |
getCapacityManager()
|
|
protected Collection<LaraStorageListener> |
getPropertyListeners(LaraStorageListener.StorageEvent event)
|
|
int |
getSize()
Returns the current size, i.e. the number of items currently stored. |
|
boolean |
isEmpty()
Returns true, if and only if this container is empty. |
|
boolean |
isFull()
Returns true, if and only if this container is full (see also LaraCapacityManager ). |
|
Iterator<PropertyType> |
iterator()
In no particular order. |
|
protected boolean |
propListenersContainsEventKey(LaraStorageListener.StorageEvent event)
|
|
PropertyType |
remove(PropertyType propertyToRemove)
Removes the specified property from this storage. |
|
PropertyType |
remove(String key)
Removes the specified property from this storage. |
|
Collection<PropertyType> |
removeAll(Collection<PropertyType> propertiesToBeRemoved)
Removes all properties in the specified collection from this storage. |
|
void |
removeStoragePropertyObserver(LaraStorageListener.StorageEvent eventType,
LaraStorageListener listener)
|
|
boolean |
setCapacity(int capacity)
|
|
void |
setCapacityManager(LaraCapacityManager<PropertyType> manager)
|
|
void |
store(PropertyType propertyToStore)
Tries to add the specified property to this storage. |
|
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int DEFAULT_INITIAL_CAPACITY
Constructor Detail |
---|
public LDefaultSimpleStorage()
public LDefaultSimpleStorage(int capacity)
capacity
- Method Detail |
---|
public void addStoragePropertyObserver(LaraStorageListener.StorageEvent eventType, LaraStorageListener listener)
LaraOverwriteStorage
LaraStorageListener
for the specified
LaraStorageListener.StorageEvent
addStoragePropertyObserver
in interface LaraOverwriteStorage<PropertyType extends LaraProperty<PropertyType,?>>
eventType
- the category of storage property events the listeners shall be
registered forlistener
- the listener to be registeredLaraStorage.addStoragePropertyListener(de.cesr.lara.components.container.storage.LaraStorageListener.StorageEvent,
de.cesr.lara.components.container.storage.LaraStorageListener)
public void clear()
LaraOverwriteStorage
clear
in interface LaraOverwriteStorage<PropertyType extends LaraProperty<PropertyType,?>>
public boolean contains(Class<?> propertyType, String key)
LaraOverwriteStorage
contains
in interface LaraOverwriteStorage<PropertyType extends LaraProperty<PropertyType,?>>
LaraOverwriteStorage.contains(java.lang.Class,
java.lang.String)
public boolean contains(PropertyType property)
LaraOverwriteStorage
true
, if, and only if, this storage contains the
given property.
contains
in interface LaraOverwriteStorage<PropertyType extends LaraProperty<PropertyType,?>>
true
, if, and only if, this storage contains the
given property.LaraOverwriteStorage.contains(de.cesr.lara.components.LaraProperty)
public boolean contains(PropertyType property, String key)
LaraOverwriteStorage
LaraProperty
with
the given key.
contains
in interface LaraOverwriteStorage<PropertyType extends LaraProperty<PropertyType,?>>
LaraOverwriteStorage.contains(de.cesr.lara.components.LaraProperty,
java.lang.String)
public boolean contains(String key)
contains
in interface LaraOverwriteStorage<PropertyType extends LaraProperty<PropertyType,?>>
true
, if, and only if, this storage contains a
property for the specified key
.LaraStorage.contains(java.lang.String)
public <RequestPropertyType extends PropertyType> RequestPropertyType fetch(Class<RequestPropertyType> propertyType, String key) throws LRetrieveException
LaraOverwriteStorage
key
.
fetch
in interface LaraOverwriteStorage<PropertyType extends LaraProperty<PropertyType,?>>
key
- identifier for the property to be retrieved.
key
.
LRetrieveException
LaraOverwriteStorage.fetch(java.lang.Class,
java.lang.String)
public PropertyType fetch(String key)
LaraOverwriteStorage
key
.
fetch
in interface LaraOverwriteStorage<PropertyType extends LaraProperty<PropertyType,?>>
key
- identifier for the property to be retrieved.
key
.public <RequestPropertyType extends PropertyType> Collection<RequestPropertyType> fetchAll(Class<RequestPropertyType> propertyType) throws LRetrieveException
LaraOverwriteStorage
fetchAll
in interface LaraOverwriteStorage<PropertyType extends LaraProperty<PropertyType,?>>
propertyType
- identifier for the properties to be retrieved.
step
and identified with key
.
LRetrieveException
LaraOverwriteStorage.fetchAll(java.lang.Class)
public Set<String> getAllPropertyKeys()
LaraOverwriteStorage
getAllPropertyKeys
in interface LaraOverwriteStorage<PropertyType extends LaraProperty<PropertyType,?>>
LaraStorage.getAllPropertyKeys()
public int getCapacity()
LaraContainer
LaraContainer.UNLIMITED_CAPACITY
(the default) if it is
(virtually) unlimited.
getCapacity
in interface LaraContainer<PropertyType extends LaraProperty<PropertyType,?>>
public LaraCapacityManagementView<PropertyType> getCapacityManagementView()
getCapacityManagementView
in interface LaraCapacityManageableContainer<PropertyType extends LaraProperty<PropertyType,?>>
public LaraCapacityManager<PropertyType> getCapacityManager()
getCapacityManager
in interface LaraCapacityManageableContainer<PropertyType extends LaraProperty<PropertyType,?>>
public int getSize()
LaraContainer
getSize
in interface LaraContainer<PropertyType extends LaraProperty<PropertyType,?>>
public boolean isEmpty()
LaraContainer
isEmpty
in interface LaraContainer<PropertyType extends LaraProperty<PropertyType,?>>
public boolean isFull()
LaraContainer
LaraCapacityManager
).
isFull
in interface LaraContainer<PropertyType extends LaraProperty<PropertyType,?>>
public Iterator<PropertyType> iterator()
iterator
in interface Iterable<PropertyType extends LaraProperty<PropertyType,?>>
Iterable.iterator()
public PropertyType remove(PropertyType propertyToRemove)
LaraOverwriteStorage
remove
in interface LaraOverwriteStorage<PropertyType extends LaraProperty<PropertyType,?>>
propertyToRemove
- the property to be removed.
public PropertyType remove(String key)
LaraOverwriteStorage
remove
in interface LaraOverwriteStorage<PropertyType extends LaraProperty<PropertyType,?>>
key
- Key of property that shall be removed the property to be
removed. Created by Michael Elbers on 22.02.2010
public Collection<PropertyType> removeAll(Collection<PropertyType> propertiesToBeRemoved)
LaraOverwriteStorage
removeAll
in interface LaraOverwriteStorage<PropertyType extends LaraProperty<PropertyType,?>>
propertiesToBeRemoved
- the properties to be removed
public void removeStoragePropertyObserver(LaraStorageListener.StorageEvent eventType, LaraStorageListener listener)
removeStoragePropertyObserver
in interface LaraOverwriteStorage<PropertyType extends LaraProperty<PropertyType,?>>
eventType
- the category of storage property events the listeners shall be
removed fromlistener
- the listener to be removedLaraStorage.removeStoragePropertyListener(de.cesr.lara.components.container.storage.LaraStorageListener.StorageEvent,
de.cesr.lara.components.container.storage.LaraStorageListener)
public boolean setCapacity(int capacity)
setCapacity
in interface LaraCapacityManageableContainer<PropertyType extends LaraProperty<PropertyType,?>>
public void setCapacityManager(LaraCapacityManager<PropertyType> manager)
setCapacityManager
in interface LaraCapacityManageableContainer<PropertyType extends LaraProperty<PropertyType,?>>
public void store(PropertyType propertyToStore)
LaraOverwriteStorage
store
in interface LaraOverwriteStorage<PropertyType extends LaraProperty<PropertyType,?>>
propertyToStore
- the property to be stored.public String toString()
toString
in class Object
protected Collection<LaraStorageListener> getPropertyListeners(LaraStorageListener.StorageEvent event)
event
-
protected boolean propListenersContainsEventKey(LaraStorageListener.StorageEvent event)
event
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |