类 Graph<V,E>
- java.lang.Object
-
- cc.chungkwong.mathocr.offline.extractor.tracer.Graph<V,E>
-
- 类型参数:
V- type of vertexE- type of edge
public class Graph<V,E> extends Object
Graph- 作者:
- Chan Chung Kwong
-
-
构造器概要
构造器 构造器 说明 Graph()Create a empty graph
-
方法概要
所有方法 静态方法 实例方法 具体方法 修饰符和类型 方法 说明 voidadd(E edge, V start, V end)Added a edgeGraph<V,E>clone()Eget(V start, V end)Get a edge that link two given vertexesIterator<Graph<V,E>>getComponents()Set<E>getEdges()Set<E>getEdges(V vertex)VgetEnd(E edge)VgetStart(E edge)Set<V>getVertexs()voidmerge(E replacement, E replace0, E replace1, V vertex)Merge two edge into onevoidremove(E edge)Remove a edgeStringtoString()static StringtoString(Graph<Junction,Segment> graph)static BufferedImagevisualize(Graph<Junction,Segment> graph, int width, int height)
-
-
-
方法详细资料
-
add
public void add(E edge, V start, V end)
Added a edge- 参数:
edge- the edgestart- the start vertexend- the end vertex
-
remove
public void remove(E edge)
Remove a edge- 参数:
edge- to be removed
-
get
public E get(V start, V end)
Get a edge that link two given vertexes- 参数:
start- a vertexend- another vertex- 返回:
- the edge or null
-
merge
public void merge(E replacement, E replace0, E replace1, V vertex)
Merge two edge into one- 参数:
replacement- new edgereplace0- to be replacedreplace1- to be replacedvertex- the vertex between two edges
-
visualize
public static BufferedImage visualize(Graph<Junction,Segment> graph, int width, int height)
-
-