|
|||||||||
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.LDefaultStorage<PropertyType>
PropertyType
- public class LDefaultStorage<PropertyType extends LaraProperty<? extends PropertyType,?>>
TODO implement observer management for other events than AUTO_REMOVED! (SH) Updates a key-wise (Key -> Step -> Property) and a step-wise (Step -> Key -> Property) map.
Field Summary |
---|
Fields inherited from interface de.cesr.lara.components.container.LaraContainer |
---|
UNLIMITED_CAPACITY |
Constructor Summary | |
---|---|
LDefaultStorage()
|
Method Summary | ||
---|---|---|
void |
addStoragePropertyListener(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)
NOTE: This method is highly inefficient in this implementation! |
|
boolean |
contains(PropertyType property,
String key)
Checks whether the memory contains the given LaraProperty with
the given key. |
|
boolean |
contains(String key)
Returns true , if, and only if, this storage contains a
property for the specified key . |
|
boolean |
contains(String key,
int step)
Returns true , if, and only if, this storage contains a
property for the specified key and step . |
|
|
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 . |
|
|
fetch(Class<RequestPropertyType> propertyType,
String key,
int step)
Generic method that returns the first property that is of the specified type, was stored in step and identified with key . |
|
PropertyType |
fetch(String key)
Generic method that returns the most recently stored property that is identified with key . |
|
PropertyType |
fetch(String key,
int step)
Generic method that returns the first property that was stored in step and identified with key . |
|
Collection<PropertyType> |
fetchAll()
Generic method that returns a collection of all properties found. |
|
|
fetchAll(Class<RequestPropertyType> propertyType)
Generic method that returns a collection of all properties found. |
|
|
fetchAll(Class<RequestPropertyType> propertyType,
String key)
Generic method that returns a collection of all properties found that are of the specified type and are identified by key . |
|
Collection<PropertyType> |
fetchAll(String key)
Generic method that returns a collection of all properties found that are identified by key . |
|
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. |
|
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()
Provides an iterator over all properties 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,
int step)
Removes the property with the specified key that was stored in step from this storage. |
|
Collection<PropertyType> |
removeAll(Collection<PropertyType> propertiesToBeRemoved)
Removes all properties in the specified collection from this storage. |
|
Collection<PropertyType> |
removeAll(String key)
Removes all properties that are identified by the specified key. |
|
void |
removeStoragePropertyListener(LaraStorageListener.StorageEvent eventType,
LaraStorageListener listener)
|
|
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 |
Constructor Detail |
---|
public LDefaultStorage()
Method Detail |
---|
public void addStoragePropertyListener(LaraStorageListener.StorageEvent eventType, LaraStorageListener listener)
LaraStorage
LaraStorageListener
for the specified
LaraStorageListener.StorageEvent
addStoragePropertyListener
in interface LaraStorage<PropertyType extends LaraProperty<? extends 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()
LaraStorage
clear
in interface LaraStorage<PropertyType extends LaraProperty<? extends PropertyType,?>>
LaraStorage.clear()
public boolean contains(Class<?> propertyType, String key)
LaraStorage
contains
in interface LaraStorage<PropertyType extends LaraProperty<? extends PropertyType,?>>
LaraStorage.contains(de.cesr.lara.components.LaraProperty,
java.lang.String)
public boolean contains(PropertyType property)
contains
in interface LaraStorage<PropertyType extends LaraProperty<? extends PropertyType,?>>
true
, if, and only if, this storage contains the
given property.LaraStorage.contains(de.cesr.lara.components.LaraProperty)
public boolean contains(PropertyType property, String key)
LaraStorage
LaraProperty
with
the given key.
contains
in interface LaraStorage<PropertyType extends LaraProperty<? extends PropertyType,?>>
LaraStorage.contains(de.cesr.lara.components.LaraProperty,
java.lang.String)
public boolean contains(String key)
LaraStorage
true
, if, and only if, this storage contains a
property for the specified key
.
contains
in interface LaraStorage<PropertyType extends LaraProperty<? extends PropertyType,?>>
true
, if, and only if, this storage contains a
property for the specified key
.LaraStorage.contains(java.lang.String)
public boolean contains(String key, int step)
LaraStorage
true
, if, and only if, this storage contains a
property for the specified key
and step
.
contains
in interface LaraStorage<PropertyType extends LaraProperty<? extends PropertyType,?>>
true
, if, and only if, this storage contains a
property for the specified key
and step
.LaraStorage.contains(java.lang.String,
int)
public <RequestPropertyType extends PropertyType> RequestPropertyType fetch(Class<RequestPropertyType> propertyType, String key) throws LRetrieveException
LaraStorage
key
.
fetch
in interface LaraStorage<PropertyType extends LaraProperty<? extends PropertyType,?>>
key
- identifier for the property to be retrieved.
key
.
LRetrieveException
LaraStorage.fetch(java.lang.Class,
java.lang.String)
public <RequestPropertyType extends PropertyType> RequestPropertyType fetch(Class<RequestPropertyType> propertyType, String key, int step) throws LRetrieveException
LaraStorage
step
and identified with key
.
fetch
in interface LaraStorage<PropertyType extends LaraProperty<? extends PropertyType,?>>
key
- identifier for the property to be retrieved.step
- step in which the property was stored.
step
and identified with key
.
LRetrieveException
LaraStorage.fetch(java.lang.Class,
java.lang.String, int)
public PropertyType fetch(String key)
LaraStorage
key
.
fetch
in interface LaraStorage<PropertyType extends LaraProperty<? extends PropertyType,?>>
key
- identifier for the property to be retrieved.
key
.LaraStorage.fetch(java.lang.String)
public PropertyType fetch(String key, int step)
LaraStorage
step
and identified with key
.
fetch
in interface LaraStorage<PropertyType extends LaraProperty<? extends PropertyType,?>>
key
- identifier for the property to be retrieved.step
- step in which the property was stored.
step
and identified
with key
.LaraStorage.fetch(java.lang.String,
int)
public Collection<PropertyType> fetchAll() throws LRetrieveException
LaraStorage
fetchAll
in interface LaraStorage<PropertyType extends LaraProperty<? extends PropertyType,?>>
LRetrieveException
LaraStorage.fetchAll()
public <RequestPropertyType extends PropertyType> Collection<RequestPropertyType> fetchAll(Class<RequestPropertyType> propertyType) throws LRetrieveException
LaraStorage
fetchAll
in interface LaraStorage<PropertyType extends LaraProperty<? extends PropertyType,?>>
propertyType
- identifier for the properties to be retrieved.
step
and identified with key
.
LRetrieveException
LaraStorage.fetchAll(java.lang.Class)
public <RequestPropertyType extends PropertyType> Collection<RequestPropertyType> fetchAll(Class<RequestPropertyType> propertyType, String key) throws LRetrieveException
LaraStorage
key
.
fetchAll
in interface LaraStorage<PropertyType extends LaraProperty<? extends PropertyType,?>>
key
- identifier for the properties to be retrieved.
step
and identified with key
.
LRetrieveException
LaraStorage.fetchAll(java.lang.Class,
java.lang.String)
public Collection<PropertyType> fetchAll(String key)
LaraStorage
key
.
fetchAll
in interface LaraStorage<PropertyType extends LaraProperty<? extends PropertyType,?>>
key
- identifier for the properties to be retrieved.
key
.LaraStorage.fetchAll(java.lang.String)
public Set<String> getAllPropertyKeys()
LaraStorage
getAllPropertyKeys
in interface LaraStorage<PropertyType extends LaraProperty<? extends PropertyType,?>>
LaraStorage.getAllPropertyKeys()
public int getCapacity()
LaraContainer
LaraContainer.UNLIMITED_CAPACITY
(the default) if it is
(virtually) unlimited.
getCapacity
in interface LaraContainer<PropertyType extends LaraProperty<? extends PropertyType,?>>
LaraContainer.getCapacity()
public int getSize()
LaraContainer
getSize
in interface LaraContainer<PropertyType extends LaraProperty<? extends PropertyType,?>>
LaraContainer.getSize()
public boolean isEmpty()
LaraContainer
isEmpty
in interface LaraContainer<PropertyType extends LaraProperty<? extends PropertyType,?>>
LaraContainer.isEmpty()
public boolean isFull()
LaraContainer
LaraCapacityManager
).
isFull
in interface LaraContainer<PropertyType extends LaraProperty<? extends PropertyType,?>>
LaraContainer.isFull()
public Iterator<PropertyType> iterator()
iterator
in interface Iterable<PropertyType extends LaraProperty<? extends PropertyType,?>>
Iterable.iterator()
public PropertyType remove(PropertyType propertyToRemove)
LaraStorage
remove
in interface LaraStorage<PropertyType extends LaraProperty<? extends PropertyType,?>>
propertyToRemove
- the property to be removed.
LaraStorage.remove(de.cesr.lara.components.LaraProperty)
public PropertyType remove(String key, int step)
LaraStorage
step
from this storage.
remove
in interface LaraStorage<PropertyType extends LaraProperty<? extends PropertyType,?>>
key
- identifier for the property to be removed.step
- the step in which the property to be removed was stored.
LaraStorage.remove(java.lang.String,
int)
public Collection<PropertyType> removeAll(Collection<PropertyType> propertiesToBeRemoved)
LaraStorage
removeAll
in interface LaraStorage<PropertyType extends LaraProperty<? extends PropertyType,?>>
propertiesToBeRemoved
- the properties to be removed
LaraStorage.removeAll(java.util.Collection)
public Collection<PropertyType> removeAll(String key)
LaraStorage
removeAll
in interface LaraStorage<PropertyType extends LaraProperty<? extends PropertyType,?>>
key
- key identifier for the properties to be removed.
LaraStorage.removeAll(java.lang.String)
public void removeStoragePropertyListener(LaraStorageListener.StorageEvent eventType, LaraStorageListener listener)
removeStoragePropertyListener
in interface LaraStorage<PropertyType extends LaraProperty<? extends 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 void store(PropertyType propertyToStore)
LaraStorage
store
in interface LaraStorage<PropertyType extends LaraProperty<? extends PropertyType,?>>
propertyToStore
- the property to be stored.LaraStorage.store(de.cesr.lara.components.LaraProperty)
public String toString()
toString
in class Object
Object.toString()
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 |