org.codehaus.plexus.util.dag

Class Vertex

Implemented Interfaces:
Cloneable, Serializable

public class Vertex
extends java.lang.Object
implements Cloneable, Serializable

Version:
$Id: Vertex.java 1106 2004-10-07 19:29:57Z jdcasey $
Author:
Michal Maczka

Field Summary

(package private) List
children
private String
label
(package private) List
parents

Constructor Summary

Vertex(String label)

Method Summary

void
addEdgeFrom(Vertex vertex)
void
addEdgeTo(Vertex vertex)
Object
clone()
List
getChildLabels()
Get the labels used by the most direct children.
List
getChildren()
String
getLabel()
List
getParentLabels()
Get the labels used by the most direct ancestors (parents).
List
getParents()
Get the list the most direct ancestors (parents).
boolean
isConnected()
Indicates if there is at least one edee leading to or from given vertex
boolean
isLeaf()
Indicates if given vertex has no child
boolean
isRoot()
Indicates if given vertex has no parent
void
removeEdgeFrom(Vertex vertex)
void
removeEdgeTo(Vertex vertex)
String
toString()

Field Details

children

(package private)  List children

label

private String label

parents

(package private)  List parents

Constructor Details

Vertex

public Vertex(String label)

Method Details

addEdgeFrom

public void addEdgeFrom(Vertex vertex)
Parameters:
vertex -

addEdgeTo

public void addEdgeTo(Vertex vertex)
Parameters:
vertex -

clone

public Object clone()
            throws CloneNotSupportedException

getChildLabels

public List getChildLabels()
Get the labels used by the most direct children.
Returns:
the labels used by the most direct children.

getChildren

public List getChildren()

getLabel

public String getLabel()
Returns:

getParentLabels

public List getParentLabels()
Get the labels used by the most direct ancestors (parents).
Returns:
the labels used parents

getParents

public List getParents()
Get the list the most direct ancestors (parents).
Returns:
list of parents

isConnected

public boolean isConnected()
Indicates if there is at least one edee leading to or from given vertex
Returns:
true if this vertex is connected with other vertex,false otherwise

isLeaf

public boolean isLeaf()
Indicates if given vertex has no child
Returns:
true if this vertex has no child, false otherwise

isRoot

public boolean isRoot()
Indicates if given vertex has no parent
Returns:
true if this vertex has no parent, false otherwise

removeEdgeFrom

public void removeEdgeFrom(Vertex vertex)

removeEdgeTo

public void removeEdgeTo(Vertex vertex)
Parameters:
vertex -

toString

public String toString()