edu.uci.ics.jung.graph.impl
Class HypervertexBPG

java.lang.Object
  extended byedu.uci.ics.jung.graph.impl.AbstractHyperUnitBPG
      extended byedu.uci.ics.jung.graph.impl.HypervertexBPG
All Implemented Interfaces:
ArchetypeVertex, Hypervertex, UserDataContainer

public class HypervertexBPG
extends AbstractHyperUnitBPG
implements Hypervertex

A Hypervertex has zero or more hyperEdges attached to it, and is a member of a Hypergraph. Note that "removeAllIncidentEdges" disconnects the edges without deleting them; this is different from the usual understanding of how Edge works.

Author:
danyelf

Nested Class Summary
 
Nested classes inherited from class edu.uci.ics.jung.utils.UserDataContainer
UserDataContainer.CopyAction
 
Constructor Summary
HypervertexBPG()
           
 
Method Summary
 ArchetypeVertex copy(ArchetypeGraph g)
          Creates a copy of this vertex in graph g.
 int degree()
          Returns the number of edges adjacent to this vertex
 ArchetypeVertex getEqualVertex(ArchetypeGraph g)
          Returns the vertex in graph g, if any, that is equal to this vertex.
 ArchetypeVertex getEquivalentVertex(ArchetypeGraph g)
          Deprecated. As of version 1.4, renamed to getEqualVertex(g).
 java.util.Set getIncidentEdges()
          Returns the set of edges which are incident to this vertex.
 java.util.Set getNeighbors()
          Returns the set of vertices which are connected to this vertex via edges; each of these vertices should implement ArchetypeVertex.
 boolean isIncident(ArchetypeEdge e)
          Returns true if the specified edge e is incident to this vertex, and false otherwise.
 boolean isNeighborOf(ArchetypeVertex v)
          Not a very efficient implementation
 int numNeighbors()
          Not a very efficient implemenation: for each edge, counts the neighbors.
 
Methods inherited from class edu.uci.ics.jung.graph.impl.AbstractHyperUnitBPG
addUserDatum, containsUserDatumKey, equals, getGraph, getUserDatum, getUserDatumCopyAction, getUserDatumKeyIterator, importUserData, removeUserDatum, removeVertex, setUserDatum
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface edu.uci.ics.jung.graph.ArchetypeVertex
getGraph
 
Methods inherited from interface edu.uci.ics.jung.utils.UserDataContainer
addUserDatum, containsUserDatumKey, getUserDatum, getUserDatumCopyAction, getUserDatumKeyIterator, importUserData, removeUserDatum, setUserDatum
 

Constructor Detail

HypervertexBPG

public HypervertexBPG()
Method Detail

getNeighbors

public java.util.Set getNeighbors()
Description copied from interface: ArchetypeVertex
Returns the set of vertices which are connected to this vertex via edges; each of these vertices should implement ArchetypeVertex. If this vertex is connected to itself with a self-loop, then this vertex will be included in its own neighbor set.

Specified by:
getNeighbors in interface ArchetypeVertex
See Also:
ArchetypeVertex.getNeighbors()

getIncidentEdges

public java.util.Set getIncidentEdges()
Description copied from interface: ArchetypeVertex
Returns the set of edges which are incident to this vertex. Each of these edges should implement ArchetypeEdge.

Specified by:
getIncidentEdges in interface ArchetypeVertex
See Also:
ArchetypeVertex.getIncidentEdges()

degree

public int degree()
Returns the number of edges adjacent to this vertex

Specified by:
degree in interface ArchetypeVertex
Returns:
int the degree of this node
See Also:
ArchetypeVertex.degree()

getEqualVertex

public ArchetypeVertex getEqualVertex(ArchetypeGraph g)
Description copied from interface: ArchetypeVertex
Returns the vertex in graph g, if any, that is equal to this vertex. Otherwise, returns null. Two vertices are equal if one of them is an ancestor (via copy()) of the other.

Specified by:
getEqualVertex in interface ArchetypeVertex
See Also:
ArchetypeVertex.getEqualVertex(edu.uci.ics.jung.graph.ArchetypeGraph)

getEquivalentVertex

public ArchetypeVertex getEquivalentVertex(ArchetypeGraph g)
Deprecated. As of version 1.4, renamed to getEqualVertex(g).

Specified by:
getEquivalentVertex in interface ArchetypeVertex

isNeighborOf

public boolean isNeighborOf(ArchetypeVertex v)
Not a very efficient implementation

Specified by:
isNeighborOf in interface ArchetypeVertex
See Also:
ArchetypeVertex.isNeighborOf(edu.uci.ics.jung.graph.ArchetypeVertex)

isIncident

public boolean isIncident(ArchetypeEdge e)
Description copied from interface: ArchetypeVertex
Returns true if the specified edge e is incident to this vertex, and false otherwise. The behavior of this method is undefined if e is not an element of this vertex's graph.

Specified by:
isIncident in interface ArchetypeVertex
See Also:
ArchetypeVertex.isIncident(edu.uci.ics.jung.graph.ArchetypeEdge)

numNeighbors

public int numNeighbors()
Not a very efficient implemenation: for each edge, counts the neighbors.

Specified by:
numNeighbors in interface ArchetypeVertex
See Also:
ArchetypeVertex.numNeighbors()

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
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)