Please note that the contents of this offline web site may be out of date. To access the most recent documentation visit the online version .
Note that links that point to online resources are green in color and will open in a new window.
We would love it if you could give us feedback about this material by filling this form (You have to be online to fill it)
Android APIs
public class

CircularArray

extends Object
java.lang.Object
   ↳ android.support.v4.util.CircularArray<E>

Class Overview

A circular array implementation that provides O(1) random read and O(1) prepend and O(1) append.

Summary

Public Constructors
CircularArray ()
Create a CircularArray with default capacity.
CircularArray (int minCapacity)
Create a CircularArray with capacity for at least minCapacity elements.
Public Methods
final void addFirst (E e)
final void addLast (E e)
final E get (int i)
final E getFirst ()
final E getLast ()
final boolean isEmpty ()
final E popFirst ()
final E popLast ()
final int size ()
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public CircularArray ()

Create a CircularArray with default capacity.

public CircularArray (int minCapacity)

Create a CircularArray with capacity for at least minCapacity elements.

Parameters
minCapacity The minimum capacity required for the circular array.

Public Methods

public final void addFirst (E e)

public final void addLast (E e)

public final E get (int i)

public final E getFirst ()

public final E getLast ()

public final boolean isEmpty ()

public final E popFirst ()

public final E popLast ()

public final int size ()