|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.util.AbstractCollection<E>
org.rutil.collection.SingleLinkedList<E>
public class SingleLinkedList<E>
A light-weight one-way linked list. The size of this list is limited only by the amount of memory available. It implments the collection interface. In addition the size and toArray methods are NOT guranteed to return correct results (in some scenarios).
size: size is tracked by an "int" value and the actual size could exceed Intger.MAX_VALUE, in which case size always return Integer.MAX_VALUE
| Field Summary | |
|---|---|
protected SingleLinkedEntry<E> |
headEntry
|
protected int |
size
|
protected SingleLinkedEntry<E> |
tailEntry
|
| Constructor Summary | |
|---|---|
SingleLinkedList()
|
|
| Method Summary | |
|---|---|
boolean |
add(E element)
Add element to end of the list. |
boolean |
addAll(java.util.Collection<? extends E> c)
Invokes addAll(SingleLinkedList) or addAll(Iterator), depending on the input arg type. |
boolean |
addAll(java.util.Iterator<? extends E> c)
Adds all elements in the iterator. |
void |
addAll(SingleLinkedList<E> list)
Very fast bulk add implementation. |
void |
clear()
|
protected void |
incrementSize(int incrBy)
|
boolean |
isEmpty()
|
java.util.Iterator<E> |
iterator()
A mutable Iterator. |
int |
size()
|
org.rutil.collection.SingleLinkedList.UnmodifiableIterator |
unmodifiableIterator()
|
| Methods inherited from class java.util.AbstractCollection |
|---|
contains, containsAll, remove, removeAll, retainAll, toArray, toArray, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.Collection |
|---|
contains, containsAll, equals, hashCode, remove, removeAll, retainAll, toArray, toArray |
| Field Detail |
|---|
protected int size
protected SingleLinkedEntry<E> headEntry
protected SingleLinkedEntry<E> tailEntry
| Constructor Detail |
|---|
public SingleLinkedList()
| Method Detail |
|---|
public boolean add(E element)
add in interface java.util.Collection<E>add in class java.util.AbstractCollection<E>element -
protected void incrementSize(int incrBy)
public boolean addAll(java.util.Collection<? extends E> c)
addAll in interface java.util.Collection<E>addAll in class java.util.AbstractCollection<E>c - collection of elements
public boolean addAll(java.util.Iterator<? extends E> c)
c - iterator with elements to add.
public void addAll(SingleLinkedList<E> list)
list - public int size()
size in interface java.util.Collection<E>size in class java.util.AbstractCollection<E>public boolean isEmpty()
isEmpty in interface java.util.Collection<E>isEmpty in class java.util.AbstractCollection<E>public java.util.Iterator<E> iterator()
iterator in interface java.lang.Iterable<E>iterator in interface java.util.Collection<E>iterator in class java.util.AbstractCollection<E>public org.rutil.collection.SingleLinkedList.UnmodifiableIterator unmodifiableIterator()
public void clear()
clear in interface java.util.Collection<E>clear in class java.util.AbstractCollection<E>
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||