ibspan.ecap.merchant.shopdecisions
Class ProductProvider

java.lang.Object
  extended by ibspan.ecap.merchant.shopdecisions.ProductProvider

public class ProductProvider
extends java.lang.Object

A class managing a list of products sold by the shop. Current implementation stores the products in memory.

Author:
Michal Drozdowicz

Constructor Summary
ProductProvider()
           
 
Method Summary
 void addProduct(java.lang.String productId)
          Adds the product to the list.
 java.lang.String getNextProductId()
          Returns the id of the next product to process.
 void removeProduct(java.lang.String productId)
          Removes the product from the list.
 boolean roundFinished()
          Determines whether a whole cycle of products has passed.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProductProvider

public ProductProvider()
Method Detail

getNextProductId

public java.lang.String getNextProductId()
Returns the id of the next product to process.

Returns:
the id of the next product to process.

roundFinished

public boolean roundFinished()
Determines whether a whole cycle of products has passed.

Returns:
true if all products have been processed during this cycle, false otherwise

addProduct

public void addProduct(java.lang.String productId)
Adds the product to the list.

Parameters:
productId - the id of the product to be handled

removeProduct

public void removeProduct(java.lang.String productId)
Removes the product from the list.

Parameters:
productId - the id of the product to be withdrawn