T - type of the node's lablepublic class DigraphNode<T> extends Object
| Modifier and Type | Method and Description |
|---|---|
void |
addEdge(DigraphNode<T> to)
adds an edge from this node to another node
|
boolean |
equals(Object obj) |
Collection<DigraphNode<T>> |
getChildren()
a child is a node n, that has an edge leading from this node to n
|
DigraphNode<T> |
getParent()
a parent is a node n, that has an edge leading from n to this node
|
Collection<DigraphNode<T>> |
getParents()
a parent is a node n, that has an edge leading from n to this node
|
T |
getValue() |
int |
hashCode() |
int |
inDegree() |
boolean |
isLeaf()
leafs have an outdegree of 0
|
boolean |
isRoot()
roots have an indegree of 0
|
int |
outDegree() |
String |
toString() |
public int inDegree()
public int outDegree()
public T getValue()
public Collection<DigraphNode<T>> getParents()
public DigraphNode<T> getParent()
public Collection<DigraphNode<T>> getChildren()
public void addEdge(DigraphNode<T> to)
to - the node the adge points topublic boolean isRoot()
public boolean isLeaf()
Copyright © 2018. All rights reserved.