org.codehaus.plexus.util.dag
Class DAG
java.lang.Object
org.codehaus.plexus.util.dag.DAG
- Cloneable, Serializable
public class DAG
extends java.lang.Object
implements Cloneable, Serializable
DAG = Directed Acyclic Graph
$Id: DAG.java 2659 2005-10-11 17:30:25Z brett $private List | vertexList - Conatin list of all verticies
|
private Map | vertexMap - Maps vertex's label to vertex
|
vertexList
private List vertexList
Conatin list of all verticies
vertexMap
private Map vertexMap
Maps vertex's label to vertex
addVertex
public Vertex addVertex(String label)
Adds vertex to DAG. If vertex of given label alredy exist in DAG
no vertex is added
label
- The lable of the Vertex
- New vertex if vertext of given label was not presenst in the DAG
or exising vertex if vertex of given labale was alredy added to DAG
clone
public Object clone()
throws CloneNotSupportedException
getChildLabels
public List getChildLabels(String label)
getLabels
public Set getLabels()
getParentLabels
public List getParentLabels(String label)
getSuccessorLabels
public List getSuccessorLabels(String label)
Return the list of labels of successor in order decided by topological sort
label
- The label of the vertex whose predessors are serched
- 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.
getVertex
public Vertex getVertex(String label)
getVerticies
public List getVerticies()
hasEdge
public boolean hasEdge(String label1,
String label2)
isConnected
public boolean isConnected(String label)
Indicates if there is at least one edge leading to or from vertex of given label
true if this vertex is connected with other vertex,
false
otherwise
removeEdge
public void removeEdge(String from,
String to)