Class ReadOnlyAgentAttributeSet
java.lang.Object
modelarium.entities.attributes.sets.readonly.ReadOnlyAttributeSet<AgentSimulationContext,AgentContext>
modelarium.entities.attributes.sets.readonly.ReadOnlyAgentAttributeSet
public final class ReadOnlyAgentAttributeSet
extends ReadOnlyAttributeSet<AgentSimulationContext,AgentContext>
Class for providing a read-only view of an
AgentAttributeSet.
This class specialises ReadOnlyAttributeSet so that retrieved attributes are returned as deep clones
of their agent-flavoured types.
-
Constructor Summary
ConstructorsConstructorDescriptionReadOnlyAgentAttributeSet(AgentAttributeSet attributeSet) Constructs a new immutable agent 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
-
ReadOnlyAgentAttributeSet
Constructs a new immutable agent attribute set wrapping the specified mutable attribute set.- Parameters:
attributeSet- the mutable agent 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<AgentSimulationContext,AgentContext> - Parameters:
index- the index of the attribute to retrieve- Returns:
- a deep clone of the
AgentAttributeat the specified index
-
get
Retrieves a deep clone of a publicly accessible attribute by name.- Specified by:
getin classReadOnlyAttributeSet<AgentSimulationContext,AgentContext> - Parameters:
attributeName- the name of the attribute to retrieve- Returns:
- a deep clone of the
AgentAttributewith the specified name
-
getEvent
Retrieves a deep clone of an event by its index among the wrapped set's events.- Specified by:
getEventin classReadOnlyAttributeSet<AgentSimulationContext,AgentContext> - Parameters:
eventIndex- the index of the event to retrieve- Returns:
- a deep clone of the
AgentEventat the specified index
-
getEvent
Retrieves a deep clone of an event by name.- Specified by:
getEventin classReadOnlyAttributeSet<AgentSimulationContext,AgentContext> - Parameters:
eventName- the name of the event to retrieve- Returns:
- a deep clone of the
AgentEventwith the specified name
-
getRoutine
Retrieves a deep clone of a routine by its index among the wrapped set's routines.- Specified by:
getRoutinein classReadOnlyAttributeSet<AgentSimulationContext,AgentContext> - Parameters:
routineIndex- the index of the routine to retrieve- Returns:
- a deep clone of the
AgentRoutineat the specified index
-
getRoutine
Retrieves a deep clone of a routine by name.- Specified by:
getRoutinein classReadOnlyAttributeSet<AgentSimulationContext,AgentContext> - Parameters:
routineName- the name of the routine to retrieve- Returns:
- a deep clone of the
AgentRoutinewith the specified name
-
getProperty
Retrieves a deep clone of a property by its index among the wrapped set's properties.- Specified by:
getPropertyin classReadOnlyAttributeSet<AgentSimulationContext,AgentContext> - Parameters:
propertyIndex- the index of the property to retrieve- Returns:
- a deep clone of the
AgentPropertyat the specified index
-
getProperty
Retrieves a deep clone of a property by name.- Specified by:
getPropertyin classReadOnlyAttributeSet<AgentSimulationContext,AgentContext> - Parameters:
propertyName- the name of the property to retrieve- Returns:
- a deep clone of the
AgentPropertywith the specified name
-