Interface GraphBuilder<V extends Vertex,​E extends Edge>

    • Method Detail

      • createVertex

        V createVertex()
        Create a new vertex instance
        Returns:
        created vertex
      • createEdge

        E createEdge​(Vertex vertexA,
                     Vertex vertexB,
                     double length)
              throws PlanItException
        Create a new link instance
        Parameters:
        vertexA - the first vertex in this edge
        vertexB - the second vertex in this edge
        length - the length (in km)
        Returns:
        created edge
        Throws:
        PlanItException - thrown if there is an error
      • setIdGroupingToken

        void setIdGroupingToken​(IdGroupingToken groupId)
        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
        Parameters:
        groupId - , contiguous id generation within this group for instances created with the factory methods
      • getIdGroupingToken

        IdGroupingToken getIdGroupingToken()
        Collect the id grouping token used by this builder
        Returns:
        idGroupingToken the id grouping token used by this builder
      • recreateIds

        void recreateIds​(Edges<? extends E> edges)
        recreate the ids for all passed in edges
        Parameters:
        edges - to recreate ids for
      • recreateIds

        void recreateIds​(Vertices<? extends V> vertices)
        recreate the ids for all passed in vertices
        Parameters:
        vertices - to recreate ids for
      • createUniqueCopyOf

        E createUniqueCopyOf​(E edgeToCopy)
        create a shallo copy of the passed in edge, albeit with unique internal ids
        Parameters:
        edgeToCopy - the edge to copy
        Returns:
        new edge based on passed in edge