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

com.kennycason.kumo.WordFrequency Maven / Gradle / Ivy

There is a newer version: 1.28
Show newest version
package com.kennycason.kumo;

/**
 * Created by kenny on 6/29/14.
 */
public class WordFrequency implements Comparable {

    private final String word;

    private final int frequency;

    public WordFrequency(final String word, final int frequency) {
        this.word = word;
        this.frequency = frequency;
    }

    public String getWord() {
        return word;
    }

    public int getFrequency() {
        return frequency;
    }

    @Override
    public int compareTo(final WordFrequency wordFrequency) {
        return  wordFrequency.frequency - frequency;
    }

    @Override
    public String toString() {
        return "WordFrequency [word=" + word + ", frequency=" + frequency + "]";
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy