public class RunningTotal extends Object
| Constructor and Description |
|---|
RunningTotal(int size) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(long value)
Adds a new value to our running total.
|
double |
getAverage()
Returns current average of our running total.
|
long |
getSize()
Returns current number of values in our running total.
|
long |
getTotal()
Returns current value of our running total.
|
String |
toString()
Returns a string representing the current running total.
|
public void add(long value)
value - The new long value to addpublic long getSize()
public long getTotal()
public double getAverage()
Copyright © 2012-2015 Cloudhopper by Twitter. All Rights Reserved.