CatalogItemIterator Class

com.beasys.commerce.ebusiness.catalog
CatalogItemIterator Class

public abstract class CatalogItemIterator

    extends Object
    implements Serializable, ViewIterator

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

Related Topics

View
ViewIterator


Hierarchy
Object
  CatalogItemIterator
All Implemented Interfaces

Serializable, ViewIterator
Direct Known Subclasses

CategoryItemIterator, CategoryIterator, OrphanedItemIterator, ProductItemIterator, SearchItemIterator, SiblingIterator, SubCategoryIterator

Field Summary

public static final int
DEFAULT_VIEW_SIZE
int
protected static final boolean
VERBOSE
boolean
 

Constructor Summary

CatalogItemIterator(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()
public final View
getCurrentView()
Returns the current view.
protected CustomDataManager
getCustomDataManager()
protected ProductItemManager
getProductItemManager()
public final View
getViewAt(int index)
Gets the view at the specified index.
public final int
getViewCount()
Returns the number of views spanned by this iterator.
public final void
gotoNextView()
Moves the iterator to the next view.
public final void
gotoPreviousView()
Moves the iterator to the previous view.
public final void
gotoViewAt(int index)
Moves the iterator to the view at the specified index.
public final boolean
hasNext()
Returns true if the iterator has more elements.
public final boolean
hasNextView()
Returns true if the iterator has a next view.
public final boolean
hasPreviousView()
Returns true if the iterator has a previous view.
public 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.
public final int
size()
Returns the number of objects over which the iterator spans.
 
Methods from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
   
Methods from interface com.beasys.commerce.ebusiness.catalog.ViewIterator
getCurrentView, getViewAt, getViewCount, gotoNextView, gotoPreviousView, gotoViewAt, hasNext, hasNextView, hasPreviousView, next, size
 

Field Detail

DEFAULT_VIEW_SIZE

public static final int DEFAULT_VIEW_SIZE


VERBOSE

protected static final boolean VERBOSE

 

Constructor Detail

CatalogItemIterator

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

Method Detail

getCatalogItem(View, int) Method

protected abstract CatalogItem getCatalogItem(View view, 
                                              int itemIndex)
throws 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.

Exceptions

NoSuchElementException
If the item does not exist.

getCatalogManager() Method

protected CatalogManager getCatalogManager()
throws RemoteException

Exceptions

RemoteException

getCatalogQueryManager() Method

protected CatalogQueryManager getCatalogQueryManager()
throws RemoteException

Returns

the CatalogQueryManager for the CatalogManager associated with this ViewIterator.

Exceptions

RemoteException
on remote error.

Related Topics

CatalogQueryManager


getCatalogRequest() Method

protected CatalogRequest getCatalogRequest()

Returns

the CatalogRequest for this ViewIterator.

Related Topics

CatalogRequest


getCategoryManager() Method

protected CategoryManager getCategoryManager()
throws RemoteException

Returns

the CategoryManager for the CatalogManager associated with this ViewIterator.

Exceptions

RemoteException
on remote error.

Related Topics

CategoryManager


getCurrentView() Method

public final View getCurrentView()
Returns the current view.

Returns

The current view.

getCustomDataManager() Method

protected CustomDataManager getCustomDataManager()
throws RemoteException

Returns

the CustomDataManager for the CatalogManager associated with this ViewIterator.

Exceptions

RemoteException
on remote error.

Related Topics

CustomDataManager


getProductItemManager() Method

protected ProductItemManager getProductItemManager()
throws RemoteException

Returns

the ProductItemManger for the CatalogManager associated with this ViewIterator.

Exceptions

RemoteException
on remote error.

Related Topics

ProductItemManager


getViewAt(int) Method

public final View getViewAt(int index)
throws IndexOutOfBoundsException
Gets the view at the specified index.

Parameters

index
The index of the desired view.

Returns

The view at the specified index.

Exceptions

IndexOutOfBoundsException
if the index is invalid.

getViewCount() Method

public final int getViewCount()
Returns the number of views spanned by this iterator.

Returns

the number of views spanned by this iterator.

gotoNextView() Method

public final void gotoNextView()
throws NoSuchViewException
Moves the iterator to the next view.

Exceptions

NoSuchViewException
if the iterator does not have a next view.

gotoPreviousView() Method

public final void gotoPreviousView()
throws NoSuchViewException
Moves the iterator to the previous view.

Exceptions

NoSuchViewException
if the iterator does not have a previous view.

gotoViewAt(int) Method

public final void gotoViewAt(int index)
throws NoSuchViewException
Moves the iterator to the view at the specified index.

Parameters

index
The index of the desired view.

Exceptions

NoSuchViewException
if the index is invalid.

hasNext() Method

public final boolean hasNext()
Returns true if the iterator has more elements.

Returns

true if the iterator has more elements.

hasNextView() Method

public final boolean hasNextView()
Returns true if the iterator has a next view.

Returns

true if the iterator has a next view.

hasPreviousView() Method

public final boolean hasPreviousView()
Returns true if the iterator has a previous view.

Returns

true if the iterator has a previous view.

next() Method

public Object next()
throws NoSuchElementException, RemoteException
Returns the next element in the iteration.

Returns

the next element in the iteration.

Exceptions

NoSuchElementException
if the iteration has no more elements.
RemoteException

refreshView(View) Method

protected abstract void refreshView(View view)
throws 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.

Exceptions

RemoteException
on remote error.

size() Method

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.

Returns

The number of spanned objects.