Package com.sun.xml.analysis.frequency
Class FrequencySet<T>
java.lang.Object
java.util.AbstractMap<T,Integer>
java.util.HashMap<T,Integer>
com.sun.xml.analysis.frequency.FrequencySet<T>
- All Implemented Interfaces:
Serializable
,Cloneable
,Map<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:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,
V>, AbstractMap.SimpleImmutableEntry<K, V> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate void
void
Add a value to the set.void
Add a value to the set with 0 occurences.Create an ordered list of values in the order of decreasing frequency of occurence.Create an ordered set of values in the order of decreasing frequency of occurence.Methods inherited from class java.util.HashMap
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, newHashMap, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
-
Constructor Details
-
FrequencySet
public FrequencySet()
-
-
Method Details
-
add
Add a value to the set.- Parameters:
value
- the value to put in the set.
-
add0
Add a value to the set with 0 occurences.- Parameters:
value
- the value to put in the set.
-
_add
-
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
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.
-