protected static interface ThriftyList.ListInternal<T>
Interface for internal helper lists to ThriftyList as instances
are not required to perform bounds checking (all such responsibilities
are delegated to ThriftyList itself).
This interface exists primarily to support the generic static helper
functions
ThriftyList.merge(ListInternal, ListInternal, ListInternal),
ThriftyList.split(ListInternal, ListInternal, ListInternal, boolean)
and ThriftyList.copyTo(ListInternal, ListInternal).
| Modifier and Type | Method and Description |
|---|---|
void |
add(int index,
T item)
Add the specified item to this list at the specified index, shifting
elements of this list if necessary.
|
void |
addAll(ThriftyList.ListInternal<T> source)
Add all elements of the specified source list to this list.
|
void |
addHead(T item)
Add the specified item to the beginning of this list.
|
void |
addSome(ThriftyList.ListInternal<T> source,
int index,
int count)
Add a number of elements from the specified source list, beginning
with the element at the specified index and ending once the specified
count of added elements has been reached, to this list.
|
void |
addTail(T item)
Add the specified item to the end of this list.
|
int |
calculateFreeCapacity() |
int |
capacity() |
void |
clear()
Clear all elements from this list.
|
void |
fill(T[] target,
int targetIndex,
int index,
int count)
Fill the specified array, beginning with the specified index, with
the data of this list.
|
T |
get(int index)
Get the element of this list at the specified index.
|
T |
getHead() |
T |
getTail() |
int |
indexOf(Object o)
Get the index of the first list element equal to the specified
Object.
|
boolean |
isEmpty() |
boolean |
isFull() |
int |
lastIndexOf(Object o)
Get the index of the last element equal to the specified Object.
|
T |
remove(int index)
Remove and return the element of this list at the specified index.
|
T |
removeHead()
Remove the head element of this list.
|
T |
removeTail()
Remove the tail element of this list.
|
T |
set(int index,
T item)
Set the element of this list at the specified index to the specified
item.
|
int |
size() |
void add(int index,
T item)
index - the index at which to add the item.item - the item to add.void addAll(ThriftyList.ListInternal<T> source)
source - the source list.void addHead(T item)
item - the item to add to this list.void addSome(ThriftyList.ListInternal<T> source, int index, int count)
source - the source list.index - the index at which to begin adding elements to this list.count - the number of elements to add to this list.void addTail(T item)
item - the item to add to this list.int calculateFreeCapacity()
int capacity()
void clear()
void fill(T[] target, int targetIndex, int index, int count)
target - the target array.targetIndex - the array index at which to begin filling the target array
with this list's data.index - the index of this list at which to begin filling the
target array.count - the number of elements to copy to the target array.T get(int index)
index - the index of the desired element.T getHead()
T getTail()
int indexOf(Object o)
o - the Object for which to search.boolean isEmpty()
boolean isFull()
int lastIndexOf(Object o)
o - the Object for which to search.T remove(int index)
index - the index of the element to remove.T removeHead()
T removeTail()
T set(int index, T item)
index - the index at which to set the item.item - the item to set to this list.int size()
Copyright © 1994–2024 Peter Murray-Rust. All rights reserved.