#include <coherence/util/LongArray.hpp>
Inherits Object.
Inherited by AbstractLongArray [virtual]
.
Unlike the List interface, the LongArray interface assumes that every valid index (i.e. greater than or equal to zero) can be accessed and has storage available.
Public Types | |
typedef spec::Handle | Handle |
LongArray Handle definition. | |
typedef spec::View | View |
LongArray View definition. | |
typedef spec::Holder | Holder |
LongArray Holder definition. | |
Public Member Functions | |
virtual Object::Holder | get (int64_t lIndex) const =0 |
Return the value stored at the specified index. | |
virtual Object::Holder | set (int64_t lIndex, Object::Holder ohValue)=0 |
Add the passed item to the LongArray at the specified index. | |
virtual int64_t | add (Object::Holder ohValue)=0 |
Add the passed element value to the LongArray and return the index at which the element value was stored. | |
virtual bool | exists (int64_t lIndex) const =0 |
Determine if the specified index is in use. | |
virtual Object::Holder | remove (int64_t lIndex)=0 |
Remove the specified index from the LongArray, returning its associated value. | |
virtual bool | contains (Object::View vElement) const =0 |
Determine if the LongArray contains the specified element. | |
virtual void | clear ()=0 |
Remove all nodes from the LongArray. | |
virtual bool | isEmpty () const =0 |
Test for empty LongArray. | |
virtual size32_t | getSize () const =0 |
Determine the size of the LongArray. | |
virtual LongArrayIterator::Handle | iterator ()=0 |
Obtain a LongArray.Iterator of the contents of the LongArray. | |
virtual LongArrayIterator::Handle | iterator () const =0 |
Obtain a "read-only" LongArray.Iterator of the contents of the LongArray. | |
virtual LongArrayIterator::Handle | iterator (int64_t lIndex)=0 |
Obtain a LongArray.Iterator of the contents of the LongArray, starting at a particular index such that the first call to next will set the location of the iterator at the first existent index that is greater than or equal to the specified index, or will throw a NoSuchElementException if there is no such existent index. | |
virtual LongArrayIterator::Handle | iterator (int64_t lIndex) const =0 |
Obtain a "read-only" LongArray.Iterator of the contents of the LongArray, starting at a particular index such that the first call to next will set the location of the iterator at the first existent index that is greater than or equal to the specified index, or will throw a NoSuchElementException if there is no such existent index. | |
virtual int64_t | getFirstIndex () const =0 |
Determine the first index that exists in the LongArray. | |
virtual int64_t | getLastIndex () const =0 |
Determine the last index that exists in the LongArray. |
virtual Object::Holder get | ( | int64_t | lIndex | ) | const [pure virtual] |
Return the value stored at the specified index.
lIndex | a long index value |
Implemented in AbstractLongArray, and AbstractSparseArray.
virtual Object::Holder set | ( | int64_t | lIndex, | |
Object::Holder | ohValue | |||
) | [pure virtual] |
Add the passed item to the LongArray at the specified index.
If the index is already used, the passed value will replace the current value stored with the key, and the replaced value will be returned.
It is expected that LongArray implementations will "grow" as necessary to support the specified index.
lIndex | a long index value | |
ohValue | the object to store at the specified index |
Implemented in AbstractSparseArray.
virtual int64_t add | ( | Object::Holder | ohValue | ) | [pure virtual] |
Add the passed element value to the LongArray and return the index at which the element value was stored.
ohValue | the object to add to the LongArray |
Implemented in AbstractLongArray.
virtual bool exists | ( | int64_t | lIndex | ) | const [pure virtual] |
Determine if the specified index is in use.
lIndex | a long index value |
Implemented in AbstractLongArray, and AbstractSparseArray.
virtual Object::Holder remove | ( | int64_t | lIndex | ) | [pure virtual] |
Remove the specified index from the LongArray, returning its associated value.
lIndex | the index into the LongArray |
Implemented in AbstractLongArray, and AbstractSparseArray.
virtual bool contains | ( | Object::View | vElement | ) | const [pure virtual] |
Determine if the LongArray contains the specified element.
More formally, returns true
if and only if this LongArray contains at least one element e
such that (o==NULL ? e==NULL : o.equals(e))
.
vElement | element whose presence in this list is to be tested |
true
if this list contains the specified element Implemented in AbstractLongArray.
virtual bool isEmpty | ( | ) | const [pure virtual] |
virtual size32_t getSize | ( | ) | const [pure virtual] |
Determine the size of the LongArray.
Implemented in AbstractLongArray, and AbstractSparseArray.
virtual LongArrayIterator::Handle iterator | ( | ) | [pure virtual] |
Obtain a LongArray.Iterator of the contents of the LongArray.
Implemented in AbstractSparseArray.
virtual LongArrayIterator::Handle iterator | ( | ) | const [pure virtual] |
Obtain a "read-only" LongArray.Iterator of the contents of the LongArray.
Any attempt to modify the backing LongArray through this iterator will result in an exception.
Implemented in AbstractSparseArray.
virtual LongArrayIterator::Handle iterator | ( | int64_t | lIndex | ) | [pure virtual] |
Obtain a LongArray.Iterator of the contents of the LongArray, starting at a particular index such that the first call to next
will set the location of the iterator at the first existent index that is greater than or equal to the specified index, or will throw a NoSuchElementException if there is no such existent index.
lIndex | the LongArray index to iterate from |
Implemented in AbstractSparseArray.
virtual LongArrayIterator::Handle iterator | ( | int64_t | lIndex | ) | const [pure virtual] |
Obtain a "read-only" LongArray.Iterator of the contents of the LongArray, starting at a particular index such that the first call to next
will set the location of the iterator at the first existent index that is greater than or equal to the specified index, or will throw a NoSuchElementException if there is no such existent index.
Any attempt to modify the backing LongArray through this iterator will result in an exception.
lIndex | the LongArray index to iterate from |
Implemented in AbstractSparseArray.
virtual int64_t getFirstIndex | ( | ) | const [pure virtual] |
Determine the first index that exists in the LongArray.
Implemented in AbstractLongArray, and AbstractSparseArray.
virtual int64_t getLastIndex | ( | ) | const [pure virtual] |
Determine the last index that exists in the LongArray.
Implemented in AbstractLongArray, and AbstractSparseArray.