© 2002 BEA Systems, Inc.


com.beasys.commerce.ebusiness.catalog
Class CatalogItemIterator

java.lang.Object
  |
  +--com.beasys.commerce.ebusiness.catalog.CatalogItemIterator
Direct Known Subclasses:
CategoryItemIterator, CategoryIterator, OrphanedItemIterator, ProductItemIterator, SearchItemIterator, SiblingIterator, SubCategoryIterator

public abstract class CatalogItemIterator
extends java.lang.Object
implements ViewIterator, java.io.Serializable

The CatalogItemIterator is an abstract base class that all catalog iterators must extend. This class should only be used by a single thread.

See Also:
View, ViewIterator, Serialized Form

Field Summary
static int DEFAULT_VIEW_SIZE
           
protected static boolean VERBOSE
           
 
Constructor Summary
CatalogItemIterator(java.lang.String managerJndiName, CatalogRequest catalogRequest, int numItems, int viewSize)
          CatalogItemIterator constructor that takes the total number of spanned objects and a view size.
 
Method Summary
protected abstract  CatalogItem getCatalogItem(View view, int itemIndex)
          Returns a CatalogItem within the current view.
protected  CatalogManager getCatalogManager()
           
protected  CatalogQueryManager getCatalogQueryManager()
           
protected  CatalogRequest getCatalogRequest()
           
protected  CategoryManager getCategoryManager()
           
 View getCurrentView()
          Returns the current view.
protected  CustomDataManager getCustomDataManager()
           
protected  ProductItemManager getProductItemManager()
           
 View getViewAt(int index)
          Gets the view at the specified index.
 int getViewCount()
          Returns the number of views spanned by this iterator.
 void gotoNextView()
          Moves the iterator to the next view.
 void gotoPreviousView()
          Moves the iterator to the previous view.
 void gotoViewAt(int index)
          Moves the iterator to the view at the specified index.
 boolean hasNext()
          Returns true if the iterator has more elements.
 boolean hasNextView()
          Returns true if the iterator has a next view.
 boolean hasPreviousView()
          Returns true if the iterator has a previous view.
 java.lang.Object next()
          Returns the next element in the iteration.
protected abstract  void refreshView(View view)
          This function is called whenever the current view needs to be refreshed.
 int size()
          Returns the number of objects over which the iterator spans.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VERBOSE

protected static final boolean VERBOSE

DEFAULT_VIEW_SIZE

public static final int DEFAULT_VIEW_SIZE
Constructor Detail

CatalogItemIterator

public CatalogItemIterator(java.lang.String managerJndiName,
                           CatalogRequest catalogRequest,
                           int numItems,
                           int viewSize)
CatalogItemIterator constructor that takes the total number of spanned objects and a view size.
Method Detail

getCatalogManager

protected CatalogManager getCatalogManager()
                                    throws java.rmi.RemoteException


getProductItemManager

protected ProductItemManager getProductItemManager()
                                            throws java.rmi.RemoteException

Returns:
the ProductItemManger for the CatalogManager associated with this ViewIterator.
Throws:
java.rmi.RemoteException - on remote error.
See Also:
ProductItemManger

getCategoryManager

protected CategoryManager getCategoryManager()
                                      throws java.rmi.RemoteException

Returns:
the CategoryManager for the CatalogManager associated with this ViewIterator.
Throws:
java.rmi.RemoteException - on remote error.
See Also:
CategoryManager

getCatalogQueryManager

protected CatalogQueryManager getCatalogQueryManager()
                                              throws java.rmi.RemoteException

Returns:
the CatalogQueryManager for the CatalogManager associated with this ViewIterator.
Throws:
java.rmi.RemoteException - on remote error.
See Also:
CatalogQueryManager

getCustomDataManager

protected CustomDataManager getCustomDataManager()
                                          throws java.rmi.RemoteException

Returns:
the CustomDataManager for the CatalogManager associated with this ViewIterator.
Throws:
java.rmi.RemoteException - on remote error.
See Also:
CustomDataManager

getCatalogRequest

protected CatalogRequest getCatalogRequest()

Returns:
the CatalogRequest for this ViewIterator.
Throws:
java.rmi.RemoteException - on remote error.
See Also:
CatalogRequest

refreshView

protected abstract void refreshView(View view)
                             throws java.rmi.RemoteException
This function is called whenever the current view needs to be refreshed. All classes that extend this class must implement this function.

Parameters:
view - The view to refresh.
Throws:
java.rmi.RemoteException - on remote error.

getCatalogItem

protected abstract CatalogItem getCatalogItem(View view,
                                              int itemIndex)
                                       throws java.util.NoSuchElementException
Returns a CatalogItem within the current view. All classes that extend this class must implement this function.

Parameters:
view - The current view.
itemIndex - The index of the item to retrieve.
Throws:
java.util.NoSuchElementException - If the item does not exist.

size

public final int size()
Returns the number of objects over which the iterator spans. This number is guaranteed to only be accurate at the time of iterator creation.
Specified by:
size in interface ViewIterator

Returns:
The number of spanned objects.

hasNext

public final boolean hasNext()
Returns true if the iterator has more elements.
Specified by:
hasNext in interface ViewIterator

Returns:
true if the iterator has more elements.

next

public java.lang.Object next()
                      throws java.util.NoSuchElementException,
                             java.rmi.RemoteException
Returns the next element in the iteration.
Specified by:
next in interface ViewIterator

Returns:
the next element in the iteration.
Throws:
java.rmi.RemoteException - on remote error.
java.util.NoSuchElementException - if the iteration has no more elements.

getViewCount

public final int getViewCount()
Returns the number of views spanned by this iterator.
Specified by:
getViewCount in interface ViewIterator

Returns:
the number of views spanned by this iterator.

getCurrentView

public final View getCurrentView()
Returns the current view.
Specified by:
getCurrentView in interface ViewIterator

Returns:
The current view.

getViewAt

public final View getViewAt(int index)
                     throws java.lang.IndexOutOfBoundsException
Gets the view at the specified index.
Specified by:
getViewAt in interface ViewIterator

Parameters:
index - The index of the desired view.
Returns:
The view at the specified index.
Throws:
java.lang.IndexOutOfBoundsException - if the index is invalid.

hasNextView

public final boolean hasNextView()
Returns true if the iterator has a next view.
Specified by:
hasNextView in interface ViewIterator

Returns:
true if the iterator has a next view.

hasPreviousView

public final boolean hasPreviousView()
Returns true if the iterator has a previous view.
Specified by:
hasPreviousView in interface ViewIterator

Returns:
true if the iterator has a previous view.

gotoNextView

public final void gotoNextView()
                        throws NoSuchViewException
Moves the iterator to the next view.
Specified by:
gotoNextView in interface ViewIterator

Throws:
NoSuchViewException - if the iterator does not have a next view.

gotoPreviousView

public final void gotoPreviousView()
                            throws NoSuchViewException
Moves the iterator to the previous view.
Specified by:
gotoPreviousView in interface ViewIterator

Throws:
NoSuchViewException - if the iterator does not have a previous view.

gotoViewAt

public final void gotoViewAt(int index)
                      throws NoSuchViewException
Moves the iterator to the view at the specified index.
Specified by:
gotoViewAt in interface ViewIterator

Parameters:
index - The index of the desired view.
Throws:
NoSuchViewException - if the index is invalid.

© 2002 BEA Systems, Inc.

Copyright © 2002 BEA Systems, Inc. All Rights Reserved