Class DirectedEdgeImpl

    • Constructor Detail

      • DirectedEdgeImpl

        protected DirectedEdgeImpl​(IdGroupingToken groupId,
                                   DirectedVertex vertexA,
                                   DirectedVertex vertexB,
                                   double lengthKm)
                            throws PlanItException
        Constructor which injects link lengths directly
        Parameters:
        groupId - , contiguous id generation within this group for instances of this class
        vertexA - first vertex in the link
        vertexB - second vertex in the link
        lengthKm - length of the link in km
        Throws:
        PlanItException - thrown if there is an error
      • DirectedEdgeImpl

        protected DirectedEdgeImpl​(DirectedEdgeImpl directedEdgeImpl)
        Copy Constructor. Edge segments are shallow copied and point to the passed in edge as their parent So additional effort is needed to make the new edge usable
        Parameters:
        directedEdgeImpl - to copy
    • Method Detail

      • setEdgeSegmentBa

        protected void setEdgeSegmentBa​(EdgeSegment edgeSegmentBa)
        set edge segment from B to A
        Parameters:
        edgeSegmentBa - to set
      • setEdgeSegmentAb

        protected void setEdgeSegmentAb​(EdgeSegment edgeSegmentAb)
        set edge segment from A to B
        Parameters:
        edgeSegmentAb - to set
      • registerEdgeSegment

        public EdgeSegment registerEdgeSegment​(EdgeSegment edgeSegment,
                                               boolean directionAB)
                                        throws PlanItException
        Register EdgeSegment. If there already exists an edgeSegment for that direction it is replaced and returned
        Specified by:
        registerEdgeSegment in interface DirectedEdge
        Parameters:
        edgeSegment - the edgeSegment to be registered
        directionAB - direction of travel
        Returns:
        replaced egeSegment (if any)
        Throws:
        PlanItException - thrown if there is an error
      • clone

        public DirectedEdgeImpl clone()
        Clone the edge as is, all shared members are shallow copied, fully owned members are deep copied
        Specified by:
        clone in interface Edge
        Overrides:
        clone in class EdgeImpl
        Returns:
        copy of this edge
      • replace

        public void replace​(EdgeSegment edgeSegmentToReplace,
                            EdgeSegment edgeSegmentToReplaceWith)
        replace passed in edge segment (if present) with the passed in one
        Specified by:
        replace in interface DirectedEdge
        Parameters:
        edgeSegmentToReplace - the one to replace
        edgeSegmentToReplaceWith - the one to replace it with