E - public class SortedIntList<E> extends java.lang.Object implements java.lang.Iterable<SortedIntList.Node<E>>
| Modifier and Type | Class and Description |
|---|---|
static class |
SortedIntList.Node<E> |
| Constructor and Description |
|---|
SortedIntList()
Creates an ascending list
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Clears list
|
E |
get(int index)
Retrieves an element at a given index
|
E |
insert(int index,
E value)
Inserts an element into the list at the given index
|
java.util.Iterator<SortedIntList.Node<E>> |
iterator()
Returns an iterator to traverse the list.
Only one iterator can be active per list at any given time. |
int |
size() |
public E insert(int index, E value)
index - Index of the elementvalue - Element to insertpublic E get(int index)
index - Index of the element to retrievepublic void clear()
public int size()
public java.util.Iterator<SortedIntList.Node<E>> iterator()
iterator in interface java.lang.Iterable<SortedIntList.Node<E>>