com.ora.jsp.beans.shopping
Class CatalogBean
java.lang.Object
com.ora.jsp.beans.shopping.CatalogBean
- All Implemented Interfaces:
- java.io.Serializable
- public class CatalogBean
- extends java.lang.Object
- implements java.io.Serializable
This class represents a product catalog. It holds a list of
products available for sale.
This is just a demo so the product list is hardcoded, created
at instantiation. A real version would get the information from
an external data source.
- Version:
- 2.0
- Author:
- Hans Bergsten, Gefion software
- See Also:
- Serialized Form
Field Summary |
private java.util.Map |
catalog
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
catalog
private java.util.Map catalog
CatalogBean
public CatalogBean()
- Constructor. Creates all ProductBean objects and adds them
to the catalog.
getProductList
public ProductBean[] getProductList()
- Returns all products as an Iterator, suitable for looping.
- Returns:
- an Iterator for all ProductBean instances
getProductsById
public java.util.Map getProductsById()
- Returns a Map with all ProductBean instances, keyed by ID.
- Returns:
- an Map of all ProductBean instances