SalesPoint v3.3 API

data.ooimpl
Class DataBasketImpl.SubDataBasket

java.lang.Object
  extended by data.ooimpl.DataBasketImpl.SubDataBasket
All Implemented Interfaces:
Serializable
Enclosing class:
DataBasketImpl

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
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.
<T> Iterator<DataBasketEntry>
iterator(DataBasketCondition<T> 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.

Overrides:
equals in class Object
Override:
Never

commit

public void commit(DataBasketCondition dbc)
Commit all items in this subbasket that match the condition.

Parameters:
dbc - the condition that must be matched.
See Also:
DataBasketEntry.commit()
Override:
Never

rollback

public void rollback(DataBasketCondition dbc)
Rollback all entries in this subbasket that match the condition.

Parameters:
dbc - the condition to be matched.
See Also:
DataBasketEntry.rollback()
Override:
Never

iterator

public <T> Iterator<DataBasketEntry> iterator(DataBasketCondition<T> 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().

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.
Override:
Never

sumSubBasket

public Value sumSubBasket(DataBasketCondition dbc,
                          BasketEntryValue bev,
                          Value vInit)
Sum up the values of all entries in this subbasket that match the condition.

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.
Override:
Never

put

public void put(DataBasketEntryImpl dbe)
Put a DataBasketEntry into the subbasket.

Parameters:
dbe - the entry to be put
See Also:
DataBasketImpl.put(data.DataBasketEntry)
Override:
Never

get

public DataBasketEntry get(DataBasketCondition dbc)
Get the first entry in this subbasket that matches the condition, if any.

Parameters:
dbc - the condition to be matched
Returns:
the matching entry, if any.
See Also:
DataBasketImpl.get(data.DataBasketCondition)
Override:
Never

SalesPoint v3.3 API