Package org.planit.graph
Class DirectedGraphImpl<V extends DirectedVertex,E extends DirectedEdge,ES extends EdgeSegment>
- java.lang.Object
-
- org.planit.graph.GraphImpl<V,E>
-
- org.planit.graph.DirectedGraphImpl<V,E,ES>
-
- All Implemented Interfaces:
GraphModifier<V,E>,DirectedGraph<V,E,ES>,Graph<V,E>
public class DirectedGraphImpl<V extends DirectedVertex,E extends DirectedEdge,ES extends EdgeSegment> extends GraphImpl<V,E> implements DirectedGraph<V,E,ES>
A graph implementation consisting of vertices and edges- Author:
- markr
-
-
Field Summary
Fields Modifier and Type Field Description protected EdgeSegments<ES>edgeSegmentsclass instance containing all edge segments-
Fields inherited from class org.planit.graph.GraphImpl
edges, graphBuilder, vertices
-
-
Constructor Summary
Constructors Constructor Description DirectedGraphImpl(IdGroupingToken groupToken, DirectedGraphBuilder<V,E,ES> graphBuilder)DirectedGraph Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<Long,Set<E>>breakEdgesAt(List<? extends E> edgesToBreak, V vertexToBreakAt)Identical to theGraphImplimplementation except that we now also account for the edge segments present on the edge.EdgeSegments<ES>getEdgeSegments()Collect edges segments of graphvoidrecreateIds()Identical to GraphImpl.recreateIds() except that now the ids of the edge segments are also recreated on top of the vertices and edgesvoidremoveSubGraph(Set<? extends V> subNetworkToRemove, boolean recreateIds)remove the subgraph identified by the passed in vertices-
Methods inherited from class org.planit.graph.GraphImpl
getEdges, getGraphIdGroupingToken, getId, getVertices, processSubNetworkVertex, removeDanglingSubGraphs, removeSubGraphOf
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.planit.utils.graph.DirectedGraph
transformGeometries, validate
-
Methods inherited from interface org.planit.utils.graph.Graph
getEdges, getId, getVertices
-
Methods inherited from interface org.planit.graph.GraphModifier
removeDanglingSubGraphs
-
-
-
-
Field Detail
-
edgeSegments
protected final EdgeSegments<ES extends EdgeSegment> edgeSegments
class instance containing all edge segments
-
-
Constructor Detail
-
DirectedGraphImpl
public DirectedGraphImpl(IdGroupingToken groupToken, DirectedGraphBuilder<V,E,ES> graphBuilder)
DirectedGraph Constructor- Parameters:
groupToken- contiguous id generation within this group for instances of this classgraphBuilder- the builder to be used to create this network
-
-
Method Detail
-
getEdgeSegments
public EdgeSegments<ES> getEdgeSegments()
Collect edges segments of graph- Specified by:
getEdgeSegmentsin interfaceDirectedGraph<V extends DirectedVertex,E extends DirectedEdge,ES extends EdgeSegment>- Returns:
- edges segments
-
removeSubGraph
public void removeSubGraph(Set<? extends V> subNetworkToRemove, boolean recreateIds)
remove the subgraph identified by the passed in vertices- Specified by:
removeSubGraphin interfaceGraphModifier<V extends DirectedVertex,E extends DirectedEdge>- Overrides:
removeSubGraphin classGraphImpl<V extends DirectedVertex,E extends DirectedEdge>- Parameters:
subNetworkToRemove- the one to removerecreateIds- indicate if the ids of the graph entities are to be recreated, if false gaps will occur so it is expected to be handled by the user afterwards in this case
-
recreateIds
public void recreateIds()
Identical to GraphImpl.recreateIds() except that now the ids of the edge segments are also recreated on top of the vertices and edges- Specified by:
recreateIdsin interfaceGraphModifier<V extends DirectedVertex,E extends DirectedEdge>- Overrides:
recreateIdsin classGraphImpl<V extends DirectedVertex,E extends DirectedEdge>
-
breakEdgesAt
public Map<Long,Set<E>> breakEdgesAt(List<? extends E> edgesToBreak, V vertexToBreakAt) throws PlanItException
Identical to theGraphImplimplementation except that we now also account for the edge segments present on the edge. Copies of the original edge segments are placed on (vertexToBreakAt,vertexB), while the original ones are retained at (vertexA,vertexToBreakAt)- Specified by:
breakEdgesAtin interfaceGraphModifier<V extends DirectedVertex,E extends DirectedEdge>- Overrides:
breakEdgesAtin classGraphImpl<V extends DirectedVertex,E extends DirectedEdge>- Parameters:
edgesToBreak- edges to breakvertexToBreakAt- the vertex to break at- Returns:
- affected edges of breaking the passed in edges, includes the newly created edges and modified existing edges
- Throws:
PlanItException- thrown if error
-
-