Class Ranking<V>

java.lang.Object
edu.uci.ics.jung.algorithms.importance.Ranking<V>
All Implemented Interfaces:
Comparable

public class Ranking<V> extends Object implements Comparable
Abstract data container for ranking objects. Stores common data relevant to both node and edge rankings, namely, the original position of the instance in the list and the actual ranking score.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    int
    The original (0-indexed) position of the instance being ranked
    private V
    what is being ranked
    double
    The actual rank score (normally between 0 and 1)
  • Constructor Summary

    Constructors
    Constructor
    Description
    Ranking(int originalPos, double rankScore, V ranked)
    Constructor which allows values to be set on construction
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Compares two ranking based on the rank score.
     
    void
    setRanked(V ranked)
     
    Returns the rank score as a string.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • originalPos

      public int originalPos
      The original (0-indexed) position of the instance being ranked
    • rankScore

      public double rankScore
      The actual rank score (normally between 0 and 1)
    • ranked

      private V ranked
      what is being ranked
  • Constructor Details

    • Ranking

      public Ranking(int originalPos, double rankScore, V ranked)
      Constructor which allows values to be set on construction
      Parameters:
      originalPos - The original (0-indexed) position of the instance being ranked
      rankScore - The actual rank score (normally between 0 and 1)
      ranked - the vertex being ranked
  • Method Details

    • compareTo

      public int compareTo(Object other)
      Compares two ranking based on the rank score.
      Specified by:
      compareTo in interface Comparable<V>
      Parameters:
      other - The other ranking
      Returns:
      -1 if the other ranking is higher, 0 if they are equal, and 1 if this ranking is higher
    • toString

      public String toString()
      Returns the rank score as a string.
      Overrides:
      toString in class Object
      Returns:
      the stringified rank score
    • getRanked

      public V getRanked()
      Returns:
      the ranked element
    • setRanked

      public void setRanked(V ranked)
      Parameters:
      ranked - the ranked to set