Show / Hide Table of Contents

Interface ILongArray

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

Namespace: Tangosol.Util
Assembly: Coherence.dll
Syntax
public interface ILongArray
Remarks

Unlike the IList interface, the ILongArray interface assumes that every valid index (i.e. greater than or equal to zero) can be accessed and has storage available.

Properties

Count

Determine the size of the ILongArray.

Declaration
int Count { get; }
Property Value
Type Description
int

The number of elements in the ILongArray.

FirstIndex

Determine the first index that exists in the ILongArray.

Declaration
long FirstIndex { get; }
Property Value
Type Description
long

The lowest long value, 0 <= n <= Int64.MaxValue, that exists in this ILongArray, or -1 if the ILongArray is empty.

IsEmpty

Determine if ILongArray is empty.

Declaration
bool IsEmpty { get; }
Property Value
Type Description
bool

true if ILongArray has no elements.

this[long]

The value stored at the specified index.

Declaration
object this[long index] { get; set; }
Parameters
Type Name Description
long index

A long index value.

Property Value
Type Description
object

The object stored at the specified index, or null.

LastIndex

Determine the last index that exists in the ILongArray.

Declaration
long LastIndex { get; }
Property Value
Type Description
long

The highest long value, 0 <= n <= Int64.MaxValue, that exists in this ILongArray, or -1 if the ILongArray is empty.

SyncRoot

Gets an object that can be used to synchronize access to this ILongArray.

Declaration
object SyncRoot { get; }
Property Value
Type Description
object

Object used to synchronize access to this ILongArray.

Methods

Add(object)

Add the passed element value to the ILongArray and return the index at which the element value was stored.

Declaration
long Add(object value)
Parameters
Type Name Description
object value

The object to add to the ILongArray.

Returns
Type Description
long

The long index value at which the element value was stored.

Clear()

Remove all elements from the ILongArray.

Declaration
void Clear()

Contains(object)

Determine if the ILongArray contains the specified element.

Declaration
bool Contains(object value)
Parameters
Type Name Description
object value

Element whose presence in this list is to be tested.

Returns
Type Description
bool

true if this list contains the specified element.

Remarks

More formally, returns true if and only if this ILongArray contains at least one element e such that (o==null ? e==null : o.Equals(e)).

Equals(object)

Test for ILongArray equality.

Declaration
bool Equals(object o)
Parameters
Type Name Description
object o

An Object to compare to this ILongArray for equality.

Returns
Type Description
bool

true if the passed Object is an ILongArray containing the same indexes and whose elements at those indexes are equal.

Exists(long)

Determine if the specified index is in use.

Declaration
bool Exists(long index)
Parameters
Type Name Description
long index

A long index value.

Returns
Type Description
bool

true if a value (including null) is stored at the specified index, otherwise false.

GetEnumerator()

Obtain an IEnumerator of the contents of the ILongArray.

Declaration
IEnumerator GetEnumerator()
Returns
Type Description
IEnumerator

An instance of IEnumerator.

GetEnumerator(long)

Obtain an IEnumerator of the contents of the ILongArray, starting at a particular index such that the first call to MoveNext will set the location of the enumerator at the first existent index that is greater than or equal to the specified index, or will throw an IndexOutOfRangeException if there is no such existent index.

Declaration
IEnumerator GetEnumerator(long index)
Parameters
Type Name Description
long index

The ILongArray index to iterate from.

Returns
Type Description
IEnumerator

An instance of IEnumerator.

Exceptions
Type Condition
IndexOutOfRangeException

If index greater than or equal to the specified index does not exist.

Remove(long)

Remove the specified index from the ILongArray, returning its associated value.

Declaration
object Remove(long index)
Parameters
Type Name Description
long index

The index into the ILongArray.

Returns
Type Description
object

The associated value (which can be null) or null if the specified index is not in the ILongArray.

ToString()

Provide a string representation of the ILongArray.

Declaration
string ToString()
Returns
Type Description
string

A human-readable string value describing the ILongArray instance.

In this article
Back to top Copyright © 2000, 2024, Oracle and/or its affiliates.