mirror of
https://github.com/GTNewHorizons/Opis.git
synced 2026-11-25 14:34:37 +00:00
24 lines
657 B
Java
24 lines
657 B
Java
package mcp.mobius.opis.data.holders.stats;
|
|
|
|
import java.io.DataInputStream;
|
|
import java.io.DataOutputStream;
|
|
import java.io.IOException;
|
|
|
|
import org.apache.commons.math3.stat.descriptive.DescriptiveStatistics;
|
|
|
|
public class StatsTick extends StatAbstract {
|
|
|
|
public DescriptiveStatistics dstat = new DescriptiveStatistics(20);
|
|
|
|
@Override
|
|
public void writeToStream(DataOutputStream stream) throws IOException {
|
|
stream.writeDouble(this.getGeometricMean());
|
|
}
|
|
|
|
public static StatsTick readFromStream(DataInputStream stream) throws IOException {
|
|
StatsTick stat = new StatsTick();
|
|
stat.setGeometricMean(stream.readDouble());
|
|
return stat;
|
|
}
|
|
}
|