SalesPoint Framework v3.0

data.ooimpl
Class DataBasketImpl.SubDataBasket

java.lang.Object
  |
  +--data.ooimpl.DataBasketImpl.SubDataBasket

protected static class DataBasketImpl.SubDataBasket
extends Object
implements Serializable

Internal helper class used by DataBasketImpl, representing a subbasket of a DataBasket.

This class has been made protected so that framework users be able to subclass it should the need arise.

Since:
v2.0
Version:
2.0 14/06/1999
Author:
Steffen Zschaler
See Also:
Serialized Form

Constructor Summary
DataBasketImpl.SubDataBasket(DataBasketImpl dbiOwner)
          Create a new subbasket.
 
Method Summary
 void commit(DataBasketCondition dbc)
          Commit all items in this subbasket that match the condition.
 boolean equals(Object o)
          Check whether the given Object is equal to this subbasket.
 DataBasketEntry get(DataBasketCondition dbc)
          Get the first entry in this subbasket that matches the condition, if any.
 Iterator iterator(DataBasketCondition dbc, boolean fAllowRemove, boolean fShowHandled)
          Iterate all entries in the subbasket that match the given condition.
 void put(DataBasketEntryImpl dbe)
          Put a DataBasketEntry into the subbasket.
 void rollback(DataBasketCondition dbc)
          Rollback all entries in this subbasket that match the condition.
 Value sumSubBasket(DataBasketCondition dbc, BasketEntryValue bev, Value vInit)
          Sum up the values of all entries in this subbasket that match the condition.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataBasketImpl.SubDataBasket

public DataBasketImpl.SubDataBasket(DataBasketImpl dbiOwner)
Create a new subbasket.
Parameters:
dbiOwner - the DataBasketImpl instance owning this subbasket.
Method Detail

equals

public boolean equals(Object o)
Check whether the given Object is equal to this subbasket.

This is overridden to mean identity, because for subbaskets equality and identity are really the same.

Override:
Never.
Overrides:
equals in class Object

commit

public void commit(DataBasketCondition dbc)
Commit all items in this subbasket that match the condition.
Override:
Never.
Parameters:
dbc - the condition that must be matched.
See Also:
DataBasketEntry.commit()

rollback

public void rollback(DataBasketCondition dbc)
Rollback all entries in this subbasket that match the condition.
Override:
Never.
Parameters:
dbc - the condition to be matched.
See Also:
DataBasketEntry.rollback()

iterator

public Iterator iterator(DataBasketCondition dbc,
                         boolean fAllowRemove,
                         boolean fShowHandled)
Iterate all entries in the subbasket that match the given condition.

The condition applies to the returned iterator only, it will not be influenced by any future calls to iterator().

Override:
Never.
Parameters:
dbc - the condition returned items will have to match. null means match all.
fAllowRemove - if true,the returned iterator's remove() method will be enabled. An iterator with its remove() method enabled must never be made publicly accessible outside of the DataBasket.
fShowHandled - if true, the iterator will include items that return true from their DataBasketEntry.isHandled() method. Such an iterator must never be made publicly accessible outside of the DataBasket.
Returns:
an iterator that will iterate over all entries in this subbasket that match the given condition. The iterator will support the remove() method, if fAllowRemove is true.

sumSubBasket

public Value sumSubBasket(DataBasketCondition dbc,
                          BasketEntryValue bev,
                          Value vInit)
Sum up the values of all entries in this subbasket that match the condition.
Override:
Never.
Parameters:
dbc - the condition to be matched.
bev - an helper object used to determine the value of each matching DataBasketEntry.
vInit - the value that is to be used for adding up. All adding is performed by calling Value.addAccumulating(data.Value) on this object.
Returns:
the sum in vInit.

put

public void put(DataBasketEntryImpl dbe)
Put a DataBasketEntry into the subbasket.
Override:
Never.
Parameters:
dbe - the entry to be put
See Also:
DataBasketImpl.put(data.DataBasketEntry)

get

public DataBasketEntry get(DataBasketCondition dbc)
Get the first entry in this subbasket that matches the condition, if any.
Override:
Never.
Parameters:
dbc - the condition to be matched
Returns:
the matching entry, if any.
See Also:
DataBasketImpl.get(data.DataBasketCondition)

SalesPoint Framework v3.0