Class PhysicalNetworkBuilderImpl

    • Field Detail

      • directedGraphBuilderImpl

        protected DirectedGraphBuilderImpl directedGraphBuilderImpl
        hold an implementation of directed graph builder to use its overlapping functionality
    • Constructor Detail

      • PhysicalNetworkBuilderImpl

        public PhysicalNetworkBuilderImpl​(IdGroupingToken groupId)
    • Method Detail

      • createEdge

        public Link createEdge​(Vertex nodeA,
                               Vertex nodeB,
                               double length)
                        throws PlanItException
        Create a new link instance
        Specified by:
        createEdge in interface GraphBuilder<Node,​Link>
        Parameters:
        nodeA - the first vertex in this edge
        nodeB - the second vertex in this edge
        length - the length (in km)
        Returns:
        created edge
        Throws:
        PlanItException - thrown if there is an error
      • setIdGroupingToken

        public void setIdGroupingToken​(IdGroupingToken groupToken)
        Each builder needs a group if token to allow all underlying factory methods to generated ids uniquely tied to the group the entities belong to
        Specified by:
        setIdGroupingToken in interface GraphBuilder<Node,​Link>
        Parameters:
        groupToken - , contiguous id generation within this group for instances created with the factory methods
      • recreateIds

        public void recreateIds​(Edges<? extends Link> links)
        recreate the ids for all passed in edges
        Specified by:
        recreateIds in interface GraphBuilder<Node,​Link>
        Parameters:
        links - to recreate ids for
      • recreateIds

        public void recreateIds​(Vertices<? extends Node> nodes)
        recreate the ids for all passed in vertices
        Specified by:
        recreateIds in interface GraphBuilder<Node,​Link>
        Parameters:
        nodes - to recreate ids for
      • createUniqueCopyOf

        public Link createUniqueCopyOf​(Link linkToCopy)
        create a shallo copy of the passed in edge, albeit with unique internal ids
        Specified by:
        createUniqueCopyOf in interface GraphBuilder<Node,​Link>
        Parameters:
        linkToCopy - the edge to copy
        Returns:
        new edge based on passed in edge
      • createUniqueCopyOf

        public LinkSegment createUniqueCopyOf​(LinkSegment linkSegmentToCopy,
                                              DirectedEdge parentEdge)
        Create a unique copy of the passed in edge segment. All members are copied as is, except for its ids which are created uniquely created so it remains identifiable, also the parent edge is updated if required
        Specified by:
        createUniqueCopyOf in interface DirectedGraphBuilder<Node,​Link,​LinkSegment>
        Parameters:
        linkSegmentToCopy - edge segment to copy
        parentEdge - use this as the new parent edge
        Returns:
        created copy