Class DirectedEdgeImpl

    • Constructor Detail

      • DirectedEdgeImpl

        protected DirectedEdgeImpl​(IdGroupingToken groupId,
                                   DirectedVertex vertexA,
                                   DirectedVertex vertexB)
        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
      • DirectedEdgeImpl

        protected DirectedEdgeImpl​(IdGroupingToken groupId,
                                   DirectedVertex vertexA,
                                   DirectedVertex vertexB,
                                   double lengthKm)
        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
      • 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)
        Register EdgeSegment. If there already exists an edgeSegment for that direction it is replaced and returned. If the edge segment has no parent edge, this edge is set. If there is a discrepancy between the edge segment's parent edge and this edge a warning is issued and the edge segment is not registered
        Specified by:
        registerEdgeSegment in interface DirectedEdge
        Parameters:
        edgeSegment - the edgeSegment to be registered
        directionAB - direction of travel
        Returns:
        replaced egeSegment (if any)
      • 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