# SlidingWeightedAverageBandwidthStatistic.SampleEvictionFunction

Artifact: [androidx.media3:media3-exoplayer](https://developer.android.com/jetpack/androidx/releases/media3) [View Source](https://cs.android.com/search?q=file:androidx/media3/exoplayer/upstream/experimental/SlidingWeightedAverageBandwidthStatistic.java+class:androidx.media3.exoplayer.upstream.experimental.SlidingWeightedAverageBandwidthStatistic.SampleEvictionFunction)

*** ** * ** ***


```
public interface SlidingWeightedAverageBandwidthStatistic.SampleEvictionFunction
```

<br />

*** ** * ** ***

An interface to decide if samples need to be evicted from the estimator.

## Summary

| ### Public methods |
|---|---|
| `abstract boolean` | `https://developer.android.com/reference/androidx/media3/exoplayer/upstream/experimental/SlidingWeightedAverageBandwidthStatistic.SampleEvictionFunction#shouldEvictSample(java.util.Deque<androidx.media3.exoplayer.upstream.experimental.SlidingWeightedAverageBandwidthStatistic.Sample>)( https://developer.android.com/reference/java/util/Deque.html<https://developer.android.com/reference/androidx/media3/exoplayer/upstream/experimental/SlidingWeightedAverageBandwidthStatistic.Sample> samples )` Whether the sample at the front of the queue needs to be evicted. |

## Public methods

### shouldEvictSample

```
abstract boolean shouldEvictSample(
    Deque<SlidingWeightedAverageBandwidthStatistic.Sample> samples
)
```

Whether the sample at the front of the queue needs to be evicted. Called before adding a next sample.

| Parameters |
|---|---|
| `https://developer.android.com/reference/java/util/Deque.html<https://developer.android.com/reference/androidx/media3/exoplayer/upstream/experimental/SlidingWeightedAverageBandwidthStatistic.Sample> samples` | A queue of samples, ordered by `https://developer.android.com/reference/androidx/media3/exoplayer/upstream/experimental/SlidingWeightedAverageBandwidthStatistic.Sample#timeAddedMs()`. The oldest sample is at front of the queue. The queue must not be modified. |