public static class DirectedGraph.Node<E extends Comparable<E>> extends Object implements Comparable<DirectedGraph.Node<E>>
| Modifier and Type | Field and Description |
|---|---|
protected SortedSet<DirectedGraph.Node<E>> |
children
Points to the children of thise node
|
protected E |
label
Holds the label of node
|
protected SortedSet<DirectedGraph.Node<E>> |
parents
Points to the parents of this node
|
| Modifier | Constructor and Description |
|---|---|
protected |
Node(E l,
boolean directed)
Created a node with a label -- in a directed or undirected graph
|
| Modifier and Type | Method and Description |
|---|---|
void |
addChild(DirectedGraph.Node<E> child)
Adds a child
|
void |
addLink(DirectedGraph.Node<E> node)
Adds a node in an undirected graph
|
void |
addParent(DirectedGraph.Node<E> parent)
Adds a parents
|
SortedSet<DirectedGraph.Node<E>> |
ancestors()
Computes the ancestors of this node
|
protected void |
ancestors(Set<DirectedGraph.Node<E>> ancestors)
Helper method
|
Set<DirectedGraph.Node<E>> |
children()
Returns the children
|
protected void |
closure(Set<DirectedGraph.Node<E>> ancestors)
Helper for Graph.makeClosure
|
int |
compareTo(DirectedGraph.Node<E> arg0) |
Set<DirectedGraph.Node<E>> |
descendants()
Computes the ancestors of this node
|
protected void |
descendants(Set<DirectedGraph.Node<E>> descendants)
Helper method
|
boolean |
equals(Object o) |
int |
hashCode() |
E |
label()
Returns the label
|
Set<DirectedGraph.Node<E>> |
links()
returns the links in an undirected graph
|
Set<DirectedGraph.Node<E>> |
parents()
Returns the parents
|
String |
toString() |
protected SortedSet<DirectedGraph.Node<E extends Comparable<E>>> parents
protected SortedSet<DirectedGraph.Node<E extends Comparable<E>>> children
protected E extends Comparable<E> label
protected Node(E l, boolean directed)
public void addChild(DirectedGraph.Node<E> child)
public void addParent(DirectedGraph.Node<E> parent)
public void addLink(DirectedGraph.Node<E> node)
public Set<DirectedGraph.Node<E>> links()
public Set<DirectedGraph.Node<E>> children()
public Set<DirectedGraph.Node<E>> parents()
protected void closure(Set<DirectedGraph.Node<E>> ancestors)
public SortedSet<DirectedGraph.Node<E>> ancestors()
protected void ancestors(Set<DirectedGraph.Node<E>> ancestors)
public Set<DirectedGraph.Node<E>> descendants()
protected void descendants(Set<DirectedGraph.Node<E>> descendants)
public int compareTo(DirectedGraph.Node<E> arg0)
compareTo in interface Comparable<DirectedGraph.Node<E extends Comparable<E>>>public E label()
Copyright © 2018. All rights reserved.