|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.datastructures.ArrayIndexList<E>
public class ArrayIndexList<E>
Realization of an indexed list by means of an array, which is doubled when the size of the indexed list exceeds the capacity of the array.
Constructor Summary | |
---|---|
ArrayIndexList()
Creates the indexed list with initial capacity 16. |
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ArrayIndexList()
Method Detail |
---|
public int size()
size
in interface IndexList<E>
public boolean isEmpty()
isEmpty
in interface IndexList<E>
public E get(int r) throws java.lang.IndexOutOfBoundsException
get
in interface IndexList<E>
java.lang.IndexOutOfBoundsException
public E set(int r, E e) throws java.lang.IndexOutOfBoundsException
set
in interface IndexList<E>
java.lang.IndexOutOfBoundsException
public void add(int r, E e) throws java.lang.IndexOutOfBoundsException
add
in interface IndexList<E>
java.lang.IndexOutOfBoundsException
public E remove(int r) throws java.lang.IndexOutOfBoundsException
remove
in interface IndexList<E>
java.lang.IndexOutOfBoundsException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |