#include <coherence/util/Collection.hpp>
Inherits Object.
Inherited by AbstractCollection [virtual], List [virtual], NullImplementation::NullCollection [virtual], Set [virtual], and WrapperCollections::AbstractWrapperCollection [virtual].
A collection is a group of objects also known as elements. The following behaviors of a collection are implementation dependent:
Unless otherwise stated, collections are assumed to not support any of the above.
Public Types | |
| typedef spec::Handle | Handle |
| Collection Handle definition. | |
| typedef spec::View | View |
| Collection View definition. | |
| typedef spec::Holder | Holder |
| Collection Holder definition. | |
Public Member Functions | |
| virtual size32_t | size () const =0 |
| Return the number of elements in this collection. | |
| virtual bool | isEmpty () const =0 |
| Determine whether this collection contains any elements. | |
| virtual bool | contains (Object::View v) const =0 |
| Determine if this collection contains the specified element. | |
| virtual bool | containsAll (Collection::View vCol) const =0 |
| Determine if this collection contains all elements from the supplied collection. | |
| virtual Iterator::Handle | iterator () const =0 |
| Return an Iterator over this collection. | |
| virtual Muterator::Handle | iterator ()=0 |
| Return an Iterator over this collection. | |
| virtual ObjectArray::Handle | toArray () const =0 |
| Return the contents of this collection as an ObjectArray. | |
| virtual bool | add (Object::Holder oh)=0 |
| Add the given element to this collection. | |
| virtual bool | addAll (Collection::View vCol)=0 |
| Add all elements from the supplied collection to this collection. | |
| virtual bool | remove (Object::View v)=0 |
| Remove the supplied element from this collection. | |
| virtual bool | removeAll (Collection::View vCol)=0 |
| Remove all instances of the elements in the supplied collection from this collection. | |
| virtual bool | retainAll (Collection::View vCol)=0 |
| Remove all elements from this collection that are not present in the supplied collection. | |
| virtual void | clear ()=0 |
| Remove all elements from this collection. | |
| virtual size32_t size | ( | ) | const [pure virtual] |
Return the number of elements in this collection.
Implemented in AbstractCollection, LinkedList, SafeHashMap::EntrySet, SubList, WrapperCollections::AbstractWrapperCollection, WrapperCollections::AbstractWrapperSet, and WrapperCollections::AbstractWrapperList.
| virtual bool isEmpty | ( | ) | const [pure virtual] |
Determine whether this collection contains any elements.
Implemented in AbstractCollection, WrapperCollections::AbstractWrapperCollection, WrapperCollections::AbstractWrapperSet, and WrapperCollections::AbstractWrapperList.
| virtual bool contains | ( | Object::View | v | ) | const [pure virtual] |
Determine if this collection contains the specified element.
| v | the element to test for containment |
Implemented in AbstractCollection, ConverterCollections::ConverterCollection, ConverterCollections::ConverterSet, MapKeySet, MapValuesCollection, SafeHashMap::EntrySet, WrapperCollections::AbstractWrapperCollection, WrapperCollections::AbstractWrapperSet, and WrapperCollections::AbstractWrapperList.
| virtual bool containsAll | ( | Collection::View | vCol | ) | const [pure virtual] |
Determine if this collection contains all elements from the supplied collection.
| vCol | the collection of elements to test for containment |
| coherence::lang::NullPointerException | if the specified collection is NULL |
Implemented in AbstractCollection, ConverterCollections::ConverterCollection, ConverterCollections::ConverterSet, MapKeySet, MapValuesCollection, WrapperCollections::AbstractWrapperCollection, WrapperCollections::AbstractWrapperSet, and WrapperCollections::AbstractWrapperList.
| virtual Iterator::Handle iterator | ( | ) | const [pure virtual] |
Return an Iterator over this collection.
Implemented in ConverterCollections::ConverterCollection, ConverterCollections::ConverterSet, LinkedList, MappedSet, SafeHashMap::EntrySet, SubList, TypedCollections::TypedCollection, TypedCollections::TypedSet, TypedCollections::TypedList, WrapperCollections::AbstractWrapperCollection, WrapperCollections::AbstractWrapperSet, and WrapperCollections::AbstractWrapperList.
| virtual Muterator::Handle iterator | ( | ) | [pure virtual] |
Return an Iterator over this collection.
Implemented in ConverterCollections::ConverterCollection, ConverterCollections::ConverterSet, LinkedList, MappedSet, SafeHashMap::EntrySet, SubList, TypedCollections::TypedCollection, TypedCollections::TypedSet, TypedCollections::TypedList, WrapperCollections::AbstractWrapperCollection, WrapperCollections::AbstractWrapperSet, and WrapperCollections::AbstractWrapperList.
| virtual ObjectArray::Handle toArray | ( | ) | const [pure virtual] |
Return the contents of this collection as an ObjectArray.
Implemented in AbstractCollection, ConverterCollections::ConverterCollection, ConverterCollections::ConverterSet, SafeHashMap::EntrySet, WrapperCollections::AbstractWrapperCollection, WrapperCollections::AbstractWrapperSet, and WrapperCollections::AbstractWrapperList.
| virtual bool add | ( | Object::Holder | oh | ) | [pure virtual] |
Add the given element to this collection.
| oh | the element to add |
Implemented in AbstractCollection, ConverterCollections::ConverterCollection, ConverterCollections::ConverterSet, LinkedList, MappedSet, SubList, WrapperCollections::AbstractWrapperCollection, WrapperCollections::AbstractWrapperSet, and WrapperCollections::AbstractWrapperList.
| virtual bool addAll | ( | Collection::View | vCol | ) | [pure virtual] |
Add all elements from the supplied collection to this collection.
| vCol | the collection of elements to add |
| coherence::lang::NullPointerException | if the specified collection is NULL |
Implemented in AbstractCollection, ConverterCollections::ConverterCollection, ConverterCollections::ConverterSet, LinkedList, MappedSet, SubList, TypedCollections::TypedCollection, WrapperCollections::AbstractWrapperCollection, WrapperCollections::AbstractWrapperSet, and WrapperCollections::AbstractWrapperList.
| virtual bool remove | ( | Object::View | v | ) | [pure virtual] |
Remove the supplied element from this collection.
| v | the element to remove |
Implemented in AbstractCollection, ConverterCollections::ConverterCollection, ConverterCollections::ConverterSet, LinkedList, MapKeySet, MapValuesCollection, SafeHashMap::EntrySet, SubList, WrapperCollections::AbstractWrapperCollection, WrapperCollections::AbstractWrapperSet, and WrapperCollections::AbstractWrapperList.
| virtual bool removeAll | ( | Collection::View | vCol | ) | [pure virtual] |
Remove all instances of the elements in the supplied collection from this collection.
Upon completion, contains() on this collection will return false for all elements in the supplied collection.
| vCol | the collection of elements to remove |
| coherence::lang::NullPointerException | if the specified collection is NULL |
Implemented in AbstractCollection, ConverterCollections::ConverterCollection, ConverterCollections::ConverterSet, LinkedList, MapKeySet, MapValuesCollection, TypedCollections::TypedCollection, WrapperCollections::AbstractWrapperCollection, WrapperCollections::AbstractWrapperSet, and WrapperCollections::AbstractWrapperList.
| virtual bool retainAll | ( | Collection::View | vCol | ) | [pure virtual] |
Remove all elements from this collection that are not present in the supplied collection.
| vCol | the collection of elements to retain |
| coherence::lang::NullPointerException | if the specified collection is NULL |
Implemented in AbstractCollection, ConverterCollections::ConverterCollection, ConverterCollections::ConverterSet, LinkedList, LinkedList::SubLinkedList, MapKeySet, MapValuesCollection, TypedCollections::TypedCollection, WrapperCollections::AbstractWrapperCollection, WrapperCollections::AbstractWrapperSet, and WrapperCollections::AbstractWrapperList.