public class SparseTree extends SparseGraph implements DirectedGraph
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.
DirectedSparseVertex,
DirectedSparseEdgeAbstractArchetypeGraph.RequirementsUserDataContainer.CopyAction| Modifier and Type | Field and Description |
|---|---|
static java.lang.Object |
IN_TREE_KEY |
protected Vertex |
mRoot |
static java.lang.Object |
SPARSE_ROOT_KEY |
mEdges, mVerticesedge_requirements, mEdgeIDs, mGraphListenerHandler, mVertexIDs, vertex_requirementsfactory, udc_delegateDIRECTED_EDGE, NOT_PARALLEL_EDGE, SIMPLE_EDGE, UNDIRECTED_EDGESUBSET_MANAGER| Constructor and Description |
|---|
SparseTree(Vertex root) |
| Modifier and Type | Method and Description |
|---|---|
Edge |
addEdge(Edge e)
Adds
e to this graph, and returns a reference to the
added vertex. |
Vertex |
getRoot() |
addVertex, getEdges, getVertices, initialize, isDirected, removeEdge, removeEdges, removeVertex, removeVerticesaddAllNotInitializers, addListener, checkConstraints, copy, getEdgeConstraints, getVertexConstraints, listenersExist, newInstance, numEdges, numVertices, removeAllEdges, removeAllVertices, removeListener, toStringaddUserDatum, clone, containsUserDatumKey, getUserDatum, getUserDatumCopyAction, getUserDatumKeyIterator, importUserData, removeUserDatum, setUserDataFactory, setUserDatumequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddVertex, isDirected, removeEdge, removeVertexaddListener, copy, getEdgeConstraints, getEdges, getVertexConstraints, getVertices, newInstance, numEdges, numVertices, removeAllEdges, removeAllVertices, removeEdges, removeListener, removeVerticesaddUserDatum, clone, containsUserDatumKey, getUserDatum, getUserDatumCopyAction, getUserDatumKeyIterator, importUserData, removeUserDatum, setUserDatumprotected Vertex mRoot
public static final java.lang.Object SPARSE_ROOT_KEY
public static final java.lang.Object IN_TREE_KEY
public SparseTree(Vertex root)
root - public Vertex getRoot()
public Edge addEdge(Edge e)
Graphe to this graph, and returns a reference to the
added vertex.addEdge in interface GraphaddEdge in class AbstractSparseGraphe - the edge to be addedGraph.addEdge(edu.uci.ics.jung.graph.Edge)