Package uk.ac.starlink.topcat

# Class Classifier<T>

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

public class Classifier<T> extends Object
Categorises submitted data values by equality into a set of mutually exclusive groups.

Since:
  3 Feb 2015
Author:
  Mark Taylor

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static class`
`Classifier.CountedValue<T>`
Aggregates a value and the number of times it has been submitted.

## Constructor Summary

Constructors
Constructor
Description
`Classifier()`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`long`
`getItemCount()`
Returns the number of values submitted so far.
`Collection<Classifier.CountedValue<T>>`
`getThresholdValues(int minCount)`
Returns a sorted list of the values with a certain minimum count.
`SortedSet<Classifier.CountedValue<T>>`
`getTopValues(int nValue)`
Returns a sorted list of the N most popular values.
`long`
`getValueCount()`
Returns the number of distinct values seen so far.
`void`
`submit(T value)`
Submits a value for categorisation.

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

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### Classifier

public Classifier()
Constructor.

## Method Details

### submit

public void submit(T value)
Submits a value for categorisation.

Parameters:
  `value` - value

### getItemCount

public long getItemCount()
Returns the number of values submitted so far.

Returns:
  total item count

### getValueCount

public long getValueCount()
Returns the number of distinct values seen so far.

Returns:
  number of distinct values

### getTopValues

public SortedSet<Classifier.CountedValue<T>> getTopValues(int nValue)
Returns a sorted list of the N most popular values.

Parameters:
  `nValue` - maximum number of values to return
Returns:
  collection of submitted values, in descending order of popularity

### getThresholdValues

public Collection<Classifier.CountedValue<T>> getThresholdValues(int minCount)
Returns a sorted list of the values with a certain minimum count.

Parameters:
  `minCount` - minimum number of submissions for each returned value
Returns:
  collection of submitted values, in descending order of popularity