Class LongSortedList
A data structure resembling an array keyed by .NET long values.
Implements
Inherited Members
Namespace: Tangosol.Util
Assembly: Coherence.dll
Syntax
public class LongSortedList : ILongArray
Remarks
LongSortedList structure is based on System.Collections.SortedList collection.
Constructors
LongSortedList()
Default constructor.
Declaration
public LongSortedList()
Properties
Count
Determine the size of the ILongArray.
Declaration
public virtual 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
public virtual 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
public virtual bool IsEmpty { get; }
Property Value
Type | Description |
---|---|
bool | true if ILongArray has no elements. |
this[long]
The value stored at the specified index.
Declaration
public virtual 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 |
LastIndex
Determine the last index that exists in the ILongArray.
Declaration
public virtual 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
public virtual 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
public virtual 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
public virtual void Clear()
Contains(object)
Determine if the ILongArray contains the specified element.
Declaration
public virtual 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)).
Exists(long)
Determine if the specified index is in use.
Declaration
public virtual bool Exists(long index)
Parameters
Type | Name | Description |
---|---|---|
long | index | A long index value. |
Returns
Type | Description |
---|---|
bool | true if a value (including |
GetEnumerator()
Obtain an IEnumerator of the contents of the ILongArray.
Declaration
public virtual 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
public virtual 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
public virtual 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 |