|
© 2002 BEA Systems, Inc. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.beasys.commerce.ebusiness.util.DefaultScrollableModel
This is the default implementation of the
scrollable model interface. It should serve most
requirements for a scrollable model.
It keeps all the primary keys used to get any
value objects and caches a number of pages of
value objects.
It uses a PageRetriever each time there is a page
fault (i.e. a requested page is not cached in)
to get the associated value objects.
ScrollableModel
,
ScrollableModelPageRetriever
, Serialized FormField Summary | |
protected int |
cacheSize
|
protected int |
count
|
protected int |
currentFirstIndex
|
protected int |
currentLastIndex
|
protected java.lang.Object[] |
currentPrimaryKeys
|
protected java.lang.Object[] |
currentValues
|
static int |
DEFAULT_NB_PAGES
|
static int |
DEFAULT_PAGE_SIZE
|
protected int |
nbPages
|
protected ScrollableModelPageRetriever |
pageRetriever
|
protected int |
pageSize
|
protected java.lang.Object[] |
primaryKeys
|
protected java.lang.Class |
valueClass
|
Constructor Summary | |
DefaultScrollableModel(java.lang.Object[] primaryKeys,
int nbPages,
int pageSize,
ScrollableModelPageRetriever pageRetriever)
This constructor needs the primary keys the scrollable model will manage, how to configure the pages, and which ScrollableModelPageRetriever to use on a page fault. |
|
DefaultScrollableModel(java.lang.Object[] primaryKeys,
ScrollableModelPageRetriever pageRetriever)
This constructor uses the default number of pages in the cache and the default number of items in a page. |
Method Summary | |
int |
getCount()
gets the total number of elements managed by the Scrollable Model. |
java.lang.Class |
getModelClass()
All objects managed by the scrollable model are of the same class. |
int |
getNbPages()
Gets the total number of pages over the scrollable model |
java.lang.Object[] |
getPage(int pageIndex)
Gets a page worth of Objects, given a page index. |
int |
getPageSize()
gets the page size for an instance of a scrollable model i.e. |
java.lang.Object |
getValueAt(int valueIndex)
Gets the value (hopefully a value object) based on the index the value |
void |
setValueAt(java.io.Serializable value,
int valueIndex)
This is an empty implementation of setValueAt It is here only to implement the ScrollableModel interface. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public static final int DEFAULT_PAGE_SIZE
public static final int DEFAULT_NB_PAGES
protected int count
protected java.lang.Object[] primaryKeys
protected java.lang.Class valueClass
protected java.lang.Object[] currentValues
protected int currentFirstIndex
protected int currentLastIndex
protected int pageSize
protected int nbPages
protected int cacheSize
protected java.lang.Object[] currentPrimaryKeys
protected ScrollableModelPageRetriever pageRetriever
Constructor Detail |
public DefaultScrollableModel(java.lang.Object[] primaryKeys, int nbPages, int pageSize, ScrollableModelPageRetriever pageRetriever)
primaryKeys,
- an array of pks over the managed objectsnbPages,
- the number of pages in the cache (not overall!)pageSize,
- the size of a pagepublic DefaultScrollableModel(java.lang.Object[] primaryKeys, ScrollableModelPageRetriever pageRetriever)
primaryKeys,
- an array of pks over the managed objectsMethod Detail |
public int getCount()
public int getNbPages()
public int getPageSize()
public java.lang.Class getModelClass()
public java.lang.Object getValueAt(int valueIndex)
valueIndex,
- the index for the value to retrievepublic java.lang.Object[] getPage(int pageIndex)
pageIndex,
- the index in the list of pagespublic void setValueAt(java.io.Serializable value, int valueIndex)
value,
- the 'value object' at a location in the listvalueIndex,
- the location of the value object in the list
|
© 2002 BEA Systems, Inc. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |