org.salespointframework.web.movestrategies
Class CSSSStrategy

java.lang.Object
  extended by org.salespointframework.web.movestrategies.CSSSStrategy
All Implemented Interfaces:
MoveStrategy

public abstract class CSSSStrategy
extends java.lang.Object
implements MoveStrategy

MoveStategy moving items from a CountingStock to a StoringStock

Author:
Lars Kreisz, Uwe Schmidt

Constructor Summary
CSSSStrategy()
           
 
Method Summary
protected abstract  StockItem createStockItem(StockItem ci)
           
 boolean moveToDestination(java.lang.Object source, java.lang.Object destination, java.lang.String itemName, DataBasket db, int count)
          moves the item with the given name from source to destination
 boolean moveToSource(java.lang.Object source, java.lang.Object destination, java.lang.String itemName, DataBasket db, int count)
          moves the item with the given name from destination to source
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CSSSStrategy

public CSSSStrategy()
Method Detail

moveToDestination

public boolean moveToDestination(java.lang.Object source,
                                 java.lang.Object destination,
                                 java.lang.String itemName,
                                 DataBasket db,
                                 int count)
                          throws java.lang.ClassCastException
Description copied from interface: MoveStrategy
moves the item with the given name from source to destination

Specified by:
moveToDestination in interface MoveStrategy
Parameters:
source - source aggregate
destination - destination aggregate
itemName - name of item that should be moved
db - databasket used for movement
count - number of items that should be moved
Returns:
false, if to many items should have been moved
Throws:
java.lang.ClassCastException

moveToSource

public boolean moveToSource(java.lang.Object source,
                            java.lang.Object destination,
                            java.lang.String itemName,
                            DataBasket db,
                            int count)
                     throws java.lang.ClassCastException
Description copied from interface: MoveStrategy
moves the item with the given name from destination to source

Specified by:
moveToSource in interface MoveStrategy
Parameters:
source - source aggregate
destination - destination aggregate
itemName - name of item that should be moved
db - databasket used for movement
count - number of items that should be moved
Returns:
false, if to many items should have been moved
Throws:
java.lang.ClassCastException

createStockItem

protected abstract StockItem createStockItem(StockItem ci)