public EventedMeasurement(TheUnit value, Unit event) { super(value); mEvent = new AgingData<>(event); }
/** * Construct a new Measurement with the given value. * * @param value the TheUnit this measurement represents. */ public BaseMeasurement(TheUnit value) { if(!sMeasurementIdToClass.inverse().containsKey(this.getClass())) { try { cacheMeasurementId(this.getClass()); } catch(UnrecognizedMeasurementTypeException e) { Log.w(TAG, "Incomplete BaseMeasurement subclass", e); } } mValue = new AgingData<>(value); }
@Before public void setUp() { value = new Degree(0.0); data = new AgingData<Degree>(value); }
@Test public void testBornEarlier() { Date otherTime = new Date(data.getAge() + 100); data = new AgingData<Degree>(otherTime, value); assertThat(data.getAge(), greaterThanOrEqualTo(Long.valueOf(100))); }