Oracle® Fusion Middleware C++ API Reference for Oracle Coherence
12c (12.1.3.0.0)

E47891-01

LongArray Class Reference

#include <coherence/util/LongArray.hpp>

Inherits PofIntrinsic.

Inherited by AbstractLongArray [virtual].

List of all members.


Detailed Description

An interface, similar in its methods to List, and similar in its purpose to an array, designed for sparse storage and indexed by long values.

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.

Author:
js 2008.04.03

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.

Member Function Documentation

virtual Object::Holder get ( int64_t  lIndex  )  const [pure virtual]

Return the value stored at the specified index.

Parameters:
lIndex a long index value
Returns:
the object stored at the specified index, or NULL

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.

Parameters:
lIndex a long index value
ohValue the object to store at the specified index
Returns:
the object that was stored at the specified index, or NULL

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.

Parameters:
ohValue the object to add to the LongArray
Returns:
the long index value at which the element value was stored

Implemented in AbstractLongArray.

virtual bool exists ( int64_t  lIndex  )  const [pure virtual]

Determine if the specified index is in use.

Parameters:
lIndex a long index value
Returns:
true if a value (including NULL) is stored at the specified index, otherwise false

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.

Parameters:
lIndex the index into the LongArray
Returns:
the associated value (which can be NULL) or NULL if the specified index is not in 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)).

Parameters:
vElement element whose presence in this list is to be tested
Returns:
true if this list contains the specified element

Implemented in AbstractLongArray.

virtual bool isEmpty (  )  const [pure virtual]

Test for empty LongArray.

Returns:
true if LongArray has no nodes

Implemented in AbstractLongArray.

virtual size32_t getSize (  )  const [pure virtual]

Determine the size of the LongArray.

Returns:
the number of nodes in the LongArray

Implemented in AbstractLongArray, and AbstractSparseArray.

virtual LongArrayIterator::Handle iterator (  )  [pure virtual]

Obtain a LongArray.Iterator of the contents of the LongArray.

Returns:
an instance of LongArray.Iterator

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.

Returns:
an instance of LongArray.Iterator

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.

Parameters:
lIndex the LongArray index to iterate from
Returns:
an instance of LongArray.Iterator

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.

Parameters:
lIndex the LongArray index to iterate from
Returns:
an instance of LongArray.Iterator

Implemented in AbstractSparseArray.

virtual int64_t getFirstIndex (  )  const [pure virtual]

Determine the first index that exists in the LongArray.

Returns:
the lowest long value, 0 <= n <= Long.max_value, that exists in this LongArray, or -1 if the LongArray is empty

Implemented in AbstractLongArray, and AbstractSparseArray.

virtual int64_t getLastIndex (  )  const [pure virtual]

Determine the last index that exists in the LongArray.

Returns:
the highest long value, 0 <= n <= Long.max_value, that exists in this LongArray, or -1 if the LongArray is empty

Implemented in AbstractLongArray, and AbstractSparseArray.


The documentation for this class was generated from the following file:
Copyright © 2000, 2014, Oracle and/or its affiliates. All rights reserved.