de.cesr.lara.components.environment
Interface LaraSuperEnvironment

All Superinterfaces:
LaraEnvironment
All Known Implementing Classes:
Environment, LEnvironment, MyEnvironment

public interface LaraSuperEnvironment
extends LaraEnvironment

TODO add property functions that deal with sub-envs (see removePropertySubenv) (SH) Extends LaraEnvironment and allows registering sub-environments that are accessed by this super environment. NOTE: Classes that implement this interface need to state which methods they delegate to registered sub-environments!


Field Summary
static Object ALL_CATEGORIES
           
 
Method Summary
 Set<LaraEnvironment> getSubEnvironments()
          Returns all registered sub-environments.
 Set<LaraEnvironment> getSubEnvironments(Object category)
          Returns all registered sub-environments of the given category.
 void registerEnvironment(Object cat, LaraEnvironment environment)
          Registers a new LaraEnvironment at this super environment.
 void removeEnvironment(LaraEnvironment environment)
          Removes a LaraEnvironment from this super environment.
 void removeEnvironment(Object cat)
          Removes all LaraEnvironment from this super environment that belong to the given category.
 boolean removePropertySubenv(Object category, String name)
          Removes properties with the given name also in sub-environments of the given category.
 
Methods inherited from interface de.cesr.lara.components.environment.LaraEnvironment
addEnvListener, addEnvListener, addProperty, containsProperty, containsProperty, getAllListeners, getEnvProperties, getPropertyByName, getTypedPropertyByName, removeEnvListener, removeEnvListener, removeProperty, removeProperty, updateProperty
 

Field Detail

ALL_CATEGORIES

static final Object ALL_CATEGORIES
Method Detail

getSubEnvironments

Set<LaraEnvironment> getSubEnvironments()
Returns all registered sub-environments.

Returns:
all sub-environments

getSubEnvironments

Set<LaraEnvironment> getSubEnvironments(Object category)
Returns all registered sub-environments of the given category.

Returns:
all sub-environments

registerEnvironment

void registerEnvironment(Object cat,
                         LaraEnvironment environment)
Registers a new LaraEnvironment at this super environment. The category object allows the modeler to define categories of environment and to look up environments by this category. For instance, there are agent classes that are embedded in environments that are specialised but belong to a certain category. The category may be used for methods across agent classes. Furthermore, several environments may be grouped by category. Examples for categories are social and bio-physical environments.

Parameters:
cat - category object to identify the (type of) environment. Null is allowed.
environment - environment to register

removeEnvironment

void removeEnvironment(LaraEnvironment environment)
Removes a LaraEnvironment from this super environment.

Parameters:
environment - environment to remove

removeEnvironment

void removeEnvironment(Object cat)
Removes all LaraEnvironment from this super environment that belong to the given category.

Parameters:
cat - category object to identify the (type of) environment

removePropertySubenv

boolean removePropertySubenv(Object category,
                             String name)
Removes properties with the given name also in sub-environments of the given category. ALL_CATEGORIES removes it in all categories. Null is allowed as category.

Parameters:
name - of the properties to remove
Returns:
true if any property was removed