|
net.datastructures - version 5.0 | |||||||
| 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. //end#fragment vector
| 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. |
protected void |
checkIndex(int r,
int n)
Checks whether the given index is in the range [0, n - 1] |
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 |
|---|
clone, equals, finalize, 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 IndexOutOfBoundsException
get in interface IndexList<E>IndexOutOfBoundsException
public E set(int r,
E e)
throws IndexOutOfBoundsException
set in interface IndexList<E>IndexOutOfBoundsException
public void add(int r,
E e)
throws IndexOutOfBoundsException
add in interface IndexList<E>IndexOutOfBoundsException
public E remove(int r)
throws IndexOutOfBoundsException
remove in interface IndexList<E>IndexOutOfBoundsException
protected void checkIndex(int r,
int n)
throws IndexOutOfBoundsException
IndexOutOfBoundsException
|
net.datastructures - version 5.0 | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||