Class DirectedEdgeImpl<V extends DirectedVertex,​ES extends EdgeSegment>

    • Constructor Detail

      • DirectedEdgeImpl

        protected DirectedEdgeImpl​(IdGroupingToken groupId,
                                   V vertexA,
                                   V 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,
                                   V vertexA,
                                   V 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<V,​ES> directedEdgeImpl,
                                   boolean deepCopy)
        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
        deepCopy - when true, create a deep copy, shallow copy otherwise
    • Method Detail

      • setEdgeSegmentBa

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

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

        public ES registerEdgeSegment​(EdgeSegment edgeSegment,
                                      boolean directionAB,
                                      boolean force)
        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
        force - when true the provided edge segment is always set (even if null or inconsistent, without warning)
        Returns:
        replaced egeSegment (if any)
      • getEdgeSegmentAb

        public ES getEdgeSegmentAb()
        Edge segment in the direction from A to B
        Specified by:
        getEdgeSegmentAb in interface DirectedEdge
        Returns:
        edge segment AB
      • getEdgeSegmentBa

        public ES getEdgeSegmentBa()
        Edge segment in the direction from B to A
        Specified by:
        getEdgeSegmentBa in interface DirectedEdge
        Returns:
        edge segment BA
      • 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
      • removeEdgeSegmentAb

        public ES removeEdgeSegmentAb()
        Remove edge segmentAb from this edge. Be careful doing this as it because it might affect the contiguous ids if the edge segment is garbage collected
        Specified by:
        removeEdgeSegmentAb in interface DirectedEdge
        Returns:
        removed edge segment
      • removeEdgeSegmentBa

        public ES removeEdgeSegmentBa()
        Remove edge segmentAb from this edge. Be careful doing this as it because it might affect the contiguous ids if the edge segment is garbage collected
        Specified by:
        removeEdgeSegmentBa in interface DirectedEdge
        Returns:
        removed edge segment