Class NamedEntity

java.lang.Object
desmoj.core.simulator.NamedObject
desmoj.core.simulator.ModelComponent
desmoj.core.simulator.Schedulable
desmoj.core.simulator.Entity
cambio.simulator.entities.NamedEntity
Direct Known Subclasses:
InstanceOwnedPattern, Microservice, Operation, Request, RequestSender, ServiceDependencyInstance, ServiceOwnedPattern

public abstract class NamedEntity extends desmoj.core.simulator.Entity
Class that adds further options for the retrieving of names of Entitys. Specifically, it provides a plain name for each entity, that does not contain the number assigned by DESMO-J. However, these plain names are not guaranteed to be unique.

Also pre-computes the names of the entity so the strings are not generated on every method call. This gives a performance improvement over the default implementation when read a large amount of names.

Plain names should be used when it comes to generating new entity names based on other entity names to prevent chains of unique identifiers.

Author:
Lion Wagner
  • Field Summary

    Fields inherited from class desmoj.core.simulator.Schedulable

    _schedule
  • Constructor Summary

    Constructors
    Constructor
    Description
    NamedEntity(desmoj.core.simulator.Model model, String name, boolean showInTrace)
    Constructor for a named entity.
  • Method Summary

    Modifier and Type
    Method
    Description
     
    Gets a quoted version of the name of this object.
    Gets a quoted version of the plain name of this object.
    void
    rename(String name)
    Renames this entity.

    Methods inherited from class desmoj.core.simulator.Entity

    clone, generateTraceForScheduling, getIdentNumber, getQueueingPriority, getQueues, getScheduledEvents, isEqual, isLarger, isLargerOrEqual, isNotEqual, isQueued, isSimProcess, isSmaller, isSmallerOrEqual, schedule, schedule, schedule, schedule, schedule, schedule, schedule, schedule, schedule, scheduleAfter, scheduleAfter, scheduleAfter, scheduleBefore, scheduleBefore, scheduleBefore, schedulePreempt, schedulePreempt, schedulePreempt, setQueueingPriority

    Methods inherited from class desmoj.core.simulator.Schedulable

    assignReporter, cancel, getCorrespondingReportable, isCurrent, isScheduled, reSchedule, reSchedule, reSchedulePreempt, scheduledNext, setCorrespondingReportable

    Methods inherited from class desmoj.core.simulator.ModelComponent

    current, currentEntity, currentEntityAll, currentEvent, currentlySendDebugNotes, currentlySendTraceNotes, currentModel, currentSimProcess, debugIsOn, debugOff, debugOn, getModel, isExperimentCompatible, isModelCompatible, presentTime, sendDebugNote, sendMessage, sendTraceNote, sendWarning, skipTraceNote, skipTraceNote, traceIsOn, traceOff, traceOn

    Methods inherited from class desmoj.core.simulator.NamedObject

    getName, toString

    Methods inherited from class java.lang.Object

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

    • NamedEntity

      public NamedEntity(desmoj.core.simulator.Model model, String name, boolean showInTrace)
      Constructor for a named entity.
      Parameters:
      model - The model this entity belongs to.
      name - The name of the entity.
      showInTrace - Flag indicating whether the entity should be shown in the trace.
  • Method Details

    • getPlainName

      public String getPlainName()
    • rename

      public void rename(String name)
      Renames this entity.
      Overrides:
      rename in class desmoj.core.simulator.Schedulable
    • getQuotedPlainName

      public String getQuotedPlainName()
      Gets a quoted version of the plain name of this object.
      Returns:
      the plain name of this entity surrounded with ' quotes.
    • getQuotedName

      public String getQuotedName()
      Gets a quoted version of the name of this object. The name will include the object number assigned by DESMO-J.
      Overrides:
      getQuotedName in class desmoj.core.simulator.NamedObject
      Returns:
      the name of this entity surrounded with ' quotes.