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
Constructor
Description
`CountedValue(T value, long count)`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`int`
`compareTo(Classifier.CountedValue<T> cv2)`
Decreasing comparison on count, with appropriate tie-breakers.
`boolean`
`equals(Object o)`
`long`
`getCount()`
Returns the count.
`T`
`getValue()`
Returns the value.
`int`
`hashCode()`
`String`
`toString()`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

## Constructor Details

### CountedValue

public CountedValue(T value, long count)
Constructor.

Parameters:
  `value` - submitted value
  `count` - number of times it has been submitted

## Method Details

### getValue

public T getValue()
Returns the value.

Returns:
  value

### getCount

public long getCount()
Returns the count.

Returns:
  number of times the value has been submitted

### toString

public String toString()

Overrides:
  `toString` in class `Object`

### hashCode

public int hashCode()

Overrides:
  `hashCode` in class `Object`

### equals

public boolean equals(Object o)

Overrides:
  `equals` in class `Object`

### compareTo

public int compareTo(Classifier.CountedValue<T> cv2)
Decreasing comparison on count, with appropriate tie-breakers.

Specified by:
  `compareTo` in interface `Comparable<T>`