public class DAG extends Object implements Cloneable, Serializable
Constructor and Description |
---|
DAG() |
Modifier and Type | Method and Description |
---|---|
void |
addEdge(String from,
String to) |
void |
addEdge(Vertex from,
Vertex to) |
Vertex |
addVertex(String label)
Adds vertex to DAG.
|
Object |
clone() |
List<String> |
getChildLabels(String label) |
Set<String> |
getLabels() |
List<String> |
getParentLabels(String label) |
List<String> |
getSuccessorLabels(String label)
Return the list of labels of successor in order decided by topological sort
|
Vertex |
getVertex(String label) |
List<Vertex> |
getVerticies() |
boolean |
hasEdge(String label1,
String label2) |
boolean |
isConnected(String label)
Indicates if there is at least one edge leading to or from vertex of given label
|
void |
removeEdge(String from,
String to) |
void |
removeEdge(Vertex from,
Vertex to) |
public Vertex addVertex(String label)
label
- The lable of the Vertexpublic void addEdge(String from, String to) throws CycleDetectedException
CycleDetectedException
public void addEdge(Vertex from, Vertex to) throws CycleDetectedException
CycleDetectedException
public Object clone() throws CloneNotSupportedException
clone
in class Object
CloneNotSupportedException
Object.clone()
public boolean isConnected(String label)
true if this vertex is connected with other vertex,false
otherwise
public List<String> getSuccessorLabels(String label)
label
- The label of the vertex whose predessors are serchedCopyright © 2001–2016 Codehaus Plexus. All rights reserved.