public class Vertex
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable
Modifier and Type | Field and Description |
---|---|
(package private) java.util.List<Vertex> |
children |
private java.lang.String |
label |
(package private) java.util.List<Vertex> |
parents |
Constructor and Description |
---|
Vertex(java.lang.String label) |
Modifier and Type | Method and Description |
---|---|
void |
addEdgeFrom(Vertex vertex) |
void |
addEdgeTo(Vertex vertex) |
java.lang.Object |
clone() |
java.util.List<java.lang.String> |
getChildLabels()
Get the labels used by the most direct children.
|
java.util.List<Vertex> |
getChildren() |
java.lang.String |
getLabel() |
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).
|
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) |
java.lang.String |
toString() |
private java.lang.String label
java.util.List<Vertex> children
java.util.List<Vertex> parents
public java.lang.String getLabel()
public void addEdgeTo(Vertex vertex)
vertex
- public void removeEdgeTo(Vertex vertex)
vertex
- public void addEdgeFrom(Vertex vertex)
vertex
- public void removeEdgeFrom(Vertex vertex)
public java.util.List<Vertex> getChildren()
public java.util.List<java.lang.String> getChildLabels()
public java.util.List<Vertex> getParents()
public java.util.List<java.lang.String> getParentLabels()
public boolean isLeaf()
true
if this vertex has no child, false
otherwisepublic boolean isRoot()
true
if this vertex has no parent, false
otherwisepublic boolean isConnected()
true
if this vertex is connected with other vertex,false
otherwisepublic java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
public java.lang.String toString()
toString
in class java.lang.Object