Package modelarium.entities.logging
Class EntityLog<SC extends SimulationContext,C extends Context,AS extends AttributeSet<SC,C>,ASL extends AttributeSetLog<SC>>
java.lang.Object
modelarium.entities.logging.EntityLog<SC,C,AS,ASL>
- Type Parameters:
SC- the type of simulation context the entity usesC- the type of context interface the entity's attributes are givenAS- the type of attribute set the entity ownsASL- the type of attribute set log the entity produces
public class EntityLog<SC extends SimulationContext,C extends Context,AS extends AttributeSet<SC,C>,ASL extends AttributeSetLog<SC>>
extends Object
Class for collecting the attribute set logs of a single entity.
This class gathers the AttributeSetLog of each of an entity's attribute sets, providing lookup by index
or name along with the ability to disconnect every underlying log database at once.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintReturns the number of attribute set logs this entity log collects.voidDisconnects the database of every collected attribute set log and clears the log collection.get(int attributeSetIndex) Retrieves an attribute set log by index.Retrieves an attribute set log by the name of its attribute set.Returns the name of the entity this log belongs to.
-
Constructor Details
-
EntityLog
Constructs a new entity log collecting the logs of the specified attribute sets.- Parameters:
entityName- the name of the entity the log belongs toattributeSets- the attribute sets whose logs the entity log will collect
-
-
Method Details
-
getEntityName
Returns the name of the entity this log belongs to.- Returns:
- the owning entity's name
-
get
Retrieves an attribute set log by index.- Parameters:
attributeSetIndex- the index of the attribute set log to retrieve- Returns:
- the attribute set log at the specified index
-
get
Retrieves an attribute set log by the name of its attribute set.- Parameters:
attributeSetName- the name of the attribute set whose log to retrieve- Returns:
- the attribute set log with the specified name
-
attributeSetLogCount
public int attributeSetLogCount()Returns the number of attribute set logs this entity log collects.- Returns:
- the entity log's attribute set log count
-
disconnectDatabases
public void disconnectDatabases()Disconnects the database of every collected attribute set log and clears the log collection.
-