de.cesr.lara.components.environment
Interface LaraEnvironment

All Known Subinterfaces:
LaraEnvironmentContext<T>, LaraSuperEnvironment
All Known Implementing Classes:
Environment, LEnvironment, LEnvironmentContext, MyEnvironment

public interface LaraEnvironment

This class defines the interface between agents and its various environments:

Environments may have sub-environments (see User Guide).


Method Summary
 void addEnvListener(LaraEnvironmentListener listener)
          Adds an LaraEnvironmentListener to the entire LaraEnvironment.
 void addEnvListener(LaraEnvironmentListener listener, String name)
          Registers a LaraEnvironmentListener at this environment to observe only a certain property.
 void addProperty(LAbstractEnvironmentalProperty<?> property)
          Adds a property in case it does not yet exist or updates it otherwise.
 boolean containsProperty(LAbstractEnvironmentalProperty<?> property)
          Checks whether a property is in the list or not.
 boolean containsProperty(String name)
          Checks whether a property name is in the environment or not.
 Set<LaraEnvironmentListener> getAllListeners()
          Returns a set of all listeners - those that are registered at all properties and those registered at certain properties.
 Collection<LAbstractEnvironmentalProperty<?>> getEnvProperties()
          Returns a Collection of all LAbstractEnvironmentalPropertys of this environment.
 LAbstractEnvironmentalProperty<?> getPropertyByName(String name)
           
<V> LAbstractEnvironmentalProperty<V>
getTypedPropertyByName(String name)
           
 boolean removeEnvListener(LaraEnvironmentListener listener)
          Remove a LaraEnvironmentListener from the entire LaraEnvironment.
 void removeEnvListener(LaraEnvironmentListener listener, String name)
          Removes a LaraEnvironmentListener at this environment from the given property.
 boolean removeProperty(LAbstractEnvironmentalProperty<?> property)
          Removes a property if it is contained in the environment's list.
 boolean removeProperty(String name)
          Removes a property if it is contained in the environment's list.
 void updateProperty(LAbstractEnvironmentalProperty<?> property)
          Changes an existing property or adds it in case it does not yet exist.
 

Method Detail

addEnvListener

void addEnvListener(LaraEnvironmentListener listener)
Adds an LaraEnvironmentListener to the entire LaraEnvironment.

Parameters:
listener - listener to add.

addEnvListener

void addEnvListener(LaraEnvironmentListener listener,
                    String name)
Registers a LaraEnvironmentListener at this environment to observe only a certain property.

Parameters:
listener - the observer to register
name - name of property to observe

addProperty

void addProperty(LAbstractEnvironmentalProperty<?> property)
Adds a property in case it does not yet exist or updates it otherwise.

Parameters:
property - property to add

containsProperty

boolean containsProperty(LAbstractEnvironmentalProperty<?> property)
Checks whether a property is in the list or not.

Parameters:
property - property to check
Returns:
true if the property is within the list, false otherwise

containsProperty

boolean containsProperty(String name)
Checks whether a property name is in the environment or not.

Parameters:
name - name of property to check
Returns:
true if the name is within the list, false otherwise

getAllListeners

Set<LaraEnvironmentListener> getAllListeners()
Returns a set of all listeners - those that are registered at all properties and those registered at certain properties.

Returns:
listeners set of all listeners

getEnvProperties

Collection<LAbstractEnvironmentalProperty<?>> getEnvProperties()
Returns a Collection of all LAbstractEnvironmentalPropertys of this environment.

Returns:
envProperties all LAbstractEnvironmentalPropertys stored by this LaraEnvironment

getPropertyByName

LAbstractEnvironmentalProperty<?> getPropertyByName(String name)
Parameters:
name - the LAbstractEnvironmentalProperty's name
Returns:
property of environment

getTypedPropertyByName

<V> LAbstractEnvironmentalProperty<V> getTypedPropertyByName(String name)
Type Parameters:
V - type of requested property
Parameters:
name - the LAbstractEnvironmentalProperty's name
Returns:
property of environment

removeEnvListener

boolean removeEnvListener(LaraEnvironmentListener listener)
Remove a LaraEnvironmentListener from the entire LaraEnvironment. This does not impact listeners that are registered at certain properties!

Parameters:
listener - listener to remove.
Returns:
boolean true if the listener was contained and could be removed

removeEnvListener

void removeEnvListener(LaraEnvironmentListener listener,
                       String name)
Removes a LaraEnvironmentListener at this environment from the given property. This does not impact possibly same listeners that are registered at the whole Environment.

Parameters:
listener - the observer to register
name - name of observed property

removeProperty

boolean removeProperty(LAbstractEnvironmentalProperty<?> property)
Removes a property if it is contained in the environment's list.

Parameters:
property - property to remove
Returns:
true if the property was in the list and could be removed

removeProperty

boolean removeProperty(String name)
Removes a property if it is contained in the environment's list.

Parameters:
name - name of property to remove
Returns:
true if the property was in the list and could be removed

updateProperty

void updateProperty(LAbstractEnvironmentalProperty<?> property)
Changes an existing property or adds it in case it does not yet exist.

Parameters:
property - property to update or add