#include <coherence/util/SubList.hpp>
Inherits AbstractList.
Inherited by CircularArrayList::SubCircularArrayList, and LinkedList::SubLinkedList.
Public Types | ||||||||||
typedef spec::Handle | Handle | |||||||||
SubList Handle definition. | ||||||||||
typedef spec::View | View | |||||||||
SubList View definition. | ||||||||||
typedef spec::Holder | Holder | |||||||||
SubList Holder definition. | ||||||||||
Public Member Functions | ||||||||||
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 vc) | |||||||||
Add all the elements from the supplied collection to this collection at the position specified.
| ||||||||||
virtual Object::Holder | get (size32_t i) const | |||||||||
Return the element from 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 ListIterator::Handle | listIterator (size32_t index=0) const | |||||||||
Return a ListIterator for this list starting at index.
| ||||||||||
virtual ListMuterator::Handle | listIterator (size32_t index=0) | |||||||||
Return a ListIterator for this list starting at index.
| ||||||||||
virtual Object::Holder | remove (size32_t idx) | |||||||||
Remove the element at the specified position in the list.
| ||||||||||
virtual Object::Holder | set (size32_t idx, Object::Holder oh) | |||||||||
Replace the element at the specified position in this list with the specified element.
| ||||||||||
virtual size32_t | size () const | |||||||||
Return the number of elements in this collection.
| ||||||||||
virtual Iterator::Handle | iterator () const | |||||||||
Return an Iterator over this collection.
| ||||||||||
virtual Muterator::Handle | iterator () | |||||||||
Return an Iterator over this collection.
| ||||||||||
virtual bool | add (Object::Holder oh) | |||||||||
Add the given element to this collection.
This implementation will throw a coherence::lang::UnsupportedOperationException | ||||||||||
virtual bool | addAll (Collection::View vc) | |||||||||
Add all elements from the supplied collection to this collection.
This implementation will throw a coherence::lang::UnsupportedOperationException unless add() is overridden (assuming the specified collection is non-empty). | ||||||||||
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). | ||||||||||
Protected Member Functions | ||||||||||
void | assertIndex (size32_t i) const | |||||||||
Validate that the supplied index is in the appropriate range for this SubList. | ||||||||||
virtual List::Handle | getDelegate () | |||||||||
Return the to delegate to. | ||||||||||
virtual List::View | getDelegate () const | |||||||||
Return the to delegate to. | ||||||||||
Protected Attributes | ||||||||||
FinalHolder< List > | f_ohList | |||||||||
The underlying list this is a sublist of. | ||||||||||
size32_t | m_iOffset | |||||||||
The offset this list is based on from the underlying list. | ||||||||||
size32_t | m_iSize | |||||||||
The size of this sublist. |
void assertIndex | ( | size32_t | i | ) | const [protected] |
Validate that the supplied index is in the appropriate range for this SubList.
i | the index to test against the SubList's boundaries |
coherence::lang::IndexOutOfBoundsException | iff the supplied index is outside the range of this SubList. |
virtual List::Handle getDelegate | ( | ) | [protected, virtual] |
Return the to delegate to.
virtual List::View getDelegate | ( | ) | const [protected, virtual] |
Return the to delegate to.