|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.granite.client.tide.collections.AbstractPagedCollection<E>
public abstract class AbstractPagedCollection<E>
| Nested Class Summary | |
|---|---|
class |
AbstractPagedCollection.PagedCollectionIterator
|
class |
AbstractPagedCollection.PagedCollectionResponder
|
| Field Summary | |
|---|---|
protected int |
count
|
protected boolean |
filterRefresh
|
protected int |
first
|
protected boolean |
fullRefresh
|
protected boolean |
initializing
|
protected int |
last
|
protected int |
max
|
| Constructor Summary | |
|---|---|
AbstractPagedCollection()
|
|
| Method Summary | |
|---|---|
boolean |
add(E e)
|
void |
add(int index,
E element)
|
boolean |
addAll(Collection<? extends E> c)
|
boolean |
addAll(int index,
Collection<? extends E> c)
|
void |
clear()
Clear collection content |
boolean |
contains(Object o)
|
boolean |
containsAll(Collection<?> c)
|
protected void |
find(int first,
int last)
Abstract method: trigger a results query for the current filter |
protected void |
findFault(TideFaultEvent event,
int first,
int max)
|
protected void |
findResult(TideResultEvent<?> event,
int first,
int max)
|
protected abstract void |
firePageChange(TideRpcEvent event)
Notify listeners of remote page result |
boolean |
fullRefresh()
Force refresh of collection when filter/sort have been changed |
E |
get(int index)
Override of getItemAt with ItemPendingError management |
protected abstract List<E> |
getInternalWrappedList()
|
protected abstract org.granite.tide.data.model.Page<E> |
getResult(TideResultEvent<?> event,
int first,
int max)
Build a result object from the result event |
protected abstract List<E> |
getWrappedList()
|
void |
handleEvent(TideEvent event)
|
protected void |
handleFault(TideFaultEvent event)
|
protected void |
handleResult(org.granite.tide.data.model.Page<E> page,
TideResultEvent<?> event,
int first,
int max)
|
int |
indexOf(Object o)
|
protected void |
initialize(TideResultEvent<?> event)
|
boolean |
isEmpty()
|
Iterator<E> |
iterator()
|
int |
lastIndexOf(Object o)
|
ListIterator<E> |
listIterator()
|
ListIterator<E> |
listIterator(int index)
|
boolean |
refresh()
Refresh collection with new filter/sort parameters |
E |
remove(int index)
|
boolean |
remove(Object o)
|
boolean |
removeAll(Collection<?> c)
|
boolean |
retainAll(Collection<?> c)
|
E |
set(int index,
E element)
|
void |
setElementClass(Class<? extends E> elementClass)
|
void |
setMaxResults(int max)
Set the page size. |
int |
size()
Get total number of elements |
List<E> |
subList(int fromIndex,
int toIndex)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface java.util.List |
|---|
equals, hashCode, toArray, toArray |
| Field Detail |
|---|
protected boolean initializing
protected int first
protected int last
protected int max
protected int count
protected boolean fullRefresh
protected boolean filterRefresh
| Constructor Detail |
|---|
public AbstractPagedCollection()
| Method Detail |
|---|
public int size()
size in interface Collection<E>size in interface List<E>public void setMaxResults(int max)
max - maximum number of requested elementspublic void setElementClass(Class<? extends E> elementClass)
public void handleEvent(TideEvent event)
handleEvent in interface TideEventObserver@PreDestroy public void clear()
clear in interface Collection<E>clear in interface List<E>
protected void find(int first,
int last)
first - : index of first required resultlast - : index of last required resultpublic boolean fullRefresh()
public boolean refresh()
protected abstract org.granite.tide.data.model.Page<E> getResult(TideResultEvent<?> event,
int first,
int max)
event - the result eventfirst - first index requestedmax - max elements requested
protected abstract void firePageChange(TideRpcEvent event)
event - the remote event (ResultEvent or FaultEvent)protected void initialize(TideResultEvent<?> event)
the - result event of the first find
protected void findResult(TideResultEvent<?> event,
int first,
int max)
event - the result eventfirst - first requested indexmax - max elements requested
protected void handleResult(org.granite.tide.data.model.Page<E> page,
TideResultEvent<?> event,
int first,
int max)
result - the result objectevent - the result event
protected void findFault(TideFaultEvent event,
int first,
int max)
event - the fault eventfirst - first requested indexmax - max elements requestedprotected void handleFault(TideFaultEvent event)
event - the fault eventprotected abstract List<E> getInternalWrappedList()
protected abstract List<E> getWrappedList()
public E get(int index)
get in interface List<E>index - index of requested itemprefetch - not used
public boolean isEmpty()
isEmpty in interface Collection<E>isEmpty in interface List<E>public boolean contains(Object o)
contains in interface Collection<E>contains in interface List<E>public boolean containsAll(Collection<?> c)
containsAll in interface Collection<E>containsAll in interface List<E>public int indexOf(Object o)
indexOf in interface List<E>public int lastIndexOf(Object o)
lastIndexOf in interface List<E>public Iterator<E> iterator()
iterator in interface Iterable<E>iterator in interface Collection<E>iterator in interface List<E>public ListIterator<E> listIterator()
listIterator in interface List<E>public ListIterator<E> listIterator(int index)
listIterator in interface List<E>public boolean add(E e)
add in interface Collection<E>add in interface List<E>
public void add(int index,
E element)
add in interface List<E>public boolean addAll(Collection<? extends E> c)
addAll in interface Collection<E>addAll in interface List<E>
public boolean addAll(int index,
Collection<? extends E> c)
addAll in interface List<E>public boolean remove(Object o)
remove in interface Collection<E>remove in interface List<E>public E remove(int index)
remove in interface List<E>public boolean removeAll(Collection<?> c)
removeAll in interface Collection<E>removeAll in interface List<E>public boolean retainAll(Collection<?> c)
retainAll in interface Collection<E>retainAll in interface List<E>
public E set(int index,
E element)
set in interface List<E>
public List<E> subList(int fromIndex,
int toIndex)
subList in interface List<E>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||