Source: Jon Skeet - http://www.yoda.arachsys.com/csharp/miscutil/ A class with a similar function to System.Collections.Queue, but allowing random access to the contents of the queue as well as the usual enqueuing at the end and dequeuing at the start. This implementation is not synchronized at all - clients should provide their own synchronization. A SyncRoot is provided for this purpose, although any other common reference may also be used. In order to provide an efficient implementation of both random access and the removal of items from the start of the queue, a circular buffer is used and resized when necessary. The buffer never shrinks unless TrimToSize is called.

Namespace: MonoSoftware.Core.Collections
Assembly: MonoSoftware.Core (in MonoSoftware.Core.dll) Version: 1.0.40.669 (1.0.40.669)

Syntax

C#
public sealed class RandomAccessQueue<T> : ICollection<T>, 
	ICollection, IEnumerable<T>, IEnumerable, ICloneable
Visual Basic
Public NotInheritable Class RandomAccessQueue(Of T)
	Implements ICollection(Of T), ICollection, IEnumerable(Of T), 
	IEnumerable, ICloneable
Visual C++
generic<typename T>
public ref class RandomAccessQueue sealed : ICollection<T>, 
	ICollection, IEnumerable<T>, IEnumerable, ICloneable
F#
[<SealedAttribute>]
type RandomAccessQueue<'T> =  
    class
        interface ICollection<'T>
        interface ICollection
        interface IEnumerable<'T>
        interface IEnumerable
        interface ICloneable
    end

Type Parameters

T

Inheritance Hierarchy

System..::..Object
  MonoSoftware.Core.Collections..::..RandomAccessQueue<(Of <(<'T>)>)>

See Also