|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javatools.datatypes.DirectedGraph<E>
public class DirectedGraph<E extends java.lang.Comparable<E>>
This class is part of the Java Tools (see http://mpii.de/yago-naga/javatools). It is licensed under the Creative Commons Attribution License (see http://creativecommons.org/licenses/by/3.0) by the YAGO-NAGA team (see http://mpii.de/yago-naga). This class implements a directed Graph.
Nested Class Summary | |
---|---|
static class |
DirectedGraph.Node<E extends java.lang.Comparable<E>>
Represents a node of in a graph |
Constructor Summary | |
---|---|
DirectedGraph()
Constructor for subclasses |
Method Summary | |
---|---|
void |
addLink(E parent,
E child)
Adds a link from a parent to a child |
boolean |
contains(E label)
True if that node exists |
static DirectedGraph<java.lang.String> |
create(java.io.File file,
java.util.regex.Pattern pattern)
Constructs a directed graph from a File. |
DirectedGraph.Node<E> |
get(E label)
Returns the node with the given label (or null) |
DirectedGraph.Node<E> |
getOrMake(E label)
Returns or creates a node |
java.util.Collection<E> |
labels()
Computes the set of labels |
java.util.SortedSet<DirectedGraph.Node<E>> |
leaves()
Computes the nodes that have no leaves |
void |
makeClosure()
Adds all transitive links |
java.util.Collection<DirectedGraph.Node<E>> |
nodes()
Returns all nodes |
int |
numNodes()
Returns the number of nodes |
java.util.SortedSet<DirectedGraph.Node<E>> |
roots()
Computes the nodes that have no parents |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public DirectedGraph()
Method Detail |
---|
public void addLink(E parent, E child)
public DirectedGraph.Node<E> getOrMake(E label)
public static DirectedGraph<java.lang.String> create(java.io.File file, java.util.regex.Pattern pattern) throws java.io.IOException
java.io.IOException
public java.lang.String toString()
toString
in class java.lang.Object
public java.util.SortedSet<DirectedGraph.Node<E>> roots()
public java.util.SortedSet<DirectedGraph.Node<E>> leaves()
public java.util.Collection<DirectedGraph.Node<E>> nodes()
public int numNodes()
public java.util.Collection<E> labels()
public DirectedGraph.Node<E> get(E label)
public boolean contains(E label)
public void makeClosure()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |