Package org.codehaus.plexus.util.dag
Class Vertex
- java.lang.Object
-
- org.codehaus.plexus.util.dag.Vertex
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable
public class Vertex extends java.lang.Object implements java.lang.Cloneable, java.io.Serializable- Author:
- Michal Maczka
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Vertex(java.lang.String label)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddEdgeFrom(Vertex vertex)voidaddEdgeTo(Vertex vertex)java.lang.Objectclone()java.util.List<java.lang.String>getChildLabels()Get the labels used by the most direct children.java.util.List<Vertex>getChildren()java.lang.StringgetLabel()java.util.List<java.lang.String>getParentLabels()Get the labels used by the most direct ancestors (parents).java.util.List<Vertex>getParents()Get the list the most direct ancestors (parents).booleanisConnected()Indicates if there is at least one edee leading to or from given vertexbooleanisLeaf()Indicates if given vertex has no childbooleanisRoot()Indicates if given vertex has no parentvoidremoveEdgeFrom(Vertex vertex)voidremoveEdgeTo(Vertex vertex)java.lang.StringtoString()
-
-
-
Method Detail
-
getLabel
public java.lang.String getLabel()
-
addEdgeTo
public void addEdgeTo(Vertex vertex)
-
removeEdgeTo
public void removeEdgeTo(Vertex vertex)
-
addEdgeFrom
public void addEdgeFrom(Vertex vertex)
-
removeEdgeFrom
public void removeEdgeFrom(Vertex vertex)
-
getChildren
public java.util.List<Vertex> getChildren()
-
getChildLabels
public java.util.List<java.lang.String> getChildLabels()
Get the labels used by the most direct children.- Returns:
- the labels used by the most direct children.
-
getParents
public java.util.List<Vertex> getParents()
Get the list the most direct ancestors (parents).- Returns:
- list of parents
-
getParentLabels
public java.util.List<java.lang.String> getParentLabels()
Get the labels used by the most direct ancestors (parents).- Returns:
- the labels used parents
-
isLeaf
public boolean isLeaf()
Indicates if given vertex has no child- Returns:
trueif this vertex has no child,falseotherwise
-
isRoot
public boolean isRoot()
Indicates if given vertex has no parent- Returns:
trueif this vertex has no parent,falseotherwise
-
isConnected
public boolean isConnected()
Indicates if there is at least one edee leading to or from given vertex- Returns:
trueif this vertex is connected with other vertex,falseotherwise
-
clone
public java.lang.Object clone() throws java.lang.CloneNotSupportedException- Overrides:
clonein classjava.lang.Object- Throws:
java.lang.CloneNotSupportedException
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-