public class DeferedCollection<T>
extends java.lang.Object
implements java.util.Collection<T>
Collection
that returns the view of objects which are actually fetched
lazily from an Iterator
.Modifier and Type | Field and Description |
---|---|
private java.util.List<T> |
archive
Stores values that are already fetched from
result . |
private java.util.Iterator<T> |
result
The iterator that lazily evaluates SCD query.
|
Constructor and Description |
---|
DeferedCollection(java.util.Iterator<T> result) |
Modifier and Type | Method and Description |
---|---|
boolean |
add(T o) |
boolean |
addAll(java.util.Collection<? extends T> c) |
void |
clear() |
boolean |
contains(java.lang.Object o) |
boolean |
containsAll(java.util.Collection<?> c) |
private void |
fetch()
Fetches another item from {@link
|
private void |
fetchAll() |
boolean |
isEmpty() |
java.util.Iterator<T> |
iterator() |
boolean |
remove(java.lang.Object o) |
boolean |
removeAll(java.util.Collection<?> c) |
boolean |
retainAll(java.util.Collection<?> c) |
int |
size() |
java.lang.Object[] |
toArray() |
<T> T[] |
toArray(T[] a) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
private final java.util.Iterator<T> result
public DeferedCollection(java.util.Iterator<T> result)
public boolean isEmpty()
isEmpty
in interface java.util.Collection<T>
public int size()
size
in interface java.util.Collection<T>
public boolean contains(java.lang.Object o)
contains
in interface java.util.Collection<T>
public boolean containsAll(java.util.Collection<?> c)
containsAll
in interface java.util.Collection<T>
public java.util.Iterator<T> iterator()
public java.lang.Object[] toArray()
toArray
in interface java.util.Collection<T>
public <T> T[] toArray(T[] a)
toArray
in interface java.util.Collection<T>
private void fetchAll()
private void fetch()
public boolean remove(java.lang.Object o)
remove
in interface java.util.Collection<T>
public boolean addAll(java.util.Collection<? extends T> c)
addAll
in interface java.util.Collection<T>
public boolean removeAll(java.util.Collection<?> c)
removeAll
in interface java.util.Collection<T>
public boolean retainAll(java.util.Collection<?> c)
retainAll
in interface java.util.Collection<T>
public void clear()
clear
in interface java.util.Collection<T>