uk.ac.starlink.topcat
Class Classifier<T>

java.lang.Object
  extended by 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
static class Classifier.CountedValue<T>
          Aggregates a value and the number of times it has been submitted.
 
Constructor Summary
Classifier()
          Constructor.
 
Method Summary
 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 Detail

Classifier

public Classifier()
Constructor.

Method Detail

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


Copyright © 2003-2018 CCLRC: Council for the Central Laboratory of the Research Councils. All Rights Reserved.