public class StyleCounter<T> extends Object
NodeStyle. The style implementation must correctly implement the
equals() and hashCode() methods.| Constructor and Description |
|---|
StyleCounter()
Creates an empty style counter.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(T style)
Adds a new occurence to the counter.
|
Map<T,Integer> |
getAll()
Obtains all the registered styles and their frequencies.
|
Map<T,Integer> |
getAllSorted()
Obtains all the registered styles and their frequencies, sort by frequenct.
|
int |
getCount(T style)
Obtains total registered number of occurences of the given style.
|
Set<T> |
getDistinctStyles()
Obtains all distinct styles that have been seen independently on their frequencies.
|
List<T> |
getFrequentSyles(float factor)
Obtains the frequent style where the frequency is greater or equal than factor*max_frequency.
|
T |
getMostFrequent()
Obtains the most frequent style.
|
List<T> |
getMostFrequentAll()
Obtains the most frequent style or styles when multiple of them have the maximal frequency.
|
String |
toString() |
public void add(T style)
style - The style to be added.public int getCount(T style)
style - the style whose number of occurences should be returnedpublic T getMostFrequent()
null when the counter is empty.public List<T> getMostFrequentAll()
public Map<T,Integer> getAll()
public Set<T> getDistinctStyles()
public List<T> getFrequentSyles(float factor)
public Map<T,Integer> getAllSorted()
Copyright © 2016. All rights reserved.