V - type of vertexE - type of edgepublic class Graph<V,E> extends Object
| 构造器和说明 |
|---|
Graph()
Create a empty graph
|
| 限定符和类型 | 方法和说明 |
|---|---|
void |
add(E edge,
V start,
V end)
Added a edge
|
Graph<V,E> |
clone() |
E |
get(V start,
V end)
Get a edge that link two given vertexes
|
Iterator<Graph<V,E>> |
getComponents() |
Set<E> |
getEdges() |
Set<E> |
getEdges(V vertex) |
V |
getEnd(E edge) |
V |
getStart(E edge) |
Set<V> |
getVertexs() |
void |
merge(E replacement,
E replace0,
E replace1,
V vertex)
Merge two edge into one
|
void |
remove(E edge)
Remove a edge
|
String |
toString() |
static String |
toString(Graph<Junction,Segment> graph) |
static BufferedImage |
visualize(Graph<Junction,Segment> graph,
int width,
int height) |
public void add(E edge, V start, V end)
edge - the edgestart - the start vertexend - the end vertexpublic void remove(E edge)
edge - to be removedpublic E get(V start, V end)
start - a vertexend - another vertexpublic void merge(E replacement, E replace0, E replace1, V vertex)
replacement - new edgereplace0 - to be replacedreplace1 - to be replacedvertex - the vertex between two edgespublic static BufferedImage visualize(Graph<Junction,Segment> graph, int width, int height)
Copyright © 2019. All rights reserved.