|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectpeersim.util.IncrementalStats
peersim.util.MedianStats
public class MedianStats
This class adds the ability to retrieve the median element to the
IncrementalStats class. Note that this class actually stores all
the elements, so (unlike in its superclass) storage requirements depend
on the number of items processed.
| Constructor Summary | |
|---|---|
MedianStats()
Calls reset(). |
|
| Method Summary | |
|---|---|
void |
add(double item,
int k)
Updates the statistics assuming element item is added
k times. |
double |
getMedian()
Retrieves the median in the current data collection. |
static void |
main(java.lang.String[] args)
|
void |
reset()
Resets the statistics to reflect the zero elements set. |
| Methods inherited from class peersim.util.IncrementalStats |
|---|
add, getAverage, getMax, getMaxCount, getMin, getMinCount, getN, getSqrSum, getStD, getSum, getVar, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public MedianStats()
reset().
| Method Detail |
|---|
public double getMedian()
public void add(double item,
int k)
IncrementalStatsitem is added
k times.
add in class IncrementalStatspublic void reset()
IncrementalStats
reset in class IncrementalStatspublic static void main(java.lang.String[] args)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||