Constructor and Description |
---|
ArrayIndexList()
Creates the indexed list with initial capacity 16.
|
Modifier and Type | Method and Description |
---|---|
void |
add(int r,
E e)
Inserts an element at the given index.
|
E |
get(int r)
Returns the element stored at the given index.
|
boolean |
isEmpty()
Returns whether the indexed list is empty.
|
E |
remove(int r)
Removes the element stored at the given index.
|
E |
set(int r,
E e)
Replaces the element stored at the given index.
|
int |
size()
Returns the number of elements in the indexed list.
|
public ArrayIndexList()
public void add(int r, E e) throws java.lang.IndexOutOfBoundsException
public E get(int r) throws java.lang.IndexOutOfBoundsException
public boolean isEmpty()
public E remove(int r) throws java.lang.IndexOutOfBoundsException
public E set(int r, E e) throws java.lang.IndexOutOfBoundsException