javatools.datatypes
Class DirectedGraph.Node<E extends java.lang.Comparable<E>>

java.lang.Object
  extended by javatools.datatypes.DirectedGraph.Node<E>
All Implemented Interfaces:
java.lang.Comparable<DirectedGraph.Node<E>>
Enclosing class:
DirectedGraph<E extends java.lang.Comparable<E>>

public static class DirectedGraph.Node<E extends java.lang.Comparable<E>>
extends java.lang.Object
implements java.lang.Comparable<DirectedGraph.Node<E>>

Represents a node of in a graph


Method Summary
 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
 java.util.SortedSet<DirectedGraph.Node<E>> ancestors()
          Computes the ancestors of this node
 java.util.Set<DirectedGraph.Node<E>> children()
          Returns the children
 int compareTo(DirectedGraph.Node<E> arg0)
           
 java.util.Set<DirectedGraph.Node<E>> descendants()
          Computes the ancestors of this node
 boolean equals(java.lang.Object o)
           
 int hashCode()
           
 E label()
          Returns the label
 java.util.Set<DirectedGraph.Node<E>> links()
          returns the links in an undirected graph
 java.util.Set<DirectedGraph.Node<E>> parents()
          Returns the parents
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

addChild

public void addChild(DirectedGraph.Node<E> child)
Adds a child


addParent

public void addParent(DirectedGraph.Node<E> parent)
Adds a parents


addLink

public void addLink(DirectedGraph.Node<E> node)
Adds a node in an undirected graph


links

public java.util.Set<DirectedGraph.Node<E>> links()
returns the links in an undirected graph


children

public java.util.Set<DirectedGraph.Node<E>> children()
Returns the children


parents

public java.util.Set<DirectedGraph.Node<E>> parents()
Returns the parents


hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

ancestors

public java.util.SortedSet<DirectedGraph.Node<E>> ancestors()
Computes the ancestors of this node


descendants

public java.util.Set<DirectedGraph.Node<E>> descendants()
Computes the ancestors of this node


compareTo

public int compareTo(DirectedGraph.Node<E> arg0)
Specified by:
compareTo in interface java.lang.Comparable<DirectedGraph.Node<E extends java.lang.Comparable<E>>>

label

public E label()
Returns the label