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 static Localiser |
LOCALISER
Localiser for messages.
|
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) |
protected static final Localiser LOCALISER
protected int size
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 Collectionadd in interface Listpublic boolean addAll(Collection c)
addAll in interface CollectionaddAll in interface Listpublic boolean addAll(int index,
Collection c)
public void clear()
clear in interface Collectionclear in interface Listpublic boolean contains(Object o)
contains in interface Collectioncontains in interface Listpublic boolean containsAll(Collection c)
containsAll in interface CollectioncontainsAll in interface Listpublic boolean isEmpty()
isEmpty in interface CollectionisEmpty in interface Listpublic Iterator iterator()
public int lastIndexOf(Object o)
lastIndexOf in interface Listpublic ListIterator listIterator()
listIterator in interface Listpublic ListIterator listIterator(int index)
listIterator in interface Listpublic boolean remove(Object o)
remove in interface Collectionremove in interface Listpublic boolean removeAll(Collection c)
removeAll in interface CollectionremoveAll in interface Listpublic boolean retainAll(Collection c)
retainAll in interface CollectionretainAll in interface Listpublic int size()
size in interface Collectionsize in interface Listpublic Object[] toArray()
toArray in interface CollectiontoArray in interface ListCopyright © 2013. All Rights Reserved.