public class LeanSparseVertex extends AbstractSparseVertex
findEdge() (as well as most other methods) require time proportional
to the vertex's degree.UserDataContainer.CopyAction| Modifier and Type | Field and Description |
|---|---|
protected java.util.List |
incident_edges |
id, m_Graphfactory, udc_delegate| Constructor and Description |
|---|
LeanSparseVertex() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addNeighbor_internal(Edge e,
Vertex v)
Adds the specified edge
e and vertex v
to the internal data structures of this vertex. |
java.util.Set |
findEdgeSet(Vertex w)
Returns the set of all edges that connect this vertex
with the specified vertex
v. |
protected java.util.Collection |
getEdges_internal()
Returns a set containing all the incident edges of this vertex.
|
java.util.Set |
getInEdges()
Returns the set of incoming edges of this vertex.
|
protected java.util.Collection |
getNeighbors_internal()
Returns a set containing all neighbors of this vertex.
|
java.util.Set |
getOutEdges()
Returns the set of outgoing edges of this vertex.
|
java.util.Set |
getPredecessors()
Returns the set of predecessors of this vertex.
|
java.util.Set |
getSuccessors()
Returns the set of successors of this vertex.
|
int |
inDegree()
Returns the number of incoming edges that are incident to this
vertex.
|
protected void |
initialize()
Initializes all the data structures for this element.
|
boolean |
isDest(Edge e)
Returns
true if this vertex is a destination of
the specified edge e, and false otherwise. |
boolean |
isPredecessorOf(Vertex v)
Returns
true if this vertex is a predecessor of
the specified vertex v, and false otherwise. |
boolean |
isSource(Edge e)
Returns
true if this vertex is a source of
the specified edge e, and false otherwise. |
boolean |
isSuccessorOf(Vertex v)
Returns
true if this vertex is a successor of
the specified vertex v, and false otherwise. |
int |
numPredecessors()
Returns the number of predecessors of this vertex.
|
int |
numSuccessors()
Returns the number of successors of this vertex.
|
int |
outDegree()
Returns the number of outgoing edges that are incident to this
vertex.
|
protected void |
removeNeighbor_internal(Edge e,
Vertex v)
Removes the specified edge
e and vertex v
from the internal data structures of this vertex. |
copy, findEdge, findEdge, findEdgeSet, toStringdegree, equals, getEqualVertex, getEquivalentVertex, getIncidentEdges, getIncidentElements, getNeighbors, isIncident, isNeighborOf, numNeighborsaddGraph_internal, getGraph, hashCode, removeGraph_internaladdUserDatum, clone, containsUserDatumKey, getUserDatum, getUserDatumCopyAction, getUserDatumKeyIterator, importUserData, removeUserDatum, setUserDataFactory, setUserDatumfinalize, getClass, notify, notifyAll, wait, wait, waitdegree, getEqualVertex, getEquivalentVertex, getIncidentEdges, getNeighbors, isIncident, isNeighborOf, numNeighborsgetGraph, getIncidentElementsaddUserDatum, clone, containsUserDatumKey, getUserDatum, getUserDatumCopyAction, getUserDatumKeyIterator, importUserData, removeUserDatum, setUserDatumprotected void initialize()
AbstractElementclone() copies some information that should
not be in the new element.)initialize in class AbstractElementprotected java.util.Collection getNeighbors_internal()
AbstractArchetypeVertexgetNeighbors_internal in class AbstractArchetypeVertexAbstractArchetypeVertex.getNeighbors_internal()protected java.util.Collection getEdges_internal()
AbstractArchetypeVertexgetEdges_internal in class AbstractArchetypeVertexAbstractArchetypeVertex.getEdges_internal()protected void addNeighbor_internal(Edge e, Vertex v)
AbstractSparseVertexe and vertex v
to the internal data structures of this vertex.addNeighbor_internal in class AbstractSparseVertexe - the new incident edge of this vertexv - the new neighbor of this vertexAbstractSparseVertex.addNeighbor_internal(edu.uci.ics.jung.graph.Edge,
edu.uci.ics.jung.graph.Vertex)protected void removeNeighbor_internal(Edge e, Vertex v)
AbstractSparseVertexe and vertex v
from the internal data structures of this vertex.removeNeighbor_internal in class AbstractSparseVertexe - the incident edge of this vertex which is being removedv - the neighbor of this vertex which is being removedAbstractSparseVertex.removeNeighbor_internal(edu.uci.ics.jung.graph.Edge,
edu.uci.ics.jung.graph.Vertex)public java.util.Set findEdgeSet(Vertex w)
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 VertexfindEdgeSet in class AbstractSparseVertexVertex.findEdgeSet(Vertex)public java.util.Set getPredecessors()
Vertexv is a predecessor of this vertex if and only if
v.isPredecessorOf(this) returns true.
Each element of the set returned should implement Vertex.Vertex.getPredecessors()public java.util.Set getSuccessors()
Vertexv is a successor of this vertex if and only if
v.isSuccessorOf(this) returns true.
Each element of the set returned should implement Vertex.Vertex.getSuccessors()public java.util.Set getInEdges()
Vertexe is an incoming edge of this vertex if and only if
this.isDest(e) returns true.
Each element of the set returned should implement Edge.Vertex.getInEdges()public java.util.Set getOutEdges()
Vertexe is an outgoing edge of this vertex if and only if
this.isSource(e) returns true.
Each element of the set returned should implement Edge.Vertex.getOutEdges()public int inDegree()
VertexVertex.inDegree()public int outDegree()
VertexVertex.outDegree()public int numPredecessors()
VertexVertex.numPredecessors()public int numSuccessors()
VertexVertex.numSuccessors()public boolean isSuccessorOf(Vertex v)
Vertextrue if this vertex is a successor of
the specified vertex v, and false otherwise.
This vertex is a successor of v if and only if
there exists an edge e such that
v.isSource(e) == true and
this.isDest(e) == true.
The behavior of this method is undefined if v is not
an element of this vertex's graph.public boolean isPredecessorOf(Vertex v)
Vertextrue if this vertex is a predecessor of
the specified vertex v, and false otherwise.
This vertex is a predecessor of v if and only if
there exists an edge e such that
this.isSource(e) == true and
v.isDest(e) == true.
The behavior of this method is undefined if v is not
an element of this vertex's graph.public boolean isSource(Edge e)
Vertextrue if this vertex is a source of
the specified edge e, and false otherwise.
A vertex v is a source of e if e
is an outgoing edge of v.
The behavior of this method is undefined if e is not
an element of this vertex's graph.public boolean isDest(Edge e)
Vertextrue if this vertex is a destination of
the specified edge e, and false otherwise.
A vertex v is a destination of e
if e is an incoming edge of v.
The behavior of this method is undefined if e is not
an element of this vertex's graph.