Project Wonder 5.0

er.extensions.batching
Class AbstractBatchingList

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList
          extended by er.extensions.batching.AbstractBatchingList
All Implemented Interfaces:
IBatchingList, java.lang.Iterable, java.util.Collection, java.util.List

public abstract class AbstractBatchingList
extends java.util.AbstractList
implements IBatchingList

Partial implementation of the IBatchingList interface that handles page invalidation and most of the List interface.

Author:
mschrag

Field Summary
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
AbstractBatchingList()
           
 
Method Summary
protected  void ensurePageLoaded(int index)
           
 java.lang.Object get(int index)
           
protected abstract  java.lang.Object getFromPage(int index)
          Returns the index'th element from the current page.
protected abstract  int getTotalCount()
          Returns the total size of this list.
protected abstract  void invalidatePage()
          Invalidates the current page of objects, requiring a reload.
protected abstract  boolean isPageLoaded()
          Returns whether or not the current page has been loaded.
protected abstract  void loadPage(int startingIndex, int pageSize, com.webobjects.foundation.NSArray sortOrderings)
          Loads one page into this list.
 void setPageIndex(int pageIndex)
          Sets the page number that is currently being viewed on this list.
 void setPageSize(int pageSize)
          Sets the page size of this list.
 void setSortOrderings(com.webobjects.foundation.NSArray sortOrderings)
          Sets the sort orderings of this list.
 int size()
           
 
Methods inherited from class java.util.AbstractList
add, add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subList
 
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
add, add, addAll, addAll, clear, contains, containsAll, equals, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, retainAll, set, subList, toArray, toArray
 

Constructor Detail

AbstractBatchingList

public AbstractBatchingList()
Method Detail

isPageLoaded

protected abstract boolean isPageLoaded()
Returns whether or not the current page has been loaded.


loadPage

protected abstract void loadPage(int startingIndex,
                                 int pageSize,
                                 com.webobjects.foundation.NSArray sortOrderings)
Loads one page into this list.

Parameters:
startingIndex - the index of the first element of the page (in element units, not page units)
pageSize - the size of the page to load
sortOrderings - the list of sort orderings

invalidatePage

protected abstract void invalidatePage()
Invalidates the current page of objects, requiring a reload.


getTotalCount

protected abstract int getTotalCount()
Returns the total size of this list.


getFromPage

protected abstract java.lang.Object getFromPage(int index)
Returns the index'th element from the current page.

Parameters:
index - the index of the element to return
Returns:
the element

ensurePageLoaded

protected void ensurePageLoaded(int index)

get

public java.lang.Object get(int index)
Specified by:
get in interface java.util.List
Specified by:
get in class java.util.AbstractList

size

public int size()
Specified by:
size in interface java.util.Collection
Specified by:
size in interface java.util.List
Specified by:
size in class java.util.AbstractCollection

setPageIndex

public void setPageIndex(int pageIndex)
Description copied from interface: IBatchingList
Sets the page number that is currently being viewed on this list.

Specified by:
setPageIndex in interface IBatchingList
Parameters:
pageIndex - the page number

setPageSize

public void setPageSize(int pageSize)
Description copied from interface: IBatchingList
Sets the page size of this list.

Specified by:
setPageSize in interface IBatchingList
Parameters:
pageSize - the page size

setSortOrderings

public void setSortOrderings(com.webobjects.foundation.NSArray sortOrderings)
Description copied from interface: IBatchingList
Sets the sort orderings of this list.

Specified by:
setSortOrderings in interface IBatchingList
Parameters:
sortOrderings - the sort orderings array

Last updated: Tue, Feb 21, 2017 • 05:45 PM CET

Copyright © 2002 – 2007 Project Wonder.