Class TrafficAssignmentComponent<T extends TrafficAssignmentComponent<T> & Serializable>

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected long id
      unique identifier for this traffic component
      protected IdGroupingToken tokenId
      id generation using this token will be contiguous and unique for each instance of this class
      protected String trafficComponentType
      Traffic component type used to identify the component uniquely.
      • Fields inherited from class org.djutils.event.EventProducer

        listeners
      • Fields inherited from interface org.djutils.event.EventProducerInterface

        FIRST_POSITION, LAST_POSITION
    • Field Detail

      • id

        protected final long id
        unique identifier for this traffic component
      • tokenId

        protected IdGroupingToken tokenId
        id generation using this token will be contiguous and unique for each instance of this class
      • trafficComponentType

        protected final String trafficComponentType
        Traffic component type used to identify the component uniquely. If not provided to the constructor the class name is used
    • Constructor Detail

      • TrafficAssignmentComponent

        protected TrafficAssignmentComponent​(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
    • Method Detail

      • hashCode

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

        public String getTrafficComponentType()
      • getId

        public long getId()
        All traffic components must have a unique id
        Specified by:
        getId in interface Idable
        Returns:
        id of traffic assignment component
      • getIdGroupingToken

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

        public Serializable getSourceId()
        the source id whenever this instance fires an event is simply this
        Specified by:
        getSourceId in interface org.djutils.event.EventProducerInterface
        Specified by:
        getSourceId in class org.djutils.event.EventProducer
        Returns:
        this instance as source id