Package uk.ac.starlink.topcat

## Class Classifier.CountedValue<T>

- java.lang.Object
- - uk.ac.starlink.topcat.Classifier.CountedValue<T>

- All Implemented Interfaces:
    `java.lang.Comparable<Classifier.CountedValue<T>>`
  Enclosing class:
    Classifier<T>

      public static class Classifier.CountedValue<T>
      extends java.lang.Object
      implements java.lang.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

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

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

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

- - ### Constructor Detail

    - #### CountedValue

          public CountedValue​(T value,
                              long count)

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

  - ### Method Detail

    - #### 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 java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `java.lang.Object`

    - #### equals

          public boolean equals​(java.lang.Object o)

      Overrides:
        `equals` in class `java.lang.Object`

    - #### compareTo

          public int compareTo​(Classifier.CountedValue<T> cv2)

      Decreasing comparison on count, with appropriate tie-breakers.
      Specified by:
        `compareTo` in interface `java.lang.Comparable<T>`