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 uses
C - the type of context interface the entity's attributes are given
AS - the type of attribute set the entity owns
ASL - 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
    Constructor
    Description
    EntityLog(String entityName, List<AS> attributeSets)
    Constructs a new entity log collecting the logs of the specified attribute sets.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the number of attribute set logs this entity log collects.
    void
    Disconnects the database of every collected attribute set log and clears the log collection.
    get(int attributeSetIndex)
    Retrieves an attribute set log by index.
    get(String attributeSetName)
    Retrieves an attribute set log by the name of its attribute set.
    Returns the name of the entity this log belongs to.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • EntityLog

      public EntityLog(String entityName, List<AS> attributeSets)
      Constructs a new entity log collecting the logs of the specified attribute sets.
      Parameters:
      entityName - the name of the entity the log belongs to
      attributeSets - the attribute sets whose logs the entity log will collect
  • Method Details

    • getEntityName

      public String getEntityName()
      Returns the name of the entity this log belongs to.
      Returns:
      the owning entity's name
    • get

      public ASL get(int attributeSetIndex)
      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

      public ASL get(String attributeSetName)
      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.