Class ReadOnlyEnvironmentAttributeSet
java.lang.Object
modelarium.entities.attributes.sets.readonly.ReadOnlyAttributeSet<EnvironmentSimulationContext,EnvironmentContext>
modelarium.entities.attributes.sets.readonly.ReadOnlyEnvironmentAttributeSet
public final class ReadOnlyEnvironmentAttributeSet
extends ReadOnlyAttributeSet<EnvironmentSimulationContext,EnvironmentContext>
Class for providing a read-only view of an
EnvironmentAttributeSet.
This class specialises ReadOnlyAttributeSet so that retrieved attributes are returned as deep clones
of their environment-flavoured types.
-
Constructor Summary
ConstructorsConstructorDescriptionReadOnlyEnvironmentAttributeSet(EnvironmentAttributeSet attributeSet) Constructs a new immutable environment attribute set wrapping the specified mutable attribute set. -
Method Summary
Modifier and TypeMethodDescriptionget(int index) Retrieves a deep clone of a publicly accessible attribute by index.Retrieves a deep clone of a publicly accessible attribute by name.getEvent(int eventIndex) Retrieves a deep clone of an event by its index among the wrapped set's events.Retrieves a deep clone of an event by name.getProperty(int propertyIndex) Retrieves a deep clone of a property by its index among the wrapped set's properties.getProperty(String propertyName) Retrieves a deep clone of a property by name.getRoutine(int routineIndex) Retrieves a deep clone of a routine by its index among the wrapped set's routines.getRoutine(String routineName) Retrieves a deep clone of a routine by name.Methods inherited from class modelarium.entities.attributes.sets.readonly.ReadOnlyAttributeSet
getLog, name, size
-
Constructor Details
-
ReadOnlyEnvironmentAttributeSet
Constructs a new immutable environment attribute set wrapping the specified mutable attribute set.- Parameters:
attributeSet- the mutable environment attribute set to provide a read-only view of
-
-
Method Details
-
get
Retrieves a deep clone of a publicly accessible attribute by index.- Specified by:
getin classReadOnlyAttributeSet<EnvironmentSimulationContext,EnvironmentContext> - Parameters:
index- the index of the attribute to retrieve- Returns:
- a deep clone of the
EnvironmentAttributeat the specified index
-
get
Retrieves a deep clone of a publicly accessible attribute by name.- Specified by:
getin classReadOnlyAttributeSet<EnvironmentSimulationContext,EnvironmentContext> - Parameters:
attributeName- the name of the attribute to retrieve- Returns:
- a deep clone of the
EnvironmentAttributewith the specified name
-
getEvent
Retrieves a deep clone of an event by its index among the wrapped set's events.- Specified by:
getEventin classReadOnlyAttributeSet<EnvironmentSimulationContext,EnvironmentContext> - Parameters:
eventIndex- the index of the event to retrieve- Returns:
- a deep clone of the
EnvironmentEventat the specified index
-
getEvent
Retrieves a deep clone of an event by name.- Specified by:
getEventin classReadOnlyAttributeSet<EnvironmentSimulationContext,EnvironmentContext> - Parameters:
eventName- the name of the event to retrieve- Returns:
- a deep clone of the
EnvironmentEventwith the specified name
-
getRoutine
Retrieves a deep clone of a routine by its index among the wrapped set's routines.- Specified by:
getRoutinein classReadOnlyAttributeSet<EnvironmentSimulationContext,EnvironmentContext> - Parameters:
routineIndex- the index of the routine to retrieve- Returns:
- a deep clone of the
EnvironmentRoutineat the specified index
-
getRoutine
Retrieves a deep clone of a routine by name.- Specified by:
getRoutinein classReadOnlyAttributeSet<EnvironmentSimulationContext,EnvironmentContext> - Parameters:
routineName- the name of the routine to retrieve- Returns:
- a deep clone of the
EnvironmentRoutinewith the specified name
-
getProperty
Retrieves a deep clone of a property by its index among the wrapped set's properties.- Specified by:
getPropertyin classReadOnlyAttributeSet<EnvironmentSimulationContext,EnvironmentContext> - Parameters:
propertyIndex- the index of the property to retrieve- Returns:
- a deep clone of the
EnvironmentPropertyat the specified index
-
getProperty
Retrieves a deep clone of a property by name.- Specified by:
getPropertyin classReadOnlyAttributeSet<EnvironmentSimulationContext,EnvironmentContext> - Parameters:
propertyName- the name of the property to retrieve- Returns:
- a deep clone of the
EnvironmentPropertywith the specified name
-