E - Object type (entity).public class LazyList<E>
extends java.lang.Object
implements java.util.List<E>
List that gets Objects from their Box not until they are accessed.
Internally the list is backed by an array of Object IDs.
If the list is set to not cache retrieved Objects, each operation will get the latest version of an Object
from its Box. However, in this mode only a limited set of List operations,
like get or iterator are supported.
If the list is set to cache retrieved Objects, operations will return a previously fetched version of an Object,
which might not equal the latest version in its Box. However, in this mode almost all List
operations are supported. Note that operations that require the whole list, like contains, will fetch all
Objects in this list from the Box at once.
Note: as Objects are fetched on demand, this list returns a null Object if the Object was removed from its Box after this list was created.
| Modifier and Type | Class and Description |
|---|---|
protected class |
LazyList.LazyIterator |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(E object) |
void |
add(int location,
E object) |
boolean |
addAll(java.util.Collection<? extends E> arg0) |
boolean |
addAll(int arg0,
java.util.Collection<? extends E> arg1) |
protected void |
checkCached() |
void |
clear() |
boolean |
contains(java.lang.Object object) |
boolean |
containsAll(java.util.Collection<?> collection) |
E |
get(int location)
Gets and returns the Object at the specified position in this list from its Box.
|
int |
getLoadedCount() |
int |
indexOf(java.lang.Object object) |
boolean |
isEmpty() |
boolean |
isLoadedCompletely() |
java.util.Iterator<E> |
iterator() |
int |
lastIndexOf(java.lang.Object object) |
java.util.ListIterator<E> |
listIterator() |
java.util.ListIterator<E> |
listIterator(int location) |
void |
loadRemaining()
Loads the remaining entities (if any) that were not loaded before.
|
E |
peek(int location)
Like get but does not load the entity if it was not loaded before.
|
E |
remove(int location) |
boolean |
remove(java.lang.Object object) |
boolean |
removeAll(java.util.Collection<?> arg0) |
boolean |
retainAll(java.util.Collection<?> arg0) |
E |
set(int location,
E object) |
int |
size() |
java.util.List<E> |
subList(int start,
int end) |
java.lang.Object[] |
toArray() |
<T> T[] |
toArray(T[] array) |
public void loadRemaining()
protected void checkCached()
public E peek(int location)
public int getLoadedCount()
public boolean isLoadedCompletely()
public boolean add(E object)
public boolean addAll(java.util.Collection<? extends E> arg0)
public boolean addAll(int arg0,
java.util.Collection<? extends E> arg1)
addAll in interface java.util.List<E>public void clear()
public boolean contains(java.lang.Object object)
public boolean containsAll(java.util.Collection<?> collection)
@Nullable public E get(int location)
get in interface java.util.List<E>public int indexOf(java.lang.Object object)
indexOf in interface java.util.List<E>public boolean isEmpty()
public java.util.Iterator<E> iterator()
public int lastIndexOf(java.lang.Object object)
lastIndexOf in interface java.util.List<E>public java.util.ListIterator<E> listIterator()
listIterator in interface java.util.List<E>public java.util.ListIterator<E> listIterator(int location)
listIterator in interface java.util.List<E>public boolean remove(java.lang.Object object)
public boolean removeAll(java.util.Collection<?> arg0)
public boolean retainAll(java.util.Collection<?> arg0)
public int size()
public java.util.List<E> subList(int start, int end)
subList in interface java.util.List<E>public java.lang.Object[] toArray()