SalesPoint Framework v3.1

data.swing
Interface DataBasketEntryGrouper

All Superinterfaces:
Serializable
All Known Implementing Classes:
CountingStockDBEGrouper, NOPDataBasketEntryGrouper

public interface DataBasketEntryGrouper
extends Serializable

Strategy grouping DataBasketEntries together for display.

When displaying the contents of a DataBasket, there may be several DataBasketEntries describing what to the user should be displayed as conceptually one operation. For example, there may be several entries noting that individual amounts of items of the same key have been taken from a CountingStock. To the user you would probably want to display only the net result of this, i.e. one entry giving the total number of items of the given key that were removed from the Stock. In general, this is were you provide a DataBasketEntryGrouper to group together entries that conceptually represent one entry. For cases like in the above example you can use the predefined CountingStockDBEGrouper.

Since:
v2.0
Author:
Steffen Zschaler

Method Summary
 boolean canGroup(DataBasketEntry dbe1, DataBasketEntry dbe2)
          Return true to indicate that the two entries are conceptually part of one more general entry and that they must be grouped together.
 DataBasketEntry group(DataBasketEntry dbe1, DataBasketEntry dbe2)
          Group the two given DataBaskeEntries and return the resulting, more general entry.
 

Method Detail

canGroup

public boolean canGroup(DataBasketEntry dbe1,
                        DataBasketEntry dbe2)
Return true to indicate that the two entries are conceptually part of one more general entry and that they must be grouped together.

The relation defined hereby is an equality relation, i.e. it must be reflexive, symmetric and transitive. All tuples (dbe1, dbe2) must be evaluated to either true or false, i.e. there must be no exceptions thrown by this method.

Override:
Always

group

public DataBasketEntry group(DataBasketEntry dbe1,
                             DataBasketEntry dbe2)
Group the two given DataBaskeEntries and return the resulting, more general entry.

The resulting entry must be groupable with any DataBasketEntry with which dbe1 or dbe2 are groupable.

Override:
Always

SalesPoint Framework v3.1