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,Integer>

public class DegreeScorer<V> extends Object implements VertexScorer<V,Integer>
Assigns a score to each vertex equal to its degree.
  • Field Details

    • graph

      protected Hypergraph<V,?> graph
      The graph for which scores are to be generated.
  • Constructor Details

    • DegreeScorer

      public DegreeScorer(Hypergraph<V,?> graph)
      Creates an instance for the specified graph.
      Parameters:
      graph - the input graph
  • Method Details

    • getVertexScore

      public Integer getVertexScore(V v)
      Returns the degree of the vertex.
      Specified by:
      getVertexScore in interface VertexScorer<V,Integer>
      Parameters:
      v - the vertex whose score is requested
      Returns:
      the degree of the vertex