@Test public void testRunningAverageWithNoHistoryCalculation() { final ITimeProvider.TestTimeProvider timeProvider = new ITimeProvider.TestTimeProvider(); final RssiFilter filter = new RunningAverageRssiFilter.Builder() .addTimeProvider(timeProvider) .build(); final Byte average = filter.getFilteredValue(); assertNull(average); }
@Nullable @Override public Byte getFilteredValue() { if (readings.isEmpty()) { return null; } int rssiSum = 0; for (Reading reading : readings) { rssiSum += reading.rssi; } return (byte) (rssiSum / readings.size()); }
RunningAverageRssiFilter extends RssiFilter { @Nullable @Override public Byte getFilteredValue() { if (readings.isEmpty()) { return null; } int rssiSum = 0; for (Reading reading : readings) { rssiSum += reading.rssi; } return (byte) (rssiSum / readings.size()); } }
RunningAverageRssiFilter extends RssiFilter { @Nullable @Override public Byte getFilteredValue() { if (readings.isEmpty()) { return null; } int rssiSum = 0; for (Reading reading : readings) { rssiSum += reading.rssi; } return (byte) (rssiSum / readings.size()); } private  RunningAverageRssiFilter(ITimeProvider timeProvider,
                                    long rssiValidityPeriodMillis); }
RunningAverageRssiFilter extends RssiFilter { @Nullable @Override public Byte getFilteredValue() { if (readings.isEmpty()) { return null; } int rssiSum = 0; for (Reading reading : readings) { rssiSum += reading.rssi; } return (byte) (rssiSum / readings.size()); } private  RunningAverageRssiFilter(ITimeProvider timeProvider,
                                    long rssiValidityPeriodMillis); @Override void addReading(byte rssi); @Nullable @Override Byte getFilteredValue(); }
RunningAverageRssiFilter extends RssiFilter { @Nullable @Override public Byte getFilteredValue() { if (readings.isEmpty()) { return null; } int rssiSum = 0; for (Reading reading : readings) { rssiSum += reading.rssi; } return (byte) (rssiSum / readings.size()); } private  RunningAverageRssiFilter(ITimeProvider timeProvider,
                                    long rssiValidityPeriodMillis); @Override void addReading(byte rssi); @Nullable @Override Byte getFilteredValue();  }