|
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.DataMap<T>
T - the category type that is supported by this data mappublic class DataMap<T>
allows to easily collect data based on a category and a number
CounterMap,
DataMatrix,
Serialized Form| Nested Class Summary | |
|---|---|
static class |
DataMap.SnapshotModel
|
| Constructor Summary | |
|---|---|
DataMap()
|
|
| Method Summary | |
|---|---|
void |
add(T category,
DataPoint x)
|
void |
add(T category,
Number n)
|
void |
addAll(DataMap<T> data)
|
protected void |
checkSize()
|
void |
clear()
|
DataMap<T> |
clone()
|
boolean |
containsKey(T key)
|
Set<T> |
getCategories()
|
DataMap.SnapshotModel |
getSnapshotModel()
|
ArrayList<T> |
getSortedKeys()
uses the natural order or - if not applicable - a UniversalComparator |
ArrayList<T> |
getSortedKeys(Comparator<? super T> comp)
provides a sorted snapshot of the keys in this data map |
DataPoint |
getValue(T category)
|
DataPoint |
getValueForAll()
|
Map<T,DataPoint> |
getView()
|
boolean |
isEmpty()
|
void |
limitSize(int limit)
uses no comparator |
void |
limitSize(int limit,
Comparator<DataPoint> dpComparator)
uses the given limit as both: upper and lower limit |
void |
limitSize(int upperLimit,
int lowerLimit,
Comparator<DataPoint> dpComparator)
allows to limit this data map to a given number of keys. |
void |
purge(int limit,
Comparator<DataPoint> comparator)
|
int |
size()
|
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DataMap()
| Method Detail |
|---|
public DataMap<T> clone()
throws CloneNotSupportedException
clone in class ObjectCloneNotSupportedException
public void add(T category,
Number n)
public void add(T category,
DataPoint x)
public void addAll(DataMap<T> data)
public void limitSize(int limit)
public void limitSize(int limit,
Comparator<DataPoint> dpComparator)
public void limitSize(int upperLimit,
int lowerLimit,
Comparator<DataPoint> dpComparator)
upperLimit - is in effect if larger than 0lowerLimit - must be between 0 and the upperLimit; if the upper limit is reached, data is purged to the lower limitdpComparator - the comparator to be usedlimitSize(int),
UniversalComparator.reverse(Comparator),
DataPoint.COUNT_COMPARATOR,
DataPoint.SUM_COMPARATOR
public void purge(int limit,
Comparator<DataPoint> comparator)
protected void checkSize()
public DataMap.SnapshotModel getSnapshotModel()
public Set<T> getCategories()
public DataPoint getValue(T category)
public DataPoint getValueForAll()
public ArrayList<T> getSortedKeys()
public ArrayList<T> getSortedKeys(Comparator<? super T> comp)
comp - if null and T does not implement Comparable, a UniversalComparator is used
UniversalComparator.getDefaultInstance()public boolean containsKey(T key)
public Map<T,DataPoint> getView()
public void clear()
public int size()
public boolean isEmpty()
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||