public class LazyList
extends java.util.AbstractList
| Modifier and Type | Field and Description |
|---|---|
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.
|
| Constructor and Description |
|---|
LazyList() |
| Modifier and Type | Method and Description |
|---|---|
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() |
add, addAll, clear, equals, hashCode, indexOf, lastIndexOf, listIterator, listIterator, subListaddAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toStringpublic 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).private void makeSpace(int count)
count - public java.lang.Object get(int index)
get in interface java.util.Listget in class java.util.AbstractListpublic int size()
size in interface java.util.Collectionsize in interface java.util.Listsize in class java.util.AbstractCollectionpublic void add(int index,
java.lang.Object element)
add in interface java.util.Listadd in class java.util.AbstractListpublic java.util.Iterator iterator()
iterator in interface java.lang.Iterableiterator in interface java.util.Collectioniterator in interface java.util.Listiterator in class java.util.AbstractListpublic java.lang.Object remove(int index)
remove in interface java.util.Listremove in class java.util.AbstractListpublic java.lang.Object set(int index,
java.lang.Object element)
set in interface java.util.Listset in class java.util.AbstractListprotected void removeRange(int from,
int to)
removeRange in class java.util.AbstractListpublic int getModCount()
public void remove(int from,
int to)
removeRange(int, int)from - to - public void compact()
null values.