E - public class SortedIntList<E> extends Object implements Iterable<SortedIntList.Node<E>>
| Modifier and Type | Class and Description |
|---|---|
class |
SortedIntList.Iterator |
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
|
boolean |
isEmpty()
Returns true if the list is empty.
|
Iterator<SortedIntList.Node<E>> |
iterator()
Returns an iterator to traverse the list.
|
boolean |
notEmpty()
Returns true if the list has one or more items.
|
int |
size() |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, spliterator@Null 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 boolean notEmpty()
public boolean isEmpty()
public Iterator<SortedIntList.Node<E>> iterator()
If Collections.allocateIterators is false, the same iterator instance is returned each time this method is called.
Use the SortedIntList.Iterator constructor for nested or multithreaded iteration.
iterator in interface Iterable<SortedIntList.Node<E>>Copyright © 2021. All rights reserved.