E
- public class SortedIntList<E> extends Object implements 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
|
boolean |
isEmpty()
Returns true if the list is empty.
|
Iterator<SortedIntList.Node<E>> |
iterator()
Returns an iterator to traverse the list.
Only one iterator can be active per list at any given time. |
boolean |
notEmpty()
Returns true if the list has one or more items.
|
int |
size() |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
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()
iterator
in interface Iterable<SortedIntList.Node<E>>
Copyright © 2019. All rights reserved.