#include <coherence/util/ReadOnlyMultiList.hpp>
Inherits AbstractList, and Set.
Inherited by ReadOnlyArrayList.
This class also implements the Set interface, although the contents are not checked to determine whether each element is unique. It is the responsibility of the user to ensure that the elements are unique if the object is used as a Set.
Note: while preserved for backward compatibility, as of Coherence 3.6, use of this class specifically as a List or a Set is deprecated. Instead, the getList(), getSet() methods should be used.
Public Types | ||||||||||
typedef spec::Handle | Handle | |||||||||
ReadOnlyMultiList Handle definition. | ||||||||||
typedef spec::View | View | |||||||||
ReadOnlyMultiList View definition. | ||||||||||
typedef spec::Holder | Holder | |||||||||
ReadOnlyMultiList Holder definition. | ||||||||||
typedef this_spec::Handle | Handle | |||||||||
AbstractList Handle definition. | ||||||||||
typedef this_spec::View | View | |||||||||
AbstractList View definition. | ||||||||||
typedef this_spec::Holder | Holder | |||||||||
AbstractList Holder definition. | ||||||||||
Public Member Functions | ||||||||||
virtual List::Handle | getList () | |||||||||
Return a List view of this ReadOnlyMultiList. | ||||||||||
virtual List::View | getList () const | |||||||||
Return a List view of this ReadOnlyMultiList. | ||||||||||
virtual Set::Handle | getSet () | |||||||||
Return a Set view of this ReadOnlyMultiList. | ||||||||||
virtual Set::View | getSet () const | |||||||||
Return a Set view of this ReadOnlyMultiList. | ||||||||||
virtual size32_t | size () const | |||||||||
Return the number of elements in this collection.
| ||||||||||
virtual Object::Holder | get (size32_t i) const | |||||||||
Return the element from the specified position in the list.
| ||||||||||
virtual Object::Holder | set (size32_t i, Object::Holder oh) | |||||||||
Replace the element at the specified position in this list with the specified element.
| ||||||||||
virtual bool | add (size32_t i, Object::Holder oh) | |||||||||
Add the given element to this collection at the position specified. If an element is already at that position it will be shifted to the right by 1.
| ||||||||||
virtual bool | addAll (size32_t i, Collection::View vColl) | |||||||||
Add all the elements from the supplied collection to this collection at the position specified.
| ||||||||||
virtual Object::Holder | remove (size32_t i) | |||||||||
Remove the element at the specified position in the list.
| ||||||||||
virtual size32_t | indexOf (Object::View v) const | |||||||||
Return the position in the list of the first instance of the specified element.
| ||||||||||
virtual size32_t | lastIndexOf (Object::View v) const | |||||||||
Return the position in this list of the last instance of the specified element.
| ||||||||||
virtual bool | contains (Object::View v) const | |||||||||
Determine if this collection contains the specified element.
| ||||||||||
virtual ObjectArray::Handle | toArray (ObjectArray::Handle ha=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 Iterator::Handle | iterator () const | |||||||||
Return an Iterator over this collection.
| ||||||||||
virtual Muterator::Handle | iterator () | |||||||||
Return an Iterator over this collection.
| ||||||||||
virtual ListIterator::Handle | listIterator (size32_t i=0) const | |||||||||
Return a ListIterator for this list starting at index.
| ||||||||||
virtual ListMuterator::Handle | listIterator (size32_t i=0) | |||||||||
Return a ListIterator for this list starting at index.
| ||||||||||
virtual List::View | subList (size32_t iFrom, size32_t iTo) const | |||||||||
Return a new list containing the contents of the list between the specified fromIndex (inclusive) and toIndex (exclusive).
| ||||||||||
virtual List::Handle | subList (size32_t iFrom, size32_t iTo) | |||||||||
Return a new list containing the contents of the list between the specified fromIndex (inclusive) and toIndex (exclusive).
| ||||||||||
virtual bool | equals (Object::View v) const | |||||||||
Static Public Member Functions | ||||||||||
static size32_t | calculateTotalLength (ObjectArray::View vaao) | |||||||||
Calculate the total number of element in the array of arrays. | ||||||||||
static ObjectArray::Handle | flatten (ObjectArray::View vaaoFrom, size32_t cTotal, ObjectArray::Handle haoTo=NULL) | |||||||||
Create a single dimensional array containing all elements of the specified array of arrays. | ||||||||||
Protected Member Functions | ||||||||||
ReadOnlyMultiList (ObjectArray::View vaao) | ||||||||||
Construct a List containing the elements of the specified array of Object arrays. | ||||||||||
Static Protected Member Functions | ||||||||||
template<class T> | ||||||||||
static List::Holder | subList (T, size32_t iFrom, size32_t iTo) | |||||||||
Common subList method implementation. | ||||||||||
Classes | ||||||||||
class | ListView | |||||||||
ListView exposes the underlying ReadOnlyMultiList through the List interface, maintaining correct equals() and hashCode() semantics. More... | ||||||||||
class | SetView | |||||||||
SetView exposes the underlying ReadOnlyMultiList through the Set interface, maintaining correct equals() and hashCode() semantics. More... |
ReadOnlyMultiList | ( | ObjectArray::View | vaao | ) | [protected] |
Construct a List containing the elements of the specified array of Object arrays.
vaao | the array of arrays backing the MultiList |
virtual List::Handle getList | ( | ) | [virtual] |
virtual List::View getList | ( | ) | const [virtual] |
virtual Set::Handle getSet | ( | ) | [virtual] |
virtual Set::View getSet | ( | ) | const [virtual] |
static size32_t calculateTotalLength | ( | ObjectArray::View | vaao | ) | [static] |
Calculate the total number of element in the array of arrays.
vaao | an array of arrays |
static ObjectArray::Handle flatten | ( | ObjectArray::View | vaaoFrom, | |
size32_t | cTotal, | |||
ObjectArray::Handle | haoTo = NULL | |||
) | [static] |
Create a single dimensional array containing all elements of the specified array of arrays.
vaaoFrom | an array of arrays to copy from | |
cTotal | the total length of the flattened array; pass npos for it to be calculated | |
vaoTo | an array to copy the elements into (optional) |
ArrayIndexOutOfBoundsException | if the total length parameter was not sufficient to hold the flattened array |