@SuppressWarnings("unchecked") @Override public DoubleSummary copy() { return new DoubleSummary(value_, mode_); }
@Override public DoubleSummary newSummary() { return new DoubleSummary(summaryMode_); }
/** * Creates an instance of the DoubleSummary given a serialized representation * @param mem Memory object with serialized DoubleSummary * @return DeserializedResult object, which contains a DoubleSummary object and number of bytes * read from the Memory */ public static DeserializeResult<DoubleSummary> fromMemory(final Memory mem) { return new DeserializeResult<DoubleSummary>(new DoubleSummary(mem.getDouble(VALUE_DOUBLE), Mode.values()[mem.getByte(MODE_BYTE)]), SERIALIZED_SIZE_BYTES); }
@Override public DoubleSummary union(final DoubleSummary a, final DoubleSummary b) { final DoubleSummary result = new DoubleSummary(summaryMode_); if (a != null) { result.update(a.getValue()); } if (b != null) { result.update(b.getValue()); } return result; }
@Test public void updateDoubleSummary() { DoubleSummary ds = new DoubleSummary(); ds.update(1.0); Assert.assertEquals(ds.getValue(), 1.0); }
@SuppressWarnings("unchecked") @Override public DoubleSummary copy() { return new DoubleSummary(value_, mode_); }
@Override public DoubleSummary newSummary() { return new DoubleSummary(summaryMode_); }
/** * Creates an instance of the DoubleSummary given a serialized representation * @param mem Memory object with serialized DoubleSummary * @return DeserializedResult object, which contains a DoubleSummary object and number of bytes * read from the Memory */ public static DeserializeResult<DoubleSummary> fromMemory(final Memory mem) { return new DeserializeResult<DoubleSummary>(new DoubleSummary(mem.getDouble(VALUE_DOUBLE), Mode.values()[mem.getByte(MODE_BYTE)]), SERIALIZED_SIZE_BYTES); }
@Override public DoubleSummary union(final DoubleSummary a, final DoubleSummary b) { final DoubleSummary result = new DoubleSummary(summaryMode_); if (a != null) { result.update(a.getValue()); } if (b != null) { result.update(b.getValue()); } return result; }