Package uk.ac.starlink.topcat
Class Classifier.CountedValue<T>
java.lang.Object
uk.ac.starlink.topcat.Classifier.CountedValue<T>
- All Implemented Interfaces:
Comparable<Classifier.CountedValue<T>>
- Enclosing class:
Classifier<T>
public static class Classifier.CountedValue<T>
extends Object
implements Comparable<Classifier.CountedValue<T>>
Aggregates a value and the number of times it has been submitted.
The natural comparison sequence of these objects sorts them in
decreasing order of Count (number of submissions).
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
CountedValue
Constructor.- Parameters:
value
- submitted valuecount
- number of times it has been submitted
-
-
Method Details
-
getValue
Returns the value.- Returns:
- value
-
getCount
public long getCount()Returns the count.- Returns:
- number of times the value has been submitted
-
toString
-
hashCode
public int hashCode() -
equals
-
compareTo
Decreasing comparison on count, with appropriate tie-breakers.- Specified by:
compareTo
in interfaceComparable<T>
-