public class Graph extends Object
Constructor and Description |
---|
Graph()
Empty constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
addEdge(Edge e)
Add edge to the graph.
|
boolean |
addVertex(Vertex v)
Add vertex to the graph.
|
Graph |
clone() |
ArrayList<Edge> |
getEdges()
Get list of edges in the graph.
|
Vertex |
getRoot()
Get root vertex.
|
ArrayList<Vertex> |
getVertices()
Get list of vertices in the graph.
|
public boolean addEdge(Edge e)
e
- edge to be addedpublic boolean addVertex(Vertex v)
v
- vertex to be addedpublic ArrayList<Vertex> getVertices()
public ArrayList<Edge> getEdges()
public Vertex getRoot()
Copyright © 2015–2021 Fiji. All rights reserved.