|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractCollection
java.util.AbstractList
org.shiftone.exq.impl.util.FastList
implementation of the list interface. This trades off features (remove, resize) in favor of better performance. Sun's implementation of ArrayList resizes itself when it's capacity is reached, which is done with array copying. This list keeps an array of arrays. When the capacity is reached, a new sub array is added to a master array. Was this really necessary?
Nested Class Summary |
Nested classes inherited from class java.util.AbstractList |
|
Field Summary |
Fields inherited from class java.util.AbstractList |
modCount |
Constructor Summary | |
FastList()
equivelant to FastList(8) - creates list with 65,536 element capacity |
|
FastList(int bits)
Creates a list with a max capacity of (2^bits)^2 elelments. |
Method Summary | |
boolean |
add(java.lang.Object element)
Method add |
int |
capacity()
Method capacity |
void |
clear()
Method clear |
java.lang.Object |
get(int i)
Method get |
java.lang.Object |
set(int i,
java.lang.Object element)
Method set |
int |
size()
Method size |
Methods inherited from class java.util.AbstractList |
add, addAll, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, subList |
Methods inherited from class java.util.AbstractCollection |
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.List |
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray |
Constructor Detail |
public FastList(int bits)
bits capacity 5 32 1,024 6 64 4,096 7 128 16,384 8 256 65,536 9 512 262,144 10 1,024 1,048,576 11 2,048 4,194,304 12 4,096 16,777,216 13 8,192 67,108,864 14 16,384 268,435,456 15 32,768 1,073,741,824 16 65,536 4,294,967,296
bits
- public FastList()
Method Detail |
public java.lang.Object set(int i, java.lang.Object element)
i
- element
- public boolean add(java.lang.Object element)
element
- public java.lang.Object get(int i)
i
- public void clear()
public final int capacity()
public final int size()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |