|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.umich.eecs.tac.props.AbstractTransportable edu.umich.eecs.tac.props.AbstractTransportableEntryListBacking<S> edu.umich.eecs.tac.props.AbstractKeyedEntryList<Product,RetailCatalog.RetailCatalogEntry> edu.umich.eecs.tac.props.RetailCatalog
public class RetailCatalog
The class holds the available products, which the users have preferences over. In addition, the advertiser sales profit per conversion is given for each product.
Nested Class Summary | |
---|---|
static class |
RetailCatalog.RetailCatalogEntry
The retail catalog entry holds the sales profit for a Product . |
Constructor Summary | |
---|---|
RetailCatalog()
Creates a empty retail catalog. |
Method Summary | |
---|---|
int |
addProduct(Product product)
Adds the product to the retail catalog. |
protected void |
afterAddEntry(RetailCatalog.RetailCatalogEntry entry)
Adds the the manufacturer and component of the supporting entry. |
protected void |
beforeRemoveEntry(int index)
Throws an UnsupportedOperationException . |
protected RetailCatalog.RetailCatalogEntry |
createEntry(Product key)
Creates a retail catalog entry for a product. |
protected java.lang.Class |
entryClass()
Returns the RetailCatalog.RetailCatalogEntry class. |
java.util.Set<java.lang.String> |
getComponents()
Returns the set of components for the products. |
java.util.Set<java.lang.String> |
getManufacturers()
Returns the set of manufacturers for the products. |
double |
getSalesProfit(int index)
Returns the advertiser sales profit for the product at the index. |
double |
getSalesProfit(Product product)
Returns the advertiser sales profit for the product. |
void |
setSalesProfit(int index,
double salesProfit)
Sets the sales profit for the product. |
void |
setSalesProfit(Product product,
double salesProfit)
Sets the sales profit for the product. |
Methods inherited from class edu.umich.eecs.tac.props.AbstractKeyedEntryList |
---|
addKey, containsKey, getEntry, getKey, indexForEntry, iterator, keys |
Methods inherited from class edu.umich.eecs.tac.props.AbstractTransportableEntryListBacking |
---|
addEntry, afterRemoveEntry, beforeAddEntry, getEntries, getEntry, readAfterEntries, readBeforeEntries, readWithLock, removeEntry, size, toString, toStringAfterEntries, toStringBeforeEntries, writeAfterEntries, writeBeforeEntries, writeWithLock |
Methods inherited from class edu.umich.eecs.tac.props.AbstractTransportable |
---|
getTransportName, isLocked, lock, lockCheck, read, write |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public RetailCatalog()
Method Detail |
---|
public final java.util.Set<java.lang.String> getManufacturers()
public final java.util.Set<java.lang.String> getComponents()
public final double getSalesProfit(Product product)
product
- the product
public final double getSalesProfit(int index)
index
- the index for the product
public final void setSalesProfit(Product product, double salesProfit) throws java.lang.IllegalStateException
product
- the product whose sales profit is being set.salesProfit
- the sales profit for the product.
java.lang.IllegalStateException
- if the retail catalog is locked.public final void setSalesProfit(int index, double salesProfit) throws java.lang.IllegalStateException
index
- the index for the productsalesProfit
- the sales profit for the product.
java.lang.IllegalStateException
- if the retail catalog is locked.public final int addProduct(Product product) throws java.lang.IllegalStateException
AbstractKeyedEntryList.addKey(Object)
.
product
- the product to add.
java.lang.IllegalStateException
- if the retail catalog is locked.protected final void afterAddEntry(RetailCatalog.RetailCatalogEntry entry) throws java.lang.IllegalStateException
afterAddEntry
in class AbstractTransportableEntryListBacking<RetailCatalog.RetailCatalogEntry>
entry
- the entry to be added.
java.lang.IllegalStateException
- if the retail catalog is locked.protected final RetailCatalog.RetailCatalogEntry createEntry(Product key)
createEntry
in class AbstractKeyedEntryList<Product,RetailCatalog.RetailCatalogEntry>
key
- the key for the created entry.
protected final void beforeRemoveEntry(int index) throws java.lang.UnsupportedOperationException
UnsupportedOperationException
.
beforeRemoveEntry
in class AbstractTransportableEntryListBacking<RetailCatalog.RetailCatalogEntry>
index
- the index to remove.
java.lang.UnsupportedOperationException
- throws exception.protected final java.lang.Class entryClass()
RetailCatalog.RetailCatalogEntry
class.
entryClass
in class AbstractTransportableEntryListBacking<RetailCatalog.RetailCatalogEntry>
RetailCatalog.RetailCatalogEntry
class.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |