public abstract class AbstractLazyLoadList extends Object implements List
retrieveObjectForIndex()method to retrieve the object at the specified index from whatever datasource is being used, and to implement the
getSize()method to return the size of the list. The "datasource" could be results for a query, or a connection to a datastore, or whatever ... just a source of objects. TODO Change Localised message numbers to be generic
Modifier and Type | Field and Description |
---|---|
protected int |
size
Cached size of the list.
|
Constructor and Description |
---|
AbstractLazyLoadList(String cacheType)
Constructor for a lazy load list.
|
Modifier and Type | Method and Description |
---|---|
void |
add(int index,
Object element) |
boolean |
add(Object e) |
boolean |
addAll(Collection c) |
boolean |
addAll(int index,
Collection c) |
void |
clear() |
boolean |
contains(Object o) |
boolean |
containsAll(Collection c) |
Object |
get(int index) |
protected abstract int |
getSize()
Method to return the size of the list.
|
int |
indexOf(Object o) |
boolean |
isEmpty() |
protected boolean |
isOpen()
Accessor whether the list is open.
|
Iterator |
iterator() |
int |
lastIndexOf(Object o) |
ListIterator |
listIterator() |
ListIterator |
listIterator(int index) |
Object |
remove(int index) |
boolean |
remove(Object o) |
boolean |
removeAll(Collection c) |
boolean |
retainAll(Collection c) |
protected abstract Object |
retrieveObjectForIndex(int index)
Accessor to retrieve the object at an index.
|
Object |
set(int index,
Object element) |
int |
size() |
List |
subList(int fromIndex,
int toIndex) |
Object[] |
toArray() |
Object[] |
toArray(Object[] a) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
equals, hashCode, replaceAll, sort, spliterator
parallelStream, removeIf, stream
public AbstractLazyLoadList(String cacheType)
cacheType
- Type of caching of objects in the listprotected abstract Object retrieveObjectForIndex(int index)
index
- The list indexprotected abstract int getSize()
protected boolean isOpen()
public boolean add(Object e)
add
in interface Collection
add
in interface List
public boolean addAll(Collection c)
addAll
in interface Collection
addAll
in interface List
public boolean addAll(int index, Collection c)
public void clear()
clear
in interface Collection
clear
in interface List
public boolean contains(Object o)
contains
in interface Collection
contains
in interface List
public boolean containsAll(Collection c)
containsAll
in interface Collection
containsAll
in interface List
public boolean isEmpty()
isEmpty
in interface Collection
isEmpty
in interface List
public Iterator iterator()
public int lastIndexOf(Object o)
lastIndexOf
in interface List
public ListIterator listIterator()
listIterator
in interface List
public ListIterator listIterator(int index)
listIterator
in interface List
public boolean remove(Object o)
remove
in interface Collection
remove
in interface List
public boolean removeAll(Collection c)
removeAll
in interface Collection
removeAll
in interface List
public boolean retainAll(Collection c)
retainAll
in interface Collection
retainAll
in interface List
public int size()
size
in interface Collection
size
in interface List
public Object[] toArray()
toArray
in interface Collection
toArray
in interface List
Copyright © 2015. All rights reserved.