edu.uci.ics.jung.graph.impl
Class AbstractHypervertex
java.lang.Object
edu.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.AbstractHypervertex
- All Implemented Interfaces:
- ArchetypeVertex, Element, Hypervertex, UserDataContainer, Cloneable
- Direct Known Subclasses:
- CollectionHypervertex
public abstract class AbstractHypervertex
- extends AbstractArchetypeVertex
- implements Hypervertex
This class provides a skeletal implementation of the Hypervertex
interface to minimize the effort required to implement this interface.
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.
Existing subclasses maintain collections of edges, and infer neighbor
collections from these classes. Independent neighbor collections are
difficult to maintain for the following reasons:
Hyperedges' membership is mutable; when a vertex is added to
or removed from a hyperedge, each
vertex connected to the hyperedge must be notified of the change, and
when a hyperedge is added to or removed from a graph, each connected
vertex must remove all vertices incident to this edge from its
collections...but only if there are no other edges connecting each
vertex pair.
The number of "neighboring" vertices for a
hypergraph can be very large if it is connected to several hyperedges.
Those who want to provide implementations which maintain something
like the adjacency maps found in the Vertex
implementations
will need to provide support for edge set mutability both in the
Hypervertex
implementation and in the Hyperedge
implementation.
- Author:
- Joshua O'Madadhain, Joshua O'Madadhain
- See Also:
SetHypergraph
,
AbstractHyperedge
Methods inherited from class edu.uci.ics.jung.graph.impl.AbstractArchetypeVertex |
degree, equals, findEdge, findEdgeSet, getEdges_internal, getEqualVertex, getEquivalentVertex, getIncidentEdges, getIncidentElements, getNeighbors_internal, getNeighbors, isIncident, isNeighborOf, numNeighbors |
AbstractHypervertex
public AbstractHypervertex()
copy
public ArchetypeVertex copy(ArchetypeGraph g)
- Description copied from interface:
ArchetypeVertex
- Creates a copy of this vertex in graph
g
. The vertex
created will be equivalent to this vertex: given
v = this.copy(g)
, then
this.getEquivalentVertex(g) == v
, and
this.equals(v) == true
.
- Specified by:
copy
in interface ArchetypeVertex
- Overrides:
copy
in class AbstractArchetypeVertex
- Parameters:
g
- the graph in which the copied vertex will be placed
- Returns:
- the vertex created
- See Also:
ArchetypeVertex.copy(edu.uci.ics.jung.graph.ArchetypeGraph)
initialize
protected void initialize()
- Description copied from class:
AbstractElement
- Initializes all the data structures for this element.
(This is used on cloned elements, since
clone()
copies some information that should
not be in the new element.)
- Overrides:
initialize
in class AbstractElement
toString
public String toString()
- Returns a human-readable representation of this edge.
- Overrides:
toString
in class Object
- See Also:
Object.toString()
connectEdge
public boolean connectEdge(Hyperedge e)
- Description copied from interface:
Hypervertex
- Connects
he
to this hypervertex and vice versa.
Does not affect he
's membership in the graph.
Equivalent to calling he.connectVertex(this)
.
- Specified by:
connectEdge
in interface Hypervertex
- See Also:
Hypervertex.connectEdge(Hyperedge)
disconnectEdge
public boolean disconnectEdge(Hyperedge e)
- Description copied from interface:
Hypervertex
- Disconnects
he
from this hypervertex and vice versa.
Does not affect he
's membership in the graph.
Equivalent to calling he.disconnectVertex(this)
.
- Specified by:
disconnectEdge
in interface Hypervertex
- See Also:
Hypervertex.disconnectEdge(Hyperedge)