Package org.planit.graph
Interface GraphBuilder<V extends Vertex,E extends Edge>
-
- All Known Subinterfaces:
DirectedGraphBuilder<V,E,ES>,MacroscopicPhysicalNetworkBuilder<N,L,MLS>,PhysicalNetworkBuilder<N,L,LS>
- All Known Implementing Classes:
DirectedGraphBuilderImpl,GraphBuilderImpl,MacroscopicPhysicalNetworkBuilderImpl,PhysicalNetworkBuilderImpl
public interface GraphBuilder<V extends Vertex,E extends Edge>Build network elements based on chosen network view. Implementations are registered on the network class which uses it to construct network elements- Author:
- markr
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description EcreateEdge(Vertex vertexA, Vertex vertexB, double length)Create a new link instanceEcreateUniqueCopyOf(E edgeToCopy)create a shallo copy of the passed in edge, albeit with unique internal idsVcreateVertex()Create a new vertex instanceIdGroupingTokengetIdGroupingToken()Collect the id grouping token used by this buildervoidrecreateIds(Edges<? extends E> edges)recreate the ids for all passed in edgesvoidrecreateIds(Vertices<? extends V> vertices)recreate the ids for all passed in verticesvoidsetIdGroupingToken(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
-
-
-
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 edgevertexB- the second vertex in this edgelength- 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
-
-