#include <coherence/util/DeltaSet.hpp>
Inherits AbstractSet.
Public Types | ||||
typedef spec::Handle | Handle | |||
DeltaSet Handle definition. | ||||
typedef spec::View | View | |||
DeltaSet View definition. | ||||
typedef spec::Holder | Holder | |||
DeltaSet Holder definition. | ||||
Public Member Functions | ||||
DeltaSet (Set::Holder hSet) | ||||
Construct this set based on an existing set. | ||||
virtual Set::View | getOriginal () const | |||
Determine what items were in the original set. | ||||
virtual bool | isModified () const | |||
Determine if the set has been modified. | ||||
virtual Set::View | getAdded () const | |||
Determine what items were added to the DeltaSet. | ||||
virtual Set::View | getRemoved () const | |||
Determine what items were removed from the DeltaSet. | ||||
virtual Set::Handle | ensureAdded () | |||
Get a mutable set of items that were added to the DeltaSet. | ||||
virtual Set::Handle | ensureRemoved () | |||
Get a mutable set of items that are removed in the DeltaSet. | ||||
virtual void | resolve () | |||
Apply the changes to the underlying set ("commit"). | ||||
virtual void | reset () | |||
Discard the changes to the set ("rollback"). | ||||
virtual size32_t | size () const | |||
Return the number of elements in this collection.
| ||||
virtual bool | contains (Object::View v) const | |||
Determine if this collection contains the specified element.
| ||||
virtual Iterator::Handle | iterator () const | |||
Return an Iterator over this collection.
| ||||
virtual Muterator::Handle | iterator () | |||
Return an Iterator over this collection.
| ||||
virtual ObjectArray::Handle | toArray (ObjectArray::Handle hao=NULL) const | |||
Return the contents of this collection as an ObjectArray. If the collection fits in the specified array, it is returned, otherwise, a new array is allocated that is the size of this collection. If this collection fits in the array with additional room then the element in the array immediately following the end of the collection is set to NULL. This can be useful in determining the length of this collection if the caller knows that the collection does not contain any NULL elements.
| ||||
virtual bool | add (Object::Holder oh) | |||
Add the given element to this collection.
This implementation will throw a coherence::lang::UnsupportedOperationException | ||||
virtual bool | remove (Object::View v) | |||
Remove the supplied element from this collection.
This implementation will throw a coherence::lang::UnsupportedOperationException unless add() is overridden (assuming the specified collection is non-empty). | ||||
virtual void | clear () | |||
Remove all elements from this collection. This implementation will throw a coherence::lang::UnsupportedOperationException. | ||||
Protected Attributes | ||||
FinalHolder< Set > | f_ohSetOrig | |||
The underlying set (assumed immutable). | ||||
MemberHandle< Set > | m_hSetAdded | |||
The added items. | ||||
MemberHandle< Set > | m_hSetRemoved | |||
The removed items. |
DeltaSet | ( | Set::Holder | hSet | ) |
Construct this set based on an existing set.
set | the set to base this delta set on |
virtual Set::View getOriginal | ( | ) | const [virtual] |
Determine what items were in the original set.
virtual bool isModified | ( | ) | const [virtual] |
Determine if the set has been modified.
virtual Set::View getAdded | ( | ) | const [virtual] |
Determine what items were added to the DeltaSet.
virtual Set::View getRemoved | ( | ) | const [virtual] |
Determine what items were removed from the DeltaSet.
virtual Set::Handle ensureAdded | ( | ) | [virtual] |
Get a mutable set of items that were added to the DeltaSet.
virtual Set::Handle ensureRemoved | ( | ) | [virtual] |
Get a mutable set of items that are removed in the DeltaSet.