SalesPoint v3.3 API

data.swing
Class CountingStockDBEGrouper

java.lang.Object
  extended by data.swing.CountingStockDBEGrouper
All Implemented Interfaces:
DataBasketEntryGrouper, Serializable

public class CountingStockDBEGrouper
extends Object
implements DataBasketEntryGrouper

DataBasketEntryGrouper that groups entries that have the same main and secondary key as well as the same source and destination and where both values contain an Integer object. These are DataBasketEntries that describe operations on CountingStock items.

Since:
v2.0
Author:
Steffen Zschaler
See Also:
Serialized Form

Constructor Summary
CountingStockDBEGrouper()
          Create a new CountingStockDBEGrouper.
 
Method Summary
 boolean canGroup(DataBasketEntry dbe1, DataBasketEntry dbe2)
          Return true if dbe1 and dbe2 have the same main and secondary key as well as the same source and destination and both values contain an Integer object.
 DataBasketEntry group(DataBasketEntry dbe1, DataBasketEntry dbe2)
          Return a new DataBasketEntry with the same main and secondary key, source and destination as dbe1 and a value of dbe1.getValue() + dbe2.getValue().
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CountingStockDBEGrouper

public CountingStockDBEGrouper()
Create a new CountingStockDBEGrouper.

Method Detail

canGroup

public boolean canGroup(DataBasketEntry dbe1,
                        DataBasketEntry dbe2)
Return true if dbe1 and dbe2 have the same main and secondary key as well as the same source and destination and both values contain an Integer object.

Specified by:
canGroup in interface DataBasketEntryGrouper
Override:
Never

group

public DataBasketEntry group(DataBasketEntry dbe1,
                             DataBasketEntry dbe2)
Return a new DataBasketEntry with the same main and secondary key, source and destination as dbe1 and a value of dbe1.getValue() + dbe2.getValue().

The returned DataBasketEntry cannot be used for commiting or rolling back operations.

Specified by:
group in interface DataBasketEntryGrouper
Override:
Never

SalesPoint v3.3 API