All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.ggp.base.apps.research.Histogram Maven / Gradle / Ivy

The newest version!
package org.ggp.base.apps.research;


/**
 * Histogram is a way of visualizing an unordered collection with repeated
 * elements, by mapping each element to the number of times that it appears.
 * It is an aggregation that maps keys to counts.
 *
 * @author Sam Schreiber
 */
public final class Histogram extends Aggregation
{
    public void add(String key) {
        if (!containsEntry(key)) {
            createEntry(key, new Counter());
        }
        getEntryData(key).addValue(1);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy