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> |
getVertices() |
List<Vertex> |
getVerticies()
Deprecated.
instead use
getVertices() |
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) |
@Deprecated public List<Vertex> getVerticies()
getVertices()public Vertex addVertex(String label)
label - The label of the Vertexpublic void addEdge(String from, String to) throws CycleDetectedException
CycleDetectedExceptionpublic void addEdge(Vertex from, Vertex to) throws CycleDetectedException
CycleDetectedExceptionpublic List<String> getChildLabels(String label)
label - see namepublic List<String> getParentLabels(String label)
label - see namepublic Object clone() throws CloneNotSupportedException
clone in class ObjectCloneNotSupportedExceptionObject.clone()public boolean isConnected(String label)
label - the labeltrue if this vertex is connected with other vertex,false otherwisepublic List<String> getSuccessorLabels(String label)
label - The label of the vertex whose predecessors are searchedCopyright © 2001–2022 The Apache Software Foundation. All rights reserved.