java.lang.Object | |
↳ | android.support.v4.util.CircularIntArray |
CircularIntArray is a circular integer array data structure that provides O(1) random read, O(1) prepend and O(1) append. The CircularIntArray automatically grows its capacity when number of added integers is over its capacity.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Create a CircularIntArray with default capacity.
| |||||||||||
Create a CircularIntArray with capacity for at least minCapacity elements.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Add an integer in front of the CircularIntArray.
| |||||||||||
Add an integer at end of the CircularIntArray.
| |||||||||||
Remove all integers from the CircularIntArray.
| |||||||||||
Get nth (0 <= n <= size()-1) integer of the CircularIntArray.
| |||||||||||
Get first integer of the CircularIntArray.
| |||||||||||
Get last integer of the CircularIntArray.
| |||||||||||
Return true if size() is 0.
| |||||||||||
Remove first integer from front of the CircularIntArray and return it.
| |||||||||||
Remove last integer from end of the CircularIntArray and return it.
| |||||||||||
Remove multiple elements from end of the CircularIntArray, ignore when numOfElements
is less than or equals to 0.
| |||||||||||
Remove multiple integers from front of the CircularIntArray, ignore when numOfElements
is less than or equals to 0.
| |||||||||||
Get number of integers in the CircularIntArray.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Create a CircularIntArray with default capacity.
Create a CircularIntArray with capacity for at least minCapacity elements.
minCapacity | The minimum capacity required for the CircularIntArray. |
---|
Add an integer in front of the CircularIntArray.
e | Integer to add. |
---|
Add an integer at end of the CircularIntArray.
e | Integer to add. |
---|
Remove all integers from the CircularIntArray.
Get nth (0 <= n <= size()-1) integer of the CircularIntArray.
n | The zero based element index in the CircularIntArray. |
---|
ArrayIndexOutOfBoundsException} if n < 0 or n >= size(). |
Get first integer of the CircularIntArray.
ArrayIndexOutOfBoundsException} if CircularIntArray is empty. |
Get last integer of the CircularIntArray.
ArrayIndexOutOfBoundsException} if CircularIntArray is empty. |
Return true if size() is 0.
Remove first integer from front of the CircularIntArray and return it.
ArrayIndexOutOfBoundsException} if CircularIntArray is empty. |
Remove last integer from end of the CircularIntArray and return it.
ArrayIndexOutOfBoundsException} if CircularIntArray is empty. |
Remove multiple elements from end of the CircularIntArray, ignore when numOfElements is less than or equals to 0.
numOfElements | Number of integers to remove. |
---|
ArrayIndexOutOfBoundsException} if numOfElements is larger than
size()
|
Remove multiple integers from front of the CircularIntArray, ignore when numOfElements is less than or equals to 0.
numOfElements | Number of integers to remove. |
---|
ArrayIndexOutOfBoundsException} if numOfElements is larger than
size()
|
Get number of integers in the CircularIntArray.