Files
Chronicle-Map/src/test/java/net/openhft/lang/values/MovingAverageCompact.java
T
2018-04-21 10:49:49 +01:00

69 lines
1.6 KiB
Java

package net.openhft.lang.values;
import net.openhft.chronicle.bytes.BytesIn;
import net.openhft.chronicle.bytes.BytesOut;
import net.openhft.chronicle.wire.AbstractBytesMarshallable;
public class MovingAverageCompact extends AbstractBytesMarshallable {
private double movingAverage;
private double high;
private double low;
private double stdDev;
public MovingAverageCompact(double movingAverage, double high, double low, double stdDev) {
this.movingAverage = movingAverage;
this.high = high;
this.low = low;
this.stdDev = stdDev;
}
@Override
public void readMarshallable(BytesIn in) throws IllegalStateException {
movingAverage = in.readDouble();
high = in.readDouble();
low = in.readDouble();
stdDev = in.readDouble();
}
@Override
public void writeMarshallable(BytesOut out) {
out.writeDouble(movingAverage);
out.writeDouble(high);
out.writeDouble(low);
out.writeDouble(stdDev);
}
public double getMovingAverage() {
return movingAverage;
}
public void setMovingAverage(double movingAverage) {
this.movingAverage = movingAverage;
}
public double getHigh() {
return high;
}
public void setHigh(double high) {
this.high = high;
}
public double getLow() {
return low;
}
public void setLow(double low) {
this.low = low;
}
public double getStdDev() {
return stdDev;
}
public void setStdDev(double stdDev) {
this.stdDev = stdDev;
}
}