edu.uci.ics.jung.graph.impl
Class SparseTree
java.lang.Object
edu.uci.ics.jung.utils.UserDataDelegate
edu.uci.ics.jung.graph.impl.AbstractArchetypeGraph
edu.uci.ics.jung.graph.impl.AbstractSparseGraph
edu.uci.ics.jung.graph.impl.SparseGraph
edu.uci.ics.jung.graph.impl.SparseTree
- All Implemented Interfaces:
- ArchetypeGraph, DirectedGraph, Graph, UserDataContainer, Cloneable
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.
Edge constraints imposed by this class: DIRECTED_EDGE,
TreePredicate
, NOT_PARALLEL_EDGE
For additional system and user constraints defined for
this class, see the superclasses of this class.
- Author:
- Danyel Fisher, Joshua O'Madadhain
- See Also:
DirectedSparseVertex
,
DirectedSparseEdge
Methods inherited from class edu.uci.ics.jung.graph.impl.AbstractArchetypeGraph |
addAllNotInitializers, addListener, checkConstraints, copy, getEdgeConstraints, getVertexConstraints, listenersExist, newInstance, numEdges, numVertices, removeAllEdges, removeAllVertices, removeListener, toString |
Methods inherited from interface edu.uci.ics.jung.graph.ArchetypeGraph |
addListener, copy, getEdgeConstraints, getEdges, getVertexConstraints, getVertices, newInstance, numEdges, numVertices, removeAllEdges, removeAllVertices, removeEdges, removeListener, removeVertices |
mRoot
protected Vertex mRoot
SPARSE_ROOT_KEY
public static final Object SPARSE_ROOT_KEY
IN_TREE_KEY
public static final Object IN_TREE_KEY
SparseTree
public SparseTree(Vertex root)
- Parameters:
root
-
getRoot
public Vertex getRoot()
- Returns:
- the root of this tree
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
- Parameters:
e
- the edge to be added- See Also:
Graph.addEdge(edu.uci.ics.jung.graph.Edge)