Class ConnectoidImpl

  • All Implemented Interfaces:
    Serializable, Comparable<Edge>, Edge, Connectoid

    public class ConnectoidImpl
    extends EdgeImpl
    implements Connectoid
    connectoid connecting a zone to the physical road network, carrying two connectoid segments in one or two directions which may carry additional information for each particular direction of the connectoid.
    Author:
    markr
    See Also:
    Serialized Form
    • Field Detail

      • connectoidId

        protected final long connectoidId
        unique internal identifier
      • externalId

        protected Object externalId
        External Id of the connectoid
    • Constructor Detail

      • ConnectoidImpl

        public ConnectoidImpl​(IdGroupingToken groupId,
                              Centroid centroidA,
                              Node nodeB,
                              double length,
                              Object externalId)
                       throws PlanItException
        Constructor
        Parameters:
        groupId - contiguous id generation within this group for instances of this class
        centroidA - the centroid at one end of the connectoid
        nodeB - the node at the other end of the connectoid
        length - length of the current connectoid
        externalId - externalId of the connectoid (can be null, in which case this has not be set in the input files)
        Throws:
        PlanItException - thrown if there is an error
      • ConnectoidImpl

        public ConnectoidImpl​(IdGroupingToken groupId,
                              Centroid centroidA,
                              Node nodeB,
                              double length)
                       throws PlanItException
        Constructor
        Parameters:
        groupId - contiguous id generation within this group for instances of this class
        centroidA - the centroid at one end of the connectoid
        nodeB - the node at the other end of the connectoid
        length - length of the current connectoid
        Throws:
        PlanItException - thrown if there is an error
    • Method Detail

      • generateConnectoidId

        protected static int generateConnectoidId​(IdGroupingToken groupId)
        Generate connectoid id
        Parameters:
        groupId - contiguous id generation within this group for instances of this class
        Returns:
        id of connectoid
      • registerConnectoidSegment

        public ConnectoidSegment registerConnectoidSegment​(ConnectoidSegment connectoidSegment,
                                                           boolean directionAB)
                                                    throws PlanItException
        Register connectoidSegment. If there already exists a connectoidSegment for that direction it is replaced and returned
        Specified by:
        registerConnectoidSegment in interface Connectoid
        Parameters:
        connectoidSegment - connectoid segment to be registered
        directionAB - direction of travel
        Returns:
        replaced ConnectoidSegment
        Throws:
        PlanItException - thrown if there is an error
      • getConnectoidId

        public long getConnectoidId()
        Return the id of this connectoid
        Specified by:
        getConnectoidId in interface Connectoid
        Returns:
        id of this connectoid
      • getExternalId

        public Object getExternalId()
        Description copied from interface: Connectoid
        Collect the external id of this connectoid
        Specified by:
        getExternalId in interface Connectoid
        Returns:
        external id
      • setExternalId

        public void setExternalId​(Object externalId)
        Description copied from interface: Connectoid
        set the external id of this connectoid
        Specified by:
        setExternalId in interface Connectoid
        Parameters:
        externalId - the external id to set
      • hasExternalId

        public boolean hasExternalId()
        Description copied from interface: Connectoid
        Returns true if this connectoid has its external Id set, false otherwise
        Specified by:
        hasExternalId in interface Connectoid
        Returns:
        true if this connectoid has its external Id set, false otherwise