|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.uci.ics.jung.utils.UserDataDelegate
edu.uci.ics.jung.graph.impl.AbstractElement
edu.uci.ics.jung.graph.impl.AbstractArchetypeVertex
edu.uci.ics.jung.graph.impl.AbstractSparseVertex
public abstract class AbstractSparseVertex
This class provides a skeletal implementation of the Vertex
interface to minimize the effort required to implement this interface.
It is appropriate for sparse graphs (those in which each vertex
is connected to only a few other vertices); for dense graphs (those in
which each vertex is connected to most other vertices), another
implementation might be more appropriate.
This class extends UserData, which provides storage and
retrieval mechanisms for user-defined data for each edge instance.
This allows users to attach data to edges without having to extend
this class.
AbstractSparseGraph,
AbstractSparseEdge| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface edu.uci.ics.jung.utils.UserDataContainer |
|---|
UserDataContainer.CopyAction |
| Field Summary |
|---|
| Fields inherited from class edu.uci.ics.jung.graph.impl.AbstractElement |
|---|
id, m_Graph |
| Fields inherited from class edu.uci.ics.jung.utils.UserDataDelegate |
|---|
factory, udc_delegate |
| Constructor Summary | |
|---|---|
protected |
AbstractSparseVertex()
Creates a new instance of a vertex for inclusion in a sparse graph. |
| Method Summary | |
|---|---|
protected abstract void |
addNeighbor_internal(Edge e,
Vertex v)
Adds the specified edge e and vertex v
to the internal data structures of this vertex. |
ArchetypeVertex |
copy(ArchetypeGraph newGraph)
Creates a copy of this vertex in graph g. |
ArchetypeEdge |
findEdge(ArchetypeVertex v)
Returns an edge that connects this vertex to v. |
Edge |
findEdge(Vertex v)
Returns the edge that connects this vertex to the specified vertex v. |
Set |
findEdgeSet(ArchetypeVertex v)
Returns the set of all edges that connect this vertex with the specified vertex v. |
Set |
findEdgeSet(Vertex v)
Returns the set of all edges that connect this vertex with the specified vertex v. |
protected abstract void |
removeNeighbor_internal(Edge e,
Vertex v)
Removes the specified edge e and vertex v
from the internal data structures of this vertex. |
String |
toString()
Returns a human-readable representation of this vertex. |
| Methods inherited from class edu.uci.ics.jung.graph.impl.AbstractArchetypeVertex |
|---|
degree, equals, getEdges_internal, getEqualVertex, getEquivalentVertex, getIncidentEdges, getIncidentElements, getNeighbors_internal, getNeighbors, isIncident, isNeighborOf, numNeighbors |
| Methods inherited from class edu.uci.ics.jung.graph.impl.AbstractElement |
|---|
addGraph_internal, getGraph, hashCode, initialize, removeGraph_internal |
| Methods inherited from class edu.uci.ics.jung.utils.UserDataDelegate |
|---|
addUserDatum, clone, containsUserDatumKey, getUserDatum, getUserDatumCopyAction, getUserDatumKeyIterator, importUserData, removeUserDatum, setUserDataFactory, setUserDatum |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface edu.uci.ics.jung.graph.Vertex |
|---|
getInEdges, getOutEdges, getPredecessors, getSuccessors, inDegree, isDest, isPredecessorOf, isSource, isSuccessorOf, numPredecessors, numSuccessors, outDegree |
| Methods inherited from interface edu.uci.ics.jung.graph.ArchetypeVertex |
|---|
degree, getEqualVertex, getEquivalentVertex, getIncidentEdges, getNeighbors, isIncident, isNeighborOf, numNeighbors |
| Methods inherited from interface edu.uci.ics.jung.graph.Element |
|---|
getGraph, getIncidentElements |
| Methods inherited from interface edu.uci.ics.jung.utils.UserDataContainer |
|---|
addUserDatum, clone, containsUserDatumKey, getUserDatum, getUserDatumCopyAction, getUserDatumKeyIterator, importUserData, removeUserDatum, setUserDatum |
| Constructor Detail |
|---|
protected AbstractSparseVertex()
AbstractElement.initialize()| Method Detail |
|---|
public Edge findEdge(Vertex v)
v. This is a
simple implementation which checks the opposite vertex of
each outgoing edge of this vertex; this solution is general,
but not efficient.
findEdge in interface VertexVertex.findEdge(Vertex)public ArchetypeEdge findEdge(ArchetypeVertex v)
ArchetypeVertexv.
If this edge is not uniquely
defined (that is, if the graph contains more than one edge connecting
this vertex to v), any of these edges
v may be returned. findEdgeSet(v) may be
used to return all such edges.
If v is not connected to this vertex, returns
null.
findEdge in interface ArchetypeVertexfindEdge in class AbstractArchetypeVertexArchetypeVertex.findEdge(edu.uci.ics.jung.graph.ArchetypeVertex)public Set findEdgeSet(Vertex v)
Vertexv. Each edge in this set
will be either a directed outgoing edge from this vertex to
v, or an undirected edge connecting this vertex to
v. findEdge(v) may be used to return
a single (arbitrary) element of this set.
If v
is not connected to this vertex, returns an empty Set.
findEdgeSet in interface VertexVertex.findEdgeSet(Vertex)public Set findEdgeSet(ArchetypeVertex v)
ArchetypeVertexv.
findEdge(v) may be used to return
a single (arbitrary) element of this set.
If v
is not connected to this vertex, returns an empty Set.
findEdgeSet in interface ArchetypeVertexfindEdgeSet in class AbstractArchetypeVertexArchetypeVertex.findEdgeSet(ArchetypeVertex)public ArchetypeVertex copy(ArchetypeGraph newGraph)
ArchetypeVertexg. The vertex
created will be equivalent to this vertex: given
v = this.copy(g), then
this.getEquivalentVertex(g) == v, and
this.equals(v) == true.
copy in interface ArchetypeVertexcopy in class AbstractArchetypeVertexnewGraph - the graph in which the copied vertex will be placed
ArchetypeVertex.copy(ArchetypeGraph)
protected abstract void addNeighbor_internal(Edge e,
Vertex v)
e and vertex v
to the internal data structures of this vertex.
e - the new incident edge of this vertexv - the new neighbor of this vertex
protected abstract void removeNeighbor_internal(Edge e,
Vertex v)
e and vertex v
from the internal data structures of this vertex.
e - the incident edge of this vertex which is being removedv - the neighbor of this vertex which is being removedpublic String toString()
toString in class ObjectObject.toString()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||