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,
                                  boolean deepCopy)
        Copy constructor
        Parameters:
        other - , to copy
        deepCopy - when true, create a deep copy, shallow copy otherwise
    • Method Detail

      • shallowClone

        public abstract PlanitComponent<T> shallowClone()
        Create a shallow copy of this entity
        Specified by:
        shallowClone in interface IdAble
        Returns:
        shallow copy of entity
      • deepClone

        public abstract PlanitComponent<T> deepClone()
        deep clone on planit component should attempt to also update internal dependencies between deep cloned containers where possible
        Specified by:
        deepClone in interface IdAble
        Returns:
        deep copy of entity
      • reset

        public abstract void reset()
        All components should be able to reset going back to some representative initial state
      • 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
      • collectSettingsAsKeyValueMap

        public abstract Map<String,​String> collectSettingsAsKeyValueMap()
        Provide all the settings of this particular component by name and value, where each value is a string representation of the underlying entity
        Returns:
        name-value map of all (user configurable) settings
      • 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