Package org.codehaus.plexus.util.dag
Class DAG
java.lang.Object
org.codehaus.plexus.util.dag.DAG
- All Implemented Interfaces:
Serializable
,Cloneable
DAG = Directed Acyclic Graph
- Author:
- Michal Maczka TODO this class should be renamed from DAG to Dag
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
void
Adds vertex to DAG.clone()
getChildLabels
(String label) getParentLabels
(String label) getSuccessorLabels
(String label) Return the list of labels of successor in order decided by topological sortDeprecated.boolean
boolean
isConnected
(String label) Indicates if there is at least one edge leading to or from vertex of given labelvoid
removeEdge
(String from, String to) void
removeEdge
(Vertex from, Vertex to)
-
Constructor Details
-
DAG
public DAG()
-
-
Method Details
-
getVertices
- Returns:
- the vertices
-
getVerticies
Deprecated.instead usegetVertices()
- Returns:
- the vertices
-
getLabels
-
addVertex
Adds vertex to DAG. If vertex of given label already exist in DAG no vertex is added- Parameters:
label
- The label of the Vertex- Returns:
- New vertex if vertex of given label was not present in the DAG or existing vertex if vertex of given label was already added to DAG
-
addEdge
- Throws:
CycleDetectedException
-
addEdge
- Throws:
CycleDetectedException
-
removeEdge
-
removeEdge
-
getVertex
-
hasEdge
-
getChildLabels
- Parameters:
label
- see name- Returns:
- the childs
-
getParentLabels
- Parameters:
label
- see name- Returns:
- the parents
-
clone
- Overrides:
clone
in classObject
- Throws:
CloneNotSupportedException
- See Also:
-
isConnected
Indicates if there is at least one edge leading to or from vertex of given label- Parameters:
label
- the label- Returns:
true
if this vertex is connected with other vertex,false
otherwise
-
getSuccessorLabels
Return the list of labels of successor in order decided by topological sort- Parameters:
label
- The label of the vertex whose predecessors are searched- Returns:
- The list of labels. Returned list contains also the label passed as parameter to this method. This label should always be the last item in the list.
-
getVertices()