Oracle Coherence for C++ API
Release 3.6.0.0

E15728-01

AbstractLongArray Class Reference

#include <coherence/util/AbstractLongArray.hpp>

Inherits Object, and LongArray.

Inherited by AbstractSparseArray.

List of all members.


Detailed Description

Abstract base class for LongArray implementations.
Author:
js 2008.04.04

Public Types

typedef spec::Handle  Handle
  AbstractLongArray Handle definition.
typedef spec::View  View
  AbstractLongArray View definition.
typedef spec::Holder  Holder
  AbstractLongArray Holder definition.

Public Member Functions

virtual Object::Holder  get (int64_t lIndex) const
  Return the value stored at the specified index.
Parameters:
lIndex  a long index value
Returns:
the object stored at the specified index, or NULL

virtual int64_t  add (Object::Holder ohValue)
  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

virtual bool  exists (int64_t lIndex) const
  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

virtual Object::Holder  remove (int64_t lIndex)
  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

virtual bool  contains (Object::View vElement) const
  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

virtual void  clear ()
  Remove all nodes from the LongArray.
virtual bool  isEmpty () const
  Test for empty LongArray.
Returns:
true if LongArray has no nodes

virtual size32_t  getSize () const
  Determine the size of the LongArray.
Returns:
the number of nodes in the LongArray

virtual int64_t  getFirstIndex () const
  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

virtual int64_t  getLastIndex () const
  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

virtual void  toStream (std::ostream &out) const
  Output a human-readable description of this Object to the given stream.

coherence::lang::operator<<(std::ostream, Object::View) is defined and will call into the toStream method, to output Objects. If a managed String object is desired, the COH_TO_STRING macro can be used to build up a String from streamable contents.

 Object::View vKey   = ...
 Object::View vValue = ...
 std::cout << vKey << " = " << vValue << std::endl;

 String::Handle hs = COH_TO_STRING(vKey << " = " << vValue);
Parameters:
out  the stream used to output the description

virtual bool  equals (Object::View v) const
 

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