com.beasys.commerce.ebusiness.util
Class DefaultScrollableModel

java.lang.Object
  extended by com.beasys.commerce.ebusiness.util.DefaultScrollableModel
All Implemented Interfaces
ScrollableModel, Serializable

Deprecated See BEA Commerce product offering

@Deprecated
public class DefaultScrollableModel
extends Object
implements ScrollableModel

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.

See Also
ScrollableModel, ScrollableModelPageRetriever, Serialized Form

Field Summary
protected  int cacheSize
          Deprecated See BEA Commerce product offering
protected  int count
          Deprecated See BEA Commerce product offering
protected  int currentFirstIndex
          Deprecated See BEA Commerce product offering
protected  int currentLastIndex
          Deprecated See BEA Commerce product offering
protected  Object[] currentPrimaryKeys
          Deprecated See BEA Commerce product offering
protected  Object[] currentValues
          Deprecated See BEA Commerce product offering
static int DEFAULT_NB_PAGES
          Deprecated See BEA Commerce product offering
static int DEFAULT_PAGE_SIZE
          Deprecated See BEA Commerce product offering
protected  int nbPages
          Deprecated See BEA Commerce product offering
protected  ScrollableModelPageRetriever pageRetriever
          Deprecated See BEA Commerce product offering
protected  int pageSize
          Deprecated See BEA Commerce product offering
protected  Object[] primaryKeys
          Deprecated See BEA Commerce product offering
protected  Class valueClass
          Deprecated See BEA Commerce product offering
 
Constructor Summary
DefaultScrollableModel(Object[] primaryKeys, int nbPages, int pageSize, ScrollableModelPageRetriever pageRetriever)
          Deprecated See BEA Commerce product offering
DefaultScrollableModel(Object[] primaryKeys, ScrollableModelPageRetriever pageRetriever)
          Deprecated See BEA Commerce product offering
 
Method Summary
 int getCount()
          Deprecated See BEA Commerce product offering
 Class getModelClass()
          Deprecated See BEA Commerce product offering
 int getNbPages()
          Deprecated See BEA Commerce product offering
 Object[] getPage(int pageIndex)
          Deprecated See BEA Commerce product offering
 int getPageSize()
          Deprecated See BEA Commerce product offering
 Object getValueAt(int valueIndex)
          Deprecated See BEA Commerce product offering
 void setValueAt(Serializable value, int valueIndex)
          Deprecated See BEA Commerce product offering
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_PAGE_SIZE

public static final int DEFAULT_PAGE_SIZE
Deprecated See BEA Commerce product offering
See Also
Constants Summary

DEFAULT_NB_PAGES

public static final int DEFAULT_NB_PAGES
Deprecated See BEA Commerce product offering
See Also
Constants Summary

count

protected int count
Deprecated See BEA Commerce product offering

primaryKeys

protected Object[] primaryKeys
Deprecated See BEA Commerce product offering

valueClass

protected Class valueClass
Deprecated See BEA Commerce product offering

currentValues

protected Object[] currentValues
Deprecated See BEA Commerce product offering

currentFirstIndex

protected int currentFirstIndex
Deprecated See BEA Commerce product offering

currentLastIndex

protected int currentLastIndex
Deprecated See BEA Commerce product offering

pageSize

protected int pageSize
Deprecated See BEA Commerce product offering

nbPages

protected int nbPages
Deprecated See BEA Commerce product offering

cacheSize

protected int cacheSize
Deprecated See BEA Commerce product offering

currentPrimaryKeys

protected Object[] currentPrimaryKeys
Deprecated See BEA Commerce product offering

pageRetriever

protected ScrollableModelPageRetriever pageRetriever
Deprecated See BEA Commerce product offering
Constructor Detail

DefaultScrollableModel

public DefaultScrollableModel(Object[] primaryKeys,
                              int nbPages,
                              int pageSize,
                              ScrollableModelPageRetriever pageRetriever)
Deprecated See BEA Commerce product offering

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.

Parameters
primaryKeys, - an array of pks over the managed objects
nbPages, - the number of pages in the cache (not overall!)
pageSize, - the size of a page
pageRetriever - the page fault resolver

DefaultScrollableModel

public DefaultScrollableModel(Object[] primaryKeys,
                              ScrollableModelPageRetriever pageRetriever)
Deprecated See BEA Commerce product offering

This constructor uses the default number of pages in the cache and the default number of items in a page.

Parameters
primaryKeys, - an array of pks over the managed objects
pageRetriever - the page fault resolver
Method Detail

getCount

public int getCount()
Deprecated See BEA Commerce product offering

gets the total number of elements managed by the Scrollable Model.

Specified by:
getCount in interface ScrollableModel
Returns
the count of all elements.

getNbPages

public int getNbPages()
Deprecated See BEA Commerce product offering

Gets the total number of pages over the scrollable model

Specified by:
getNbPages in interface ScrollableModel
Returns
the number of pages

getPageSize

public int getPageSize()
Deprecated See BEA Commerce product offering

gets the page size for an instance of a scrollable model i.e. '10' means 10 value objects are kept in one page.

Specified by:
getPageSize in interface ScrollableModel
Returns
the size of all pages

getModelClass

public Class getModelClass()
Deprecated See BEA Commerce product offering

All objects managed by the scrollable model are of the same class. This method retrieves that class

Specified by:
getModelClass in interface ScrollableModel
Returns
the Class of all objects managed by the scrollable model.

getValueAt

public Object getValueAt(int valueIndex)
Deprecated See BEA Commerce product offering

Gets the value (hopefully a value object) based on the index the value

Specified by:
getValueAt in interface ScrollableModel
Parameters
valueIndex, - the index for the value to retrieve
Returns
the corresponding value as an Object

getPage

public Object[] getPage(int pageIndex)
Deprecated See BEA Commerce product offering

Gets a page worth of Objects, given a page index.

Specified by:
getPage in interface ScrollableModel
Parameters
pageIndex, - the index in the list of pages
Returns
an array of objects for that page.

setValueAt

public void setValueAt(Serializable value,
                       int valueIndex)
Deprecated See BEA Commerce product offering

This is an empty implementation of setValueAt It is here only to implement the ScrollableModel interface.

Specified by:
setValueAt in interface ScrollableModel
Parameters
value, - the 'value object' at a location in the list
valueIndex, - the location of the value object in the list


Copyright © 2008 BEA Systems, Inc. All Rights Reserved