|
Holger's Java API |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.antelmann.math.CounterMap<T>
public class CounterMap<T>
a simple helper class that allows to easily count occurrences of categories.
DataMatrix,
DataMap,
Serialized Form| Constructor Summary | |
|---|---|
CounterMap()
|
|
| Method Summary | |
|---|---|
CounterMap<T> |
add(CounterMap<T> data)
adds this instance to the other given one and returns the result; this entry itself remains untouched |
void |
add(T element)
|
void |
add(T element,
int count)
|
void |
addAll(Map<? extends T,? extends Number> data)
|
void |
clear()
|
boolean |
equals(Object obj)
|
int |
getCountFor(T element)
|
DataPoint |
getCountStatistics()
|
ArrayList<T> |
getDublicates()
|
Set<T> |
getElements()
|
int |
getMaxCount()
|
int |
getMinCount()
|
double |
getPercentageFor(T element)
|
TreeSet<T> |
getSortedElements()
|
TreeSet<T> |
getSortedElements(Comparator<? super T> comp)
|
TreeSet<T> |
getSortedElementsByCount(boolean ascending)
|
int |
getTotal()
|
ArrayList<T> |
getUniques()
|
Map<T,Integer> |
getView()
provides an unmodifiable view of the data |
int |
hashCode()
|
boolean |
isEmpty()
|
int |
size()
|
String |
toDetailedString()
provides full details of this instance in a String. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CounterMap()
| Method Detail |
|---|
public void add(T element)
public void add(T element,
int count)
public void addAll(Map<? extends T,? extends Number> data)
public CounterMap<T> add(CounterMap<T> data)
Addable
add in interface Addable<CounterMap<T>>public int getCountFor(T element)
public double getPercentageFor(T element)
public DataPoint getCountStatistics()
public int getMaxCount()
public int getMinCount()
public int getTotal()
public TreeSet<T> getSortedElements()
public TreeSet<T> getSortedElements(Comparator<? super T> comp)
public TreeSet<T> getSortedElementsByCount(boolean ascending)
public Set<T> getElements()
public int size()
public boolean isEmpty()
public Map<T,Integer> getView()
public ArrayList<T> getUniques()
public ArrayList<T> getDublicates()
public void clear()
public String toDetailedString()
DetailedString
toDetailedString in interface DetailedStringpublic int hashCode()
hashCode in class Objectpublic boolean equals(Object obj)
equals in class Object
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||