Class Ranking<V>
java.lang.Object
edu.uci.ics.jung.algorithms.importance.Ranking<V>
- All Implemented Interfaces:
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
FieldsModifier and TypeFieldDescriptionint
The original (0-indexed) position of the instance being rankedprivate V
what is being rankeddouble
The actual rank score (normally between 0 and 1) -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
originalPos
public int originalPosThe original (0-indexed) position of the instance being ranked -
rankScore
public double rankScoreThe actual rank score (normally between 0 and 1) -
ranked
what is being ranked
-
-
Constructor Details
-
Ranking
Constructor which allows values to be set on construction- Parameters:
originalPos
- The original (0-indexed) position of the instance being rankedrankScore
- The actual rank score (normally between 0 and 1)ranked
- the vertex being ranked
-
-
Method Details
-
compareTo
Compares two ranking based on the rank score.- Specified by:
compareTo
in interfaceComparable<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
Returns the rank score as a string. -
getRanked
- Returns:
- the ranked element
-
setRanked
- Parameters:
ranked
- the ranked to set
-