Package modelarium.entities.readonly
Class ReadOnlyEnvironment
java.lang.Object
modelarium.entities.readonly.ReadOnlyEntity<EnvironmentSimulationContext,EnvironmentContext,EnvironmentAttributeSet,AttributeSetLog<EnvironmentSimulationContext>>
modelarium.entities.readonly.ReadOnlyEnvironment
public final class ReadOnlyEnvironment
extends ReadOnlyEntity<EnvironmentSimulationContext,EnvironmentContext,EnvironmentAttributeSet,AttributeSetLog<EnvironmentSimulationContext>>
Class for providing a read-only view of an
Environment.
This class wraps the mutable environment so that other model elements can inspect it without being able to modify it.
-
Constructor Summary
ConstructorsConstructorDescriptionReadOnlyEnvironment(Environment entity) Constructs a new immutable environment wrapping the specified mutable environment. -
Method Summary
Modifier and TypeMethodDescriptiongetAttributeSet(int attributeSetIndex) Retrieves a read-only view of one of the wrapped environment's attribute sets by index.getAttributeSet(String attributeSetName) Retrieves a read-only view of one of the wrapped environment's attribute sets by name.Retrieves a read-only view of an event attribute from one of the wrapped environment's attribute sets.getProperty(String attributeSetName, String propertyName) Retrieves a read-only view of a property attribute from one of the wrapped environment's attribute sets.getRoutine(String attributeSetName, String routineName) Retrieves a read-only view of a routine attribute from one of the wrapped environment's attribute sets.Methods inherited from class modelarium.entities.readonly.ReadOnlyEntity
attributeCount, attributeSetCount, getLog, getMutableEntity, name
-
Constructor Details
-
ReadOnlyEnvironment
Constructs a new immutable environment wrapping the specified mutable environment.- Parameters:
entity- the mutable environment to provide a read-only view of
-
-
Method Details
-
getAttributeSet
Retrieves a read-only view of one of the wrapped environment's attribute sets by index.- Specified by:
getAttributeSetin classReadOnlyEntity<EnvironmentSimulationContext,EnvironmentContext, EnvironmentAttributeSet, AttributeSetLog<EnvironmentSimulationContext>> - Parameters:
attributeSetIndex- the index of the attribute set to retrieve- Returns:
- a new
ReadOnlyEnvironmentAttributeSetinstance wrapping the attribute set at the specified index
-
getAttributeSet
Retrieves a read-only view of one of the wrapped environment's attribute sets by name.- Specified by:
getAttributeSetin classReadOnlyEntity<EnvironmentSimulationContext,EnvironmentContext, EnvironmentAttributeSet, AttributeSetLog<EnvironmentSimulationContext>> - Parameters:
attributeSetName- the name of the attribute set to retrieve- Returns:
- a new
ReadOnlyEnvironmentAttributeSetinstance wrapping the attribute set with the specified name
-
getEvent
Retrieves a read-only view of an event attribute from one of the wrapped environment's attribute sets.- Parameters:
attributeSetName- the name of the attribute set containing the eventeventName- the name of the event to retrieve- Returns:
- the
ReadOnlyEventwith the specified name
-
getRoutine
Retrieves a read-only view of a routine attribute from one of the wrapped environment's attribute sets.- Parameters:
attributeSetName- the name of the attribute set containing the routineroutineName- the name of the routine to retrieve- Returns:
- the
ReadOnlyRoutinewith the specified name
-
getProperty
Retrieves a read-only view of a property attribute from one of the wrapped environment's attribute sets.- Parameters:
attributeSetName- the name of the attribute set containing the propertypropertyName- the name of the property to retrieve- Returns:
- the
ReadOnlyPropertywith the specified name
-