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
CycleDetectedExceptionpublic void addEdge(Vertex from, Vertex to) throws CycleDetectedException
CycleDetectedExceptionpublic Object clone() throws CloneNotSupportedException
clone in class ObjectCloneNotSupportedExceptionObject.clone()public boolean isConnected(String label)
true if this vertex is connected with other vertex,false otherwisepublic List<String> getSuccessorLabels(String label)
label - The label of the vertex whose predessors are serchedCopyright © 2001-2014 Codehaus. All Rights Reserved.