Class Term

  • All Implemented Interfaces:
    java.lang.Comparable<Term>

    public class Term
    extends java.lang.Object
    implements java.lang.Comparable<Term>
    Represents a string term with a frequency.

    Sorted alphabetically by default.

    • Constructor Detail

      • Term

        public Term​(java.lang.String term,
                    int freq)
    • Method Detail

      • term

        public java.lang.String term()
      • setTerm

        public void setTerm​(java.lang.String term)
      • freq

        public int freq()
      • setFreq

        public void setFreq​(int freq)
      • compareTo

        public int compareTo​(Term o)
        Specified by:
        compareTo in interface java.lang.Comparable<Term>
      • sortByFreq

        public static java.util.Comparator<Term> sortByFreq()
      • sortAlphabetically

        public static java.util.Comparator<Term> sortAlphabetically()