public class UndirectedPrimVertex<E extends SpanningTreeEdgeData> extends UndirectedKruskalVertex<E> implements PrimVertex<E>
DEFAULT_WEIGHT
Constructor and Description |
---|
UndirectedPrimVertex(EdgeDataFactory<E> edgeDataFactory)
Construct vertex from a factory for building appropriate EdgeData objects,
initialize vertex weight and color to the default values and set vertex
parent to null.
|
Modifier and Type | Method and Description |
---|---|
Color |
getColor()
Get the vertex color
|
ChildVertex |
getParent()
Get the vertex's parent
|
double |
getWeight()
Retrieve a vertex's weight.
|
void |
setColor(Color color)
Set the vertex color
|
void |
setParent(ChildVertex parent)
Set the parent of the given vertex
|
void |
setWeight(double weight)
Set vertex weight to the specified value.
|
getEdgeColor, getEdgeWeight, setEdgeColor, setEdgeWeight
addAdjacency, clearAdjacencies, removeAdjacency
adjacencyCount, containsAdjacency, getAdjacencies, getEdgeData, hasAdjacencies
equals, getGraph, setGraph
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getEdgeWeight, setEdgeWeight
getEdgeColor, setEdgeColor
getEdgeData
addAdjacency, adjacencyCount, clearAdjacencies, containsAdjacency, getAdjacencies, getGraph, hasAdjacencies, removeAdjacency, setGraph
public UndirectedPrimVertex(EdgeDataFactory<E> edgeDataFactory)
edgeDataFactory
- public final void setWeight(double weight)
WeightedVertex
setWeight
in interface WeightedVertex
weight
- value to which to set the vertex weightpublic final double getWeight()
WeightedVertex
getWeight
in interface WeightedVertex
public void setColor(Color color)
ColoredVertex
setColor
in interface ColoredVertex
color
- value to which to set the colorpublic Color getColor()
ColoredVertex
getColor
in interface ColoredVertex
public void setParent(ChildVertex parent)
ChildVertex
setParent
in interface ChildVertex
parent
- vertex to be set as parentpublic ChildVertex getParent()
ChildVertex
getParent
in interface ChildVertex