Class DegreeScorer<V>
- java.lang.Object
-
- edu.uci.ics.jung.algorithms.scoring.DegreeScorer<V>
-
- Type Parameters:
V- the vertex type
- All Implemented Interfaces:
VertexScorer<V,java.lang.Integer>
public class DegreeScorer<V> extends java.lang.Object implements VertexScorer<V,java.lang.Integer>
Assigns a score to each vertex equal to its degree.
-
-
Constructor Summary
Constructors Constructor Description DegreeScorer(edu.uci.ics.jung.graph.Hypergraph<V,?> graph)Creates an instance for the specified graph.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.IntegergetVertexScore(V v)Returns the degree of the vertex.
-
-
-
Field Detail
-
graph
protected edu.uci.ics.jung.graph.Hypergraph<V,?> graph
The graph for which scores are to be generated.
-
-
Constructor Detail
-
DegreeScorer
public DegreeScorer(edu.uci.ics.jung.graph.Hypergraph<V,?> graph)
Creates an instance for the specified graph.- Parameters:
graph- the input graph
-
-
Method Detail
-
getVertexScore
public java.lang.Integer getVertexScore(V v)
Returns the degree of the vertex.- Specified by:
getVertexScorein interfaceVertexScorer<V,java.lang.Integer>- Returns:
- the degree of the vertex
-
-