public class Average extends java.lang.Object implements Streamable
Modifier and Type | Field and Description |
---|---|
protected double |
avg |
protected long |
count |
Constructor and Description |
---|
Average() |
Modifier and Type | Method and Description |
---|---|
<T extends Average> |
add(long num) |
double |
average() |
void |
clear() |
long |
count() |
double |
getAverage() |
long |
getCount() |
<T extends Average> |
merge(T other)
Merges this average with another one
|
void |
readFrom(java.io.DataInput in)
Read the state of the current object (including superclasses) from instream
Note that the input stream must not be closed
|
java.lang.String |
toString() |
void |
writeTo(java.io.DataOutput out)
Write the entire state of the current object (including superclasses) to outstream.
|
public <T extends Average> T add(long num)
public <T extends Average> T merge(T other)
public double getAverage()
public double average()
public long getCount()
public long count()
public void clear()
public java.lang.String toString()
toString
in class java.lang.Object
public void writeTo(java.io.DataOutput out) throws java.lang.Exception
Streamable
writeTo
in interface Streamable
java.lang.Exception
public void readFrom(java.io.DataInput in) throws java.lang.Exception
Streamable
readFrom
in interface Streamable
java.lang.Exception
Copyright © 1998-2020 Red Hat. All Rights Reserved.