|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractCollection<E>
java.util.AbstractList
org.jibx.util.LazyList
public class LazyList
List implementation with lazy array construction and modification tracking. The lazy array construction is a minor optimization, to save the added overhead of a backing array for lists which are frequently empty. The modification tracking feature supports filtered list construction with result caching.
Field Summary | |
---|---|
static java.util.Iterator |
EMPTY_ITERATOR
Singleton iterator for empty collection. |
static LazyList |
EMPTY_LIST
Unmodifiable empty list instance. |
private java.lang.Object[] |
m_array
Backing array (lazy instantiation, null if not used). |
private int |
m_limit
Maximum number of items allowed before resizing. |
private int |
m_size
Number of items currently present in list. |
Fields inherited from class java.util.AbstractList |
---|
modCount |
Constructor Summary | |
---|---|
LazyList()
|
Method Summary | |
---|---|
void |
add(int index,
java.lang.Object element)
|
void |
compact()
Compact the list, removing any null values. |
java.lang.Object |
get(int index)
|
int |
getModCount()
Get modify counter. |
java.util.Iterator |
iterator()
|
private void |
makeSpace(int count)
Make sure space is available for adding to the list. |
java.lang.Object |
remove(int index)
|
void |
remove(int from,
int to)
Remove range of values. |
protected void |
removeRange(int from,
int to)
|
java.lang.Object |
set(int index,
java.lang.Object element)
|
int |
size()
|
Methods inherited from class java.util.AbstractList |
---|
add, addAll, clear, equals, hashCode, indexOf, lastIndexOf, listIterator, listIterator, 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 |
Field Detail |
---|
public static final java.util.Iterator EMPTY_ITERATOR
public static final LazyList EMPTY_LIST
private int m_size
private int m_limit
private java.lang.Object[] m_array
null
if not used).
Constructor Detail |
---|
public LazyList()
Method Detail |
---|
private void makeSpace(int count)
count
- public java.lang.Object get(int index)
get
in interface java.util.List
get
in class java.util.AbstractList
public int size()
size
in interface java.util.Collection
size
in interface java.util.List
size
in class java.util.AbstractCollection
public void add(int index, java.lang.Object element)
add
in interface java.util.List
add
in class java.util.AbstractList
public java.util.Iterator iterator()
iterator
in interface java.lang.Iterable
iterator
in interface java.util.Collection
iterator
in interface java.util.List
iterator
in class java.util.AbstractList
public java.lang.Object remove(int index)
remove
in interface java.util.List
remove
in class java.util.AbstractList
public java.lang.Object set(int index, java.lang.Object element)
set
in interface java.util.List
set
in class java.util.AbstractList
protected void removeRange(int from, int to)
removeRange
in class java.util.AbstractList
public int getModCount()
public void remove(int from, int to)
removeRange(int, int)
from
- to
- public void compact()
null
values.
|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |