edu.uci.ics.jung.graph.impl
Class SparseTree

java.lang.Object
  extended byedu.uci.ics.jung.utils.UserData
      extended byedu.uci.ics.jung.graph.impl.AbstractArchetypeGraph
          extended byedu.uci.ics.jung.graph.impl.AbstractSparseGraph
              extended byedu.uci.ics.jung.graph.impl.SparseGraph
                  extended byedu.uci.ics.jung.graph.impl.SparseTree
All Implemented Interfaces:
ArchetypeGraph, java.lang.Cloneable, DirectedGraph, Graph, UserDataContainer

public class SparseTree
extends SparseGraph
implements DirectedGraph

An implementation of Graph that consists of a Vertex set and a DirectedEdge set. Further, a vertex can have no more than one incoming directed edge (enforced with TreePredicate); the tree must define a root vertex at construction time. This implementation does NOT ALLOW parallel edges. SimpleDirectedSparseVertex is the most efficient vertex for this graph type.

Author:
Danyel Fisher, Joshua O'Madadhain
See Also:
DirectedSparseVertex, DirectedSparseEdge

Nested Class Summary
 
Nested classes inherited from class edu.uci.ics.jung.utils.UserDataContainer
UserDataContainer.CopyAction
 
Field Summary
static java.lang.Object IN_TREE_KEY
           
static java.lang.Object SPARSE_ROOT_KEY
           
 
Fields inherited from class edu.uci.ics.jung.utils.UserData
CLONE, REMOVE, SHARED
 
Fields inherited from interface edu.uci.ics.jung.graph.Graph
DIRECTED_EDGE, NOT_PARALLEL_EDGE, SIMPLE_EDGE, UNDIRECTED_EDGE
 
Fields inherited from interface edu.uci.ics.jung.graph.ArchetypeGraph
SUBSET_MANAGER
 
Constructor Summary
SparseTree(Vertex root)
           
 
Method Summary
 Edge addEdge(Edge e)
          Adds e to this graph, and returns a reference to the added vertex.
 Vertex getRoot()
           
 
Methods inherited from class edu.uci.ics.jung.graph.impl.AbstractSparseGraph
addVertex, getEdges, getVertices, isDirected, removeAllEdges, removeAllVertices, removeEdge, removeEdges, removeVertex, removeVertices
 
Methods inherited from class edu.uci.ics.jung.graph.impl.AbstractArchetypeGraph
addListener, copy, getEdgeConstraints, getVertexConstraints, newInstance, numEdges, numVertices, removeListener, toString
 
Methods inherited from class edu.uci.ics.jung.utils.UserData
addUserDatum, containsUserDatumKey, getUserDatum, getUserDatumCopyAction, getUserDatumKeyIterator, importUserData, removeUserDatum, setUserDatum
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface edu.uci.ics.jung.graph.Graph
addVertex, isDirected, removeEdge, removeVertex
 
Methods inherited from interface edu.uci.ics.jung.graph.ArchetypeGraph
addListener, copy, getEdgeConstraints, getEdges, getVertexConstraints, getVertices, newInstance, numEdges, numVertices, removeAllEdges, removeAllVertices, removeEdges, removeListener, removeVertices
 
Methods inherited from interface edu.uci.ics.jung.utils.UserDataContainer
addUserDatum, containsUserDatumKey, getUserDatum, getUserDatumCopyAction, getUserDatumKeyIterator, importUserData, removeUserDatum, setUserDatum
 

Field Detail

SPARSE_ROOT_KEY

public static final java.lang.Object SPARSE_ROOT_KEY

IN_TREE_KEY

public static final java.lang.Object IN_TREE_KEY
Constructor Detail

SparseTree

public SparseTree(Vertex root)
Parameters:
root -
Method Detail

getRoot

public Vertex getRoot()
Returns:

addEdge

public Edge addEdge(Edge e)
Description copied from interface: Graph
Adds e to this graph, and returns a reference to the added vertex.

Specified by:
addEdge in interface Graph
Overrides:
addEdge in class AbstractSparseGraph
See Also:
Graph.addEdge(edu.uci.ics.jung.graph.Edge)