CircularByteArray

public class CircularByteArray
extends Object

java.lang.Object
   ↳ com.android.tradefed.util.CircularByteArray


Data structure for holding a fixed size array that operates as a circular buffer, and tracks the total sum of all values in the array.

Summary

Public constructors

CircularByteArray(int size)

Public methods

void add(byte value)

Adds a new value to array, replacing oldest value if necessary

long getSum()

Gets the total value of all elements currently stored in array

int size()

Get the number of elements stored

Public constructors

CircularByteArray

CircularByteArray (int size)

Parameters
size int

Public methods

add

void add (byte value)

Adds a new value to array, replacing oldest value if necessary

getSum

long getSum ()

Gets the total value of all elements currently stored in array

Returns
long

size

int size ()

Get the number of elements stored

Returns
int