Class FrequencySet<T>

java.lang.Object
java.util.AbstractMap<K,V>
java.util.HashMap<T,Integer>
com.sun.xml.analysis.frequency.FrequencySet<T>
All Implemented Interfaces:
Serializable, Cloneable, Map<T,Integer>

public class FrequencySet<T> extends HashMap<T,Integer>
A Set that manages how many occurances of a value occurs in the set. TODO: Sort entries lexically for set of values with 0 occurences.
See Also:
  • Constructor Details

    • FrequencySet

      public FrequencySet()
  • Method Details

    • add

      public void add(T value)
      Add a value to the set.
      Parameters:
      value - the value to put in the set.
    • add0

      public void add0(T value)
      Add a value to the set with 0 occurences.
      Parameters:
      value - the value to put in the set.
    • _add

      private void _add(T value, int v)
    • createFrequencyBasedList

      public List<T> createFrequencyBasedList()
      Create an ordered list of values in the order of decreasing frequency of occurence.
      Returns:
      the list of values in the order of decreasing frequency of occurence.
    • createFrequencyBasedSet

      public Set<T> createFrequencyBasedSet()
      Create an ordered set of values in the order of decreasing frequency of occurence.
      Returns:
      the set of values in the order of decreasing frequency of occurence.