Class PlanitComponent<T extends PlanitComponent<T> & Serializable>

    • Constructor Detail

      • PlanitComponent

        protected PlanitComponent​(IdGroupingToken tokenId,
                                  Class<?> classType)
        Constructor
        Parameters:
        tokenId - , contiguous id generation using this same token for instances of this class
        classType - , the class type this instance belongs to and we are generating an id for
      • PlanitComponent

        protected PlanitComponent​(PlanitComponent<T> other)
        Copy constructor
        Parameters:
        other - , to copy
    • Method Detail

      • getKnownSupportedEventTypes

        public PlanitComponentEventType[] getKnownSupportedEventTypes()
        Each component may override this default which indicates it does not support any events, meaning that the component is not notified on any planitcomponent events. Derived classes may override to register for specific events if needed
        Specified by:
        getKnownSupportedEventTypes in interface EventListener
        Returns:
        default supported event types (none)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • getId

        public long getId()
        Collect id of the entity
        Specified by:
        getId in interface IdAble
        Returns:
        id found
      • setExternalId

        public void setExternalId​(String externalId)
        set the external id
        Specified by:
        setExternalId in interface ExternalIdAble
        Parameters:
        externalId - to set
      • getXmlId

        public String getXmlId()
        the id exposed to users as the "normal" id in the PLANit native xml format
        Specified by:
        getXmlId in interface ExternalIdAble
        Returns:
        xmlId
      • setXmlId

        public void setXmlId​(String xmlId)
        set the external id
        Specified by:
        setXmlId in interface ExternalIdAble
        Parameters:
        xmlId - to set
      • getComponentType

        public String getComponentType()
        Collect the component type of this instance
        Returns:
        PLANit component type
      • getIdGroupingToken

        public IdGroupingToken getIdGroupingToken()
        Collect the id grouping token used to generate ids for entities of this class.
        Returns:
        id grouping token
      • clone

        public abstract PlanitComponent<T> clone()
        Create a shallow copy of this entity
        Specified by:
        clone in interface IdAble
        Overrides:
        clone in class Object
        Returns:
        shallow copy of entity
      • reset

        public abstract void reset()
        All components should be able to reset going back to some representative initial state