Class LongList<T>
Collection class that permits storage of over int.MaxValue items. This is performed
by using a 2D list of lists. The internal lists are only initialized as necessary. This
collection implements IEnumerable to make it easier to run LINQ queries against it.
Inheritance
Inherited Members
Namespace:Microsoft.SqlTools.ServiceLayer.Utility
Assembly:Microsoft.SqlTools.ServiceLayer.dll
Syntax
public class LongList<T> : IEnumerable<T>, IEnumerable
Type Parameters
| Name | Description |
|---|---|
| T | Type of the values to store |
Remarks
This class is based on code from $\Data Tools\SSMS_Main\sql\ssms\core\DataStorage\ArrayList64.cs with additions to bring it up to .NET 4.5 standards
Constructors
| Improve this Doc View SourceLongList()
Creates a new long list
Declaration
public LongList()
Properties
| Improve this Doc View SourceCount
The total number of elements in the array
Declaration
public long Count { get; }
Property Value
| Type | Description |
|---|---|
| System.Int64 |
ExpandListSize
Declaration
public int ExpandListSize { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
Item[Int64]
Declaration
public T this[long index] { get; }
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int64 | index |
Property Value
| Type | Description |
|---|---|
| T |
Methods
| Improve this Doc View SourceAdd(T)
Adds the specified value to the end of the list
Declaration
public long Add(T val)
Parameters
| Type | Name | Description |
|---|---|---|
| T | val | Value to add to the list |
Returns
| Type | Description |
|---|---|
| System.Int64 | Index of the item that was just added |
GetEnumerator()
Returns a generic enumerator for enumeration of this LongList
Declaration
public IEnumerator<T> GetEnumerator()
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerator<T> | Enumerator for LongList |
Implements
GetItem(Int64)
Returns the item at the specified index
Declaration
public T GetItem(long index)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int64 | index | Index of the item to return |
Returns
| Type | Description |
|---|---|
| T | The item at the index specified |
RemoveAt(Int64)
Removes an item at the specified location and shifts all the items after the provided index up by one.
Declaration
public void RemoveAt(long index)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int64 | index | The index to remove from the list |
Explicit Interface Implementations
| Improve this Doc View SourceIEnumerable.GetEnumerator()
Returns an enumerator for enumeration of this LongList
Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
| Type | Description |
|---|---|
| System.Collections.IEnumerator |