public class FrequencySet<T> extends HashMap<T,Integer>
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Constructor and Description |
---|
FrequencySet() |
Modifier and Type | Method and Description |
---|---|
void |
add(T value)
Add a value to the set.
|
void |
add0(T value)
Add a value to the set with 0 occurences.
|
List<T> |
createFrequencyBasedList()
Create an ordered list of values in the order of decreasing frequency
of occurence.
|
Set<T> |
createFrequencyBasedSet()
Create an ordered set of values in the order of decreasing frequency
of occurence.
|
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
equals, hashCode, toString
public void add(T value)
value
- the value to put in the set.public void add0(T value)
value
- the value to put in the set.public List<T> createFrequencyBasedList()
Copyright © 2014 Oracle Corpration. All rights reserved.