|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
PropertyType
- the type of properties the memory may memorisepublic interface LaraMemory<PropertyType extends LaraProperty<? extends PropertyType,?>>
Interface for all agent memories in LARA
Field Summary | |
---|---|
static int |
UNLIMITED_RETENTION
constant representing unlimited retention time |
Fields inherited from interface de.cesr.lara.components.container.LaraContainer |
---|
UNLIMITED_CAPACITY |
Method Summary | ||
---|---|---|
void |
addMemoryPropertyObserver(LaraMemoryListener.MemoryEvent eventType,
LaraMemoryListener listener)
Adds a given LaraMemoryListener for the specified
LaraMemoryListener.MemoryEvent |
|
void |
clear()
Clears the memory, i.e. removes all properties. |
|
boolean |
contains(Class<?> propertyType,
String key)
Checks whether the memory contains a property of the given type with the given key. |
|
boolean |
contains(PropertyType property)
Checks whether the memory contains the given LaraProperty . |
|
boolean |
contains(PropertyType property,
String key)
Checks whether the memory contains the given LaraProperty with
the given key. |
|
boolean |
contains(String key)
Checks whether the memory contains a LaraProperty with the given
key. |
|
boolean |
contains(String key,
int timestamp)
Checks whether the memory contains a LaraProperty with the given
key for the given time stamp. |
|
PropertyType |
forget(PropertyType propertyToRemove)
Removes the specified property from this memory. |
|
PropertyType |
forget(String key,
int step)
Removes the property with the specified key that was memorised in step from this memory. |
|
Collection<PropertyType> |
forgetAll(Collection<PropertyType> propertiesToBeRemoved)
Removes all properties in the specified collection from this memory. |
|
Collection<PropertyType> |
forgetAll(String key)
Removes all properties that are identified by the specified key. |
|
Set<String> |
getAllPropertyKeys()
Returns a set of Strings that represent the keys of properties memorised in the memory such that any property in the memory is represented. |
|
int |
getDefaultRetentionTime()
Return the default retention time |
|
String |
getName()
Returns the name of this memory |
|
int |
getRetentionTime(PropertyType property)
Returns the remaining retention time for the given property. |
|
void |
memorize(PropertyType propertyToMemorize)
Tries to add the specified property to this memory applying the default retention time. |
|
void |
memorize(PropertyType propertyToMemorize,
int retentionTime)
Tries to add the specified property to this memory with the given retention time. |
|
|
recall(Class<RequestPropertyType> propertyType,
String key)
Generic method that returns the most recently memorised property that is of the specified type (including sub types) and identified with key . |
|
|
recall(Class<RequestPropertyType> propertyType,
String key,
int step)
Generic method that returns the first property found that is of the specified type (including sub types), was memorised in step and
identified with key . |
|
PropertyType |
recall(String key)
Generic method that returns the most recently memorised property that is identified with key . |
|
PropertyType |
recall(String key,
int step)
Generic method that returns the first property that was memorised in step and identified with key . |
|
|
recallAll(Class<RequestPropertyType> propertyType)
Generic method that returns a collection of all properties found that are of the specified type (including sub types). |
|
|
recallAll(Class<RequestPropertyType> propertyType,
String key)
Generic method that returns a collection of all properties found that are of the specified type (including sub types)and are identified by key . |
|
Collection<PropertyType> |
recallAll(String key)
Generic method that returns a collection of all properties found that are identified by key . |
|
void |
refresh(PropertyType propertyToMemorize)
Tries to refresh the specified property in this memory applying the default retention time. |
|
void |
refresh(PropertyType propertyToMemorize,
int retentionTime)
Refreshes the property from this memory and assigns the given retention time. |
|
void |
refresh(String key)
Refreshes the property with the specified key that was memorised last from this memory. |
|
void |
refresh(String key,
int step)
Refreshes the property with the specified key that was memorised in step from this memory. |
|
void |
refresh(String key,
int step,
int retentionTime)
Refreshes the property with the specified key that was memorised last from this memory and assigns the given retention time. |
|
void |
removeMemoryPropertyObserver(LaraMemoryListener.MemoryEvent eventType,
LaraMemoryListener listener)
|
|
void |
setDefaultRetentionTime(int defaultRetentionTime)
Sets the default retention time |
Methods inherited from interface de.cesr.lara.components.container.LaraContainer |
---|
getCapacity, getSize, isEmpty, isFull |
Methods inherited from interface java.lang.Iterable |
---|
iterator |
Field Detail |
---|
static final int UNLIMITED_RETENTION
Method Detail |
---|
void addMemoryPropertyObserver(LaraMemoryListener.MemoryEvent eventType, LaraMemoryListener listener)
LaraMemoryListener
for the specified
LaraMemoryListener.MemoryEvent
eventType
- the category of memory property events the listeners shall be
registered forlistener
- the listener to be registeredvoid clear() throws LRemoveException
LRemoveException
boolean contains(Class<?> propertyType, String key)
key
-
boolean contains(PropertyType property)
LaraProperty
.
key
-
boolean contains(PropertyType property, String key)
LaraProperty
with
the given key.
key
-
boolean contains(String key)
LaraProperty
with the given
key.
key
-
boolean contains(String key, int timestamp)
LaraProperty
with the given
key for the given time stamp.
key
- timestamp
-
PropertyType forget(PropertyType propertyToRemove) throws LRemoveException
propertyToRemove
- the property to be removed.
LRemoveException
PropertyType forget(String key, int step) throws LRemoveException
step
from this memory.
key
- identifier for the property to be removed.step
- the step in which the property to be removed was memorised.
LRemoveException
Collection<PropertyType> forgetAll(Collection<PropertyType> propertiesToBeRemoved) throws LRemoveException
propertiesToBeRemoved
- the properties to be removed
LRemoveException
Collection<PropertyType> forgetAll(String key) throws LRemoveException
key
- key identifier for the properties to be removed.
LRemoveException
Set<String> getAllPropertyKeys()
int getDefaultRetentionTime()
String getName()
int getRetentionTime(PropertyType property)
property
-
void memorize(PropertyType propertyToMemorize) throws LContainerFullException, LInvalidTimestampException
propertyToMemorize
- the property to be memorised.
LContainerFullException
LInvalidTimestampException
void memorize(PropertyType propertyToMemorize, int retentionTime) throws LContainerFullException, LInvalidTimestampException
propertyToMemorize
- the property to be memorised.retentionTime
-
LContainerFullException
LInvalidTimestampException
<RequestPropertyType extends PropertyType> RequestPropertyType recall(Class<RequestPropertyType> propertyType, String key) throws LRetrieveException
key
.
propertyType
- key
- identifier for the property to be retrieved.
key
.
LRetrieveException
<RequestPropertyType extends PropertyType> RequestPropertyType recall(Class<RequestPropertyType> propertyType, String key, int step) throws LRetrieveException
step
and
identified with key
.
propertyType
- key
- identifier for the property to be retrieved.step
- step in which the property was memorised.
step
and identified with key
.
LRetrieveException
PropertyType recall(String key) throws LRetrieveException
key
.
key
- identifier for the property to be retrieved.
key
.
LRetrieveException
PropertyType recall(String key, int step) throws LRetrieveException
step
and identified with key
.
key
- identifier for the property to be retrieved.step
- step in which the property was memorised.
step
and
identified with key
.
LRetrieveException
<RequestPropertyType extends PropertyType> Collection<RequestPropertyType> recallAll(Class<RequestPropertyType> propertyType) throws LRetrieveException
propertyType
-
step
and identified with key
.
LRetrieveException
<RequestPropertyType extends PropertyType> Collection<RequestPropertyType> recallAll(Class<RequestPropertyType> propertyType, String key) throws LRetrieveException
key
.
propertyType
- key
- identifier for the properties to be retrieved.
step
and identified with key
.
LRetrieveException
Collection<PropertyType> recallAll(String key) throws LRetrieveException
key
.
key
- identifier for the properties to be retrieved.
step
and identified with key
.
LRetrieveException
void refresh(PropertyType propertyToMemorize) throws LContainerFullException, LInvalidTimestampException
propertyToMemorize
- the property to be memorised.
LContainerFullException
LInvalidTimestampException
void refresh(PropertyType propertyToMemorize, int retentionTime) throws LInvalidTimestampException, LRemoveException
propertyToMemorize
- the property to be memorised.retentionTime
- time the property lasts in memory
LContainerFullException
LInvalidTimestampException
LRemoveException
void refresh(String key) throws LRemoveException
key
- identifier for the property to be refreshed.
LRemoveException
void refresh(String key, int step) throws LRemoveException
step
from this memory.
key
- identifier for the property to be refreshed.step
- the step in which the property to be removed was memorised.
LRemoveException
void refresh(String key, int step, int retentionTime) throws LInvalidTimestampException, LRemoveException
propertyToMemorize
- the property to be memorised.retentionTime
- time the property lasts in memory
LContainerFullException
LInvalidTimestampException
LRemoveException
void removeMemoryPropertyObserver(LaraMemoryListener.MemoryEvent eventType, LaraMemoryListener listener)
eventType
- the category of memory property events the listeners shall be
removed fromlistener
- the listener to be removedvoid setDefaultRetentionTime(int defaultRetentionTime)
defaultRetentionTime
- the default retention time
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |