data.ooimpl
Class CountingStockItemDBEntry
java.lang.Object
data.ooimpl.DataBasketEntryImpl<Object>
data.ooimpl.StockItemDBEntry
data.ooimpl.CountingStockItemDBEntry
- All Implemented Interfaces:
- DataBasketEntry<Object>, DataBasketKeys, Serializable, Loggable
public class CountingStockItemDBEntry
- extends StockItemDBEntry
DataBasketEntry describing operations with CountingStock's items. The fields
of the DataBasketEntry
are set as follows:
- Since:
- v2.0
- Author:
- Steffen Zschaler
- See Also:
- Serialized Form
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CountingStockItemDBEntry
public CountingStockItemDBEntry(String sKey,
StockImpl stiSource,
StockImpl stiDest,
int nCount)
- Create a new CountingStockItemDBEntry.
- Parameters:
sKey
- the affected key.stiSource
- the source Stock.stiDest
- the destination Stock.nCount
- the number of affected items. This will be stored as the
value attribute
of the DataBasketEntry.
count
public int count()
- Count the affected items.
- Overrides:
count
in class StockItemDBEntry
- Returns:
- the number of affected items.
- Override:
- Never
partialRollback
public void partialRollback(int nCount)
- Rollback the operation described by this
DataBasketEntry
for a given number of items.
The method will rollback the operation for the given number of items, updating the underlying
DataBasket correctly.
Attention: The method is public as an implementation detail and should not be called
directly.
- Parameters:
nCount
- the number of items for which to rollback the operation.
- Throws:
IllegalArgumentException
- if nCount >= count()
.- Override:
- Never
getLogData
public LogEntry getLogData()
- Create and return a LogEntry describing this DataBasketEntry.
- Specified by:
getLogData
in interface Loggable
- Overrides:
getLogData
in class StockItemDBEntry
- Returns:
- the data to be stored in the log file.
- Override:
- Sometimes