public interface IndexList<E>
Modifier and Type | Method and Description |
---|---|
void |
add(int i,
E e)
Inserts an element e to be at index i, shifting all elements after this.
|
E |
get(int i)
Returns the element at index i, without removing it.
|
boolean |
isEmpty()
Returns whether the list is empty.
|
E |
remove(int i)
Removes and returns the element at index i, shifting the elements after this.
|
E |
set(int i,
E e)
Replaces the element at index i with e, returning the previous element at i.
|
int |
size()
Returns the number of elements in this list.
|
void add(int i, E e) throws java.lang.IndexOutOfBoundsException
java.lang.IndexOutOfBoundsException
E get(int i) throws java.lang.IndexOutOfBoundsException
java.lang.IndexOutOfBoundsException
boolean isEmpty()
E remove(int i) throws java.lang.IndexOutOfBoundsException
java.lang.IndexOutOfBoundsException
E set(int i, E e) throws java.lang.IndexOutOfBoundsException
java.lang.IndexOutOfBoundsException
int size()