Ringlet.Collections

An NDoc Documented Class Library

Ringlet.Collections Namespace

Classes

Class | Description
RotDeque | A deque implemented as a fixed-size array.
RotDeque.RotDequeEnumerator | An enumerator for the elements of a RotDeque
TieredVector | An implementation of a tiered vector.
TieredVector.TieredVectorEnumerator | An enumerator for the TieredVector class.


RotDeque Class

A deque implemented as a fixed-size array.

For a list of all members of this type, see RotDeque Members.

System.Object
RotDeque

public class RotDeque : IList, ICollection, IEnumerable, ICloneable

Requirements

Namespace: Ringlet.Collections

Assembly: Ringlet.Collections (in Ringlet.Collections.dll)

See Also

RotDeque Members | Ringlet.Collections Namespace


RotDeque Members

RotDeque overview

Public Static Fields

RotDequeDefaultSize The default size for a newly-created deque.

Public Instance Constructors

RotDeque Overloaded. Initializes a new instance of the RotDeque class.

Public Instance Properties

AtBack | Non-destructive retrieval of the element at the back of the deque.
AtFront | Non-destructive retrieval of the element at the head of the deque.
Capacity | Get the deque's capacity.
Count | Get the number of elements currently on the deque.
Empty | Query whether the deque is empty.
Full | Query whether the deque is full.
IsFixedSize | Get a value indicating whether the deque has a fixed size.
IsReadOnly | Get a value indicating whether the deque is read-only.
IsSynchronized | Gets a value indicating whether access to the RotDeque is synchronized (thread-safe).
Item | Retrieve an element from the deque.
SyncRoot | Gets an object that may be used to synchronize access to the RotDeque.

Public Instance Methods

Add | Add an element to the end of the deque.
Clear | Remove all elements from the deque.
Clone | Perform a shallow copy of the deque.
Contains | Determine whether an element is on the deque.
CopyTo | Overloaded. Copies the deque's contents to an array.
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetEnumerator | Gets an enumerator on the deque's elements.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
IndexOf | Determine the index of an element on the deque.
Insert | Insert an item into the deque at a specified position.
Normalize | Push the deque's elements to the left (so that head = 0).
PopBack | Pop an element from the back of the deque.
PopFront | Pop an element from the head of the deque.
PushBack | Push an element at the end of the deque.
PushFront | Push an element on the head of the deque.
Remove | Remove the first occurence of an element from the deque.
RemoveAt | Remove the element at a specified position on the deque.
Split | Copy the deque's contents into an array of deques.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Fields

head | The element at the head of the deque.
items | The items in the deque.
size | The deque size.
tail | The element just past the tail of the deque.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.
RealIndex | Get the actual position of an object in the items[] array.

See Also

RotDeque Class | Ringlet.Collections Namespace


RotDeque Constructor

Initialize a RotDeque object with a default size of 16.

Overload List

Initialize a RotDeque object with a default size of 16.

public RotDeque();

Initialize a RotDeque object with the specified size.

public RotDeque(int);

See Also

RotDeque Class | Ringlet.Collections Namespace


RotDeque Constructor ()

Initialize a RotDeque object with a default size of 16.

public RotDeque();

See Also

RotDeque Class | Ringlet.Collections Namespace | RotDeque Constructor Overload List


RotDeque Constructor (Int32)

Initialize a RotDeque object with the specified size.

public RotDeque(
int sz
);

Parameters

sz
the deque size

Exceptions

Exception Type | Condition
ArgumentException | A negative value was specified for the size parameter.

See Also

RotDeque Class | Ringlet.Collections Namespace | RotDeque Constructor Overload List


RotDeque Fields

The fields of the RotDeque class are listed below. For a complete list of RotDeque class members, see the RotDeque Members topic.

Public Static Fields

RotDequeDefaultSize The default size for a newly-created deque.

Protected Instance Fields

head | The element at the head of the deque.
items | The items in the deque.
size | The deque size.
tail | The element just past the tail of the deque.

See Also

RotDeque Class | Ringlet.Collections Namespace


RotDeque.head Field

The element at the head of the deque.

protected int head;

See Also

RotDeque Class | Ringlet.Collections Namespace


RotDeque.items Field

The items in the deque.

protected object[] items;

See Also

RotDeque Class | Ringlet.Collections Namespace


RotDeque.RotDequeDefaultSize Field

The default size for a newly-created deque.

public const int RotDequeDefaultSize;

See Also

RotDeque Class | Ringlet.Collections Namespace


RotDeque.size Field

The deque size.

protected int size;

See Also

RotDeque Class | Ringlet.Collections Namespace


RotDeque.tail Field

The element just past the tail of the deque.

protected int tail;

See Also

RotDeque Class | Ringlet.Collections Namespace


RotDeque Properties

The properties of the RotDeque class are listed below. For a complete list of RotDeque class members, see the RotDeque Members topic.

Public Instance Properties

AtBack | Non-destructive retrieval of the element at the back of the deque.
AtFront | Non-destructive retrieval of the element at the head of the deque.
Capacity | Get the deque's capacity.
Count | Get the number of elements currently on the deque.
Empty | Query whether the deque is empty.
Full | Query whether the deque is full.
IsFixedSize | Get a value indicating whether the deque has a fixed size.
IsReadOnly | Get a value indicating whether the deque is read-only.
IsSynchronized | Gets a value indicating whether access to the RotDeque is synchronized (thread-safe).
Item | Retrieve an element from the deque.
SyncRoot | Gets an object that may be used to synchronize access to the RotDeque.

See Also

RotDeque Class | Ringlet.Collections Namespace


RotDeque.AtBack Property

Non-destructive retrieval of the element at the back of the deque.

public virtual object AtBack {get;}

Exceptions

Exception Type | Condition
InvalidOperationException | An attempt was made to fetch an element from an empty deque.

See Also

RotDeque Class | Ringlet.Collections Namespace


RotDeque.AtFront Property

Non-destructive retrieval of the element at the head of the deque.

public virtual object AtFront {get;}

Exceptions

Exception Type | Condition
InvalidOperationException | An attempt was made to fetch an element from an empty deque.

See Also

RotDeque Class | Ringlet.Collections Namespace


RotDeque.Capacity Property

Get the deque's capacity.

public virtual int Capacity {get;}

See Also

RotDeque Class | Ringlet.Collections Namespace


RotDeque.Count Property

Get the number of elements currently on the deque.

public virtual int Count {get;}

Implements

ICollection.Count

See Also

RotDeque Class | Ringlet.Collections Namespace


RotDeque.Empty Property

Query whether the deque is empty.

public virtual bool Empty {get;}

See Also

RotDeque Class | Ringlet.Collections Namespace


RotDeque.Full Property

Query whether the deque is full.

public virtual bool Full {get;}

See Also

RotDeque Class | Ringlet.Collections Namespace


RotDeque.IsFixedSize Property

Get a value indicating whether the deque has a fixed size.

public virtual bool IsFixedSize {get;}

Implements

IList.IsFixedSize

See Also

RotDeque Class | Ringlet.Collections Namespace


RotDeque.IsReadOnly Property

Get a value indicating whether the deque is read-only.

public virtual bool IsReadOnly {get;}

Implements

IList.IsReadOnly

See Also

RotDeque Class | Ringlet.Collections Namespace


RotDeque.IsSynchronized Property

Gets a value indicating whether access to the RotDeque is synchronized (thread-safe).

public virtual bool IsSynchronized {get;}

Implements

ICollection.IsSynchronized

See Also

RotDeque Class | Ringlet.Collections Namespace


RotDeque.Item Property

Retrieve an element from the deque.

public virtual object this[
int idx
] {get; set;}

Implements

IList.Item

Exceptions

Exception Type | Condition
ArgumentOutOfRangeException | The idx parameter was either negative or larger than the current element count.

See Also

RotDeque Class | Ringlet.Collections Namespace


RotDeque.SyncRoot Property

Gets an object that may be used to synchronize access to the RotDeque.

public virtual object SyncRoot {get;}

Implements

ICollection.SyncRoot

See Also

RotDeque Class | Ringlet.Collections Namespace


RotDeque Methods

The methods of the RotDeque class are listed below. For a complete list of RotDeque class members, see the RotDeque Members topic.

Public Instance Methods

Add | Add an element to the end of the deque.
Clear | Remove all elements from the deque.
Clone | Perform a shallow copy of the deque.
Contains | Determine whether an element is on the deque.
CopyTo | Overloaded. Copies the deque's contents to an array.
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetEnumerator | Gets an enumerator on the deque's elements.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
IndexOf | Determine the index of an element on the deque.
Insert | Insert an item into the deque at a specified position.
Normalize | Push the deque's elements to the left (so that head = 0).
PopBack | Pop an element from the back of the deque.
PopFront | Pop an element from the head of the deque.
PushBack | Push an element at the end of the deque.
PushFront | Push an element on the head of the deque.
Remove | Remove the first occurence of an element from the deque.
RemoveAt | Remove the element at a specified position on the deque.
Split | Copy the deque's contents into an array of deques.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.
RealIndex | Get the actual position of an object in the items[] array.

See Also

RotDeque Class | Ringlet.Collections Namespace


RotDeque.Add Method

Add an element to the end of the deque.

public virtual int Add(
object o
);

Parameters

o
The element to add.

Return Value

The index of the element added.

Implements

IList.Add

See Also

RotDeque Class | Ringlet.Collections Namespace


RotDeque.Clear Method

Remove all elements from the deque.

public virtual void Clear();

Implements

IList.Clear

See Also

RotDeque Class | Ringlet.Collections Namespace


RotDeque.Clone Method

Perform a shallow copy of the deque.

public object Clone();

Return Value

A shallow copy of the deque.

Implements

ICloneable.Clone

See Also

RotDeque Class | Ringlet.Collections Namespace


RotDeque.Contains Method

Determine whether an element is on the deque.

public virtual bool Contains(
object o
);

Parameters

o
The element to look for.

Return Value

True if the element is on the deque.

Implements

IList.Contains

See Also

RotDeque Class | Ringlet.Collections Namespace


CopyTo Method

An NDoc Documented Class Library

RotDeque.CopyTo Method

Append the elements of a deque to the end of another deque.

Overload List

Append the elements of a deque to the end of another deque.

public virtual void CopyTo(RotDeque);

Copies the deque's contents to an array.

public virtual void CopyTo(Array,int);

See Also

RotDeque Class | Ringlet.Collections Namespace


RotDeque.CopyTo Method (RotDeque)

Append the elements of a deque to the end of another deque.

public virtual void CopyTo(
RotDeque d
);

Parameters

d
The deque to append to.

Exceptions

Exception Type | Condition
ArgumentNullException | The d parameter had an undefined value.
ArgumentException | There was not enough space in the destination deque d to accomodate all of the source deque's elements.

See Also

RotDeque Class | Ringlet.Collections Namespace | RotDeque.CopyTo Overload List


RotDeque.CopyTo Method (Array, Int32)

Copies the deque's contents to an array.

public virtual void CopyTo(
Array array,
int idx
);

Parameters

array
The array to copy to.
idx
The array position to start copying at.

Implements

ICollection.CopyTo

Exceptions

Exception Type | Condition
ArgumentException | A multidimensional array parameter was specified, or there was not enough space in the array to accomodate all of the deque's elements.
ArgumentNullException | An undefined value was specified for the array parameter.
ArgumentOutOfRangeException | A negative value was specified for the idx parameter.

See Also

RotDeque Class | Ringlet.Collections Namespace | RotDeque.CopyTo Overload List


RotDeque.GetEnumerator Method

Gets an enumerator on the deque's elements.

public virtual IEnumerator GetEnumerator();

Return Value

An enumerator.

Implements

IEnumerable.GetEnumerator

See Also

RotDeque Class | Ringlet.Collections Namespace


RotDeque.IndexOf Method

Determine the index of an element on the deque.

public virtual int IndexOf(
object o
);

Parameters

o
The element to look for.

Return Value

The index of the element on the deque, or -1 if the element is not present.

Implements

IList.IndexOf

See Also

RotDeque Class | Ringlet.Collections Namespace


RotDeque.Insert Method

Insert an item into the deque at a specified position.

public virtual void Insert(
int pos,
object o
);

Parameters

pos
The position to insert at.
o
The element to insert.

Implements

IList.Insert

Remarks

The position is zero-based, with 0 being equivalent to a PushFront(), and Count being equivalent to a PushBack().

Exceptions

Exception Type | Condition
InvalidOperationException | An attempt was made to insert an element into a full deque.
ArgumentOutOfRangeException | The pos parameter specified a position beyond the deque boundaries.

See Also

RotDeque Class | Ringlet.Collections Namespace


RotDeque.Normalize Method

Push the deque's elements to the left (so that head = 0).

public virtual void Normalize();

See Also

RotDeque Class | Ringlet.Collections Namespace


RotDeque.PopBack Method

Pop an element from the back of the deque.

public virtual object PopBack();

Return Value

The element removed from the back of the deque.

Exceptions

Exception Type | Condition
InvalidOperationException | An attempt was made to pop an element from an empty deque.

See Also

RotDeque Class | Ringlet.Collections Namespace


RotDeque.PopFront Method

Pop an element from the head of the deque.

public virtual object PopFront();

Return Value

The element removed from the head of the deque.

Exceptions

Exception Type | Condition
InvalidOperationException | An attempt was made to pop an element from an empty deque.

See Also

RotDeque Class | Ringlet.Collections Namespace


RotDeque.PushBack Method

Push an element at the end of the deque.

public virtual void PushBack(
object o
);

Parameters

o
The object to push.

Exceptions

Exception Type | Condition
InvalidOperationException | An attempt was made to push an element onto a full deque.

See Also

RotDeque Class | Ringlet.Collections Namespace


RotDeque.PushFront Method

Push an element on the head of the deque.

public virtual void PushFront(
object o
);

Parameters

o
The object to push.

Exceptions

Exception Type | Condition
InvalidOperationException | An attempt was made to push an element onto a full deque.

See Also

RotDeque Class | Ringlet.Collections Namespace


RotDeque.RealIndex Method

Get the actual position of an object in the items[] array.

protected int RealIndex(
int idx
);

Parameters

idx
the index relative to the deque's head

Return Value

The index in the items[] array.

See Also

RotDeque Class | Ringlet.Collections Namespace


RotDeque.Remove Method

Remove the first occurence of an element from the deque.

public virtual void Remove(
object o
);

Parameters

o
The element to remove.

Implements

IList.Remove

See Also

RotDeque Class | Ringlet.Collections Namespace


RotDeque.RemoveAt Method

Remove the element at a specified position on the deque.

public virtual void RemoveAt(
int idx
);

Parameters

idx
The position of the element to remove.

Implements

IList.RemoveAt

Exceptions

Exception Type | Condition
ArgumentOutOfRangeException | A negative or too large index was specified by the idx parameter.

See Also

RotDeque Class | Ringlet.Collections Namespace


RotDeque.Split Method

Copy the deque's contents into an array of deques.

public virtual void Split(
RotDeque[] deques
);

Parameters

deques
The destination array of deques.

Exceptions

Exception Type | Condition
ArgumentNullException | Either the destination array or some of the deques within it had an undefined value.
ArgumentException | There was not enough total free space in the destination array of deques.
ApplicationException | The free space in the deques was calculated to be enough at the start of the operation, but either the source deque or some of the destination deques were modified in-flight, and not all elements could be copied.

See Also

RotDeque Class | Ringlet.Collections Namespace


RotDeque.RotDequeEnumerator Class

An enumerator for the elements of a RotDeque

For a list of all members of this type, see RotDeque.RotDequeEnumerator Members.

System.Object
RotDeque.RotDequeEnumerator

protected sealed class RotDeque.RotDequeEnumerator : IEnumerator

Requirements

Namespace: Ringlet.Collections

Assembly: Ringlet.Collections (in Ringlet.Collections.dll)

See Also

RotDeque.RotDequeEnumerator Members | Ringlet.Collections Namespace


RotDeque.RotDequeEnumerator Members

RotDeque.RotDequeEnumerator overview

Public Instance Constructors

RotDeque.RotDequeEnumerator Overloaded. Initializes a new instance of the RotDeque.RotDequeEnumerator class.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

Private Instance Properties

System.Collections.IEnumerator.Current

Explicit Interface Implementations

IEnumerator.MoveNext | Advance the enumerator if possible.
IEnumerator.Reset | Reset the enumerator to the head of the deque.

See Also

RotDeque.RotDequeEnumerator Class | Ringlet.Collections Namespace


RotDeque.RotDequeEnumerator Constructor

Initialize a RotDequeEnumerator from the start of a deque.

Overload List

Initialize a RotDequeEnumerator from the start of a deque.

public RotDeque.RotDequeEnumerator(RotDeque);

Initialize a RotDequeEnumerator from a specified position of the deque.

public RotDeque.RotDequeEnumerator(RotDeque,int);

See Also

RotDeque.RotDequeEnumerator Class | Ringlet.Collections Namespace


RotDeque.RotDequeEnumerator Constructor (RotDeque)

Initialize a RotDequeEnumerator from the start of a deque.

public RotDeque.RotDequeEnumerator(
RotDeque d
);

Parameters

d
The deque to enumerate.

See Also

RotDeque.RotDequeEnumerator Class | Ringlet.Collections Namespace | RotDeque.RotDequeEnumerator Constructor Overload List


RotDeque.RotDequeEnumerator Constructor (RotDeque, Int32)

Initialize a RotDequeEnumerator from a specified position of the deque.

public RotDeque.RotDequeEnumerator(
RotDeque d,
int p
);

Parameters

d
p

See Also

RotDeque.RotDequeEnumerator Class | Ringlet.Collections Namespace | RotDeque.RotDequeEnumerator Constructor Overload List


RotDeque.RotDequeEnumerator Properties

The properties of the RotDeque.RotDequeEnumerator class are listed below. For a complete list of RotDeque.RotDequeEnumerator class members, see the RotDeque.RotDequeEnumerator Members topic.

Private Instance Properties

System.Collections.IEnumerator.Current

See Also

RotDeque.RotDequeEnumerator Class | Ringlet.Collections Namespace


RotDeque.RotDequeEnumerator.System.Collections.IEnumerator.Current Property

private object System.Collections.IEnumerator.Current {get;}

See Also

RotDeque.RotDequeEnumerator Class | Ringlet.Collections Namespace


RotDeque.RotDequeEnumerator Methods

The methods of the RotDeque.RotDequeEnumerator class are listed below. For a complete list of RotDeque.RotDequeEnumerator class members, see the RotDeque.RotDequeEnumerator Members topic.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

Explicit Interface Implementations

IEnumerator.MoveNext | Advance the enumerator if possible.
IEnumerator.Reset | Reset the enumerator to the head of the deque.

See Also

RotDeque.RotDequeEnumerator Class | Ringlet.Collections Namespace


RotDeque.RotDequeEnumerator.IEnumerator.MoveNext Method

Advance the enumerator if possible.

bool IEnumerator.MoveNext();

Return Value

True if there are more elements to be retrieved.

Implements

IEnumerator.MoveNext

See Also

RotDeque.RotDequeEnumerator Class | Ringlet.Collections Namespace


RotDeque.RotDequeEnumerator.IEnumerator.Reset Method

Reset the enumerator to the head of the deque.

void IEnumerator.Reset();

Implements

IEnumerator.Reset

See Also

RotDeque.RotDequeEnumerator Class | Ringlet.Collections Namespace


TieredVector Class

An implementation of a tiered vector.

For a list of all members of this type, see TieredVector Members.

System.Object
TieredVector

public class TieredVector : IList, ICollection, IEnumerable, ICloneable

Remarks

A tiered vector is a two-layered data structure characterized by a numerical value usually referred to as n. It consists of a vector of size 2^n containing pointers to 2^n more vectors of size 2^n, which in their turn contain the actual sorted keys.

For more information, see Tiered Vectors - Efficient Dynamic Arrays for Rank-Based Sequences, a paper by Michael T. Goodrich and John G. Kloss II.

Requirements

Namespace: Ringlet.Collections

Assembly: Ringlet.Collections (in Ringlet.Collections.dll)

See Also

TieredVector Members | Ringlet.Collections Namespace


TieredVector Members

TieredVector overview

Public Static Fields

TieredVectorDefaultN The default characteristic value of a vector.

Public Instance Constructors

TieredVector Overloaded. Initializes a new instance of the TieredVector class.

Public Instance Properties

Capacity | Get the total vector capacity.
Count | Get the number of elements in the vector.
Empty | Check if the vector is empty.
Full | Check if the vector is filled to capacity and adding another element would cause it to grow.
IsFixedSize | Get a value indicating whether the tiered vector has a fixed size.
IsReadOnly | Get a value indicating whether the tiered vector is read-only.
IsSynchronized | Get a value indicating whether the tiered vector is safe for multithreaded operations.
Item | Retrieve a vector element by index.
SyncRoot | Get an object suitable for thread synchronization.

Public Instance Methods

Add | Overloaded. Adds an element into the vector, preserving the sorting of the rest.
Clear | Removes all elements from the vector.
Clone | Perform a shallow copy of the tiered vector.
Contains | Determines whether an element is contained in the vector.
CopyTo | Copy the vector's elements to an array.
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetEnumerator | Get an enumerator on the tiered vector.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
IndexOf | Overloaded. Find the first occurrence of an element in the vector.
Insert | Insert an element at a specified position into the tiered vector.
Remove | Overloaded. Remove the first occurrence of the specified object.
RemoveAt | Remove the element at the specified index.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Fields

deques | The actual array of 2^N deques.
mask | The value of 2^N-1, cached to facilitate calculations.
n | The value of N - the tiered vector's characteristic value.
n2 | The value of 2^N - the number of deques within the vector, the number of elements within a deque.
next | The index of the deque containing the first empty element.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
GetPosInD | Find the deque in which an object should be placed.
GetPosInDeque | Find the position at which an object would be placed in a deque.
Grow | Grow the tiered vector.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.
Shrink | Shrink the tiered vector.

See Also

TieredVector Class | Ringlet.Collections Namespace


TieredVector Constructor

Initialize a TieredVector object using the default characteristic value TieredVectorDefaultN

Overload List

Initialize a TieredVector object using the default characteristic value TieredVectorDefaultN

public TieredVector();

Initialize a TieredVector object with a specified N.

public TieredVector(int);

See Also

TieredVector Class | Ringlet.Collections Namespace


TieredVector Constructor ()

Initialize a TieredVector object using the default characteristic value TieredVectorDefaultN

public TieredVector();

See Also

TieredVector Class | Ringlet.Collections Namespace | TieredVector Constructor Overload List


TieredVector Constructor (Int32)

Initialize a TieredVector object with a specified N.

public TieredVector(
int nn
);

Parameters

nn
The tiered vector characteristic.

Exceptions

Exception Type | Condition
ArgumentOutOfRangeException | A value less than 1 was specified for the nn parameter.

See Also

TieredVector Class | Ringlet.Collections Namespace | TieredVector Constructor Overload List


TieredVector Fields

The fields of the TieredVector class are listed below. For a complete list of TieredVector class members, see the TieredVector Members topic.

Public Static Fields

TieredVectorDefaultN The default characteristic value of a vector.

Protected Instance Fields

deques | The actual array of 2^N deques.
mask | The value of 2^N-1, cached to facilitate calculations.
n | The value of N - the tiered vector's characteristic value.
n2 | The value of 2^N - the number of deques within the vector, the number of elements within a deque.
next | The index of the deque containing the first empty element.

See Also

TieredVector Class | Ringlet.Collections Namespace


TieredVector.deques Field

The actual array of 2^N deques.

protected RotDeque[] deques;

See Also

TieredVector Class | Ringlet.Collections Namespace


TieredVector.mask Field

The value of 2^N-1, cached to facilitate calculations.

protected int mask;

See Also

TieredVector Class | Ringlet.Collections Namespace


TieredVector.n Field

The value of N - the tiered vector's characteristic value.

protected int n;

Remarks

As noted above, the deques array will consist of 2^N deques, each comprising up to 2^N actual keys.

See Also

TieredVector Class | Ringlet.Collections Namespace


TieredVector.n2 Field

The value of 2^N - the number of deques within the vector, the number of elements within a deque.

protected int n2;

See Also

TieredVector Class | Ringlet.Collections Namespace


TieredVector.next Field

The index of the deque containing the first empty element.

protected int next;

See Also

TieredVector Class | Ringlet.Collections Namespace


TieredVector.TieredVectorDefaultN Field

The default characteristic value of a vector.

public const int TieredVectorDefaultN;

Remarks

This value will be used as n if it is not provided to the TieredVector class constructor.

See Also

TieredVector Class | Ringlet.Collections Namespace


TieredVector Properties

The properties of the TieredVector class are listed below. For a complete list of TieredVector class members, see the TieredVector Members topic.

Public Instance Properties

Capacity | Get the total vector capacity.
Count | Get the number of elements in the vector.
Empty | Check if the vector is empty.
Full | Check if the vector is filled to capacity and adding another element would cause it to grow.
IsFixedSize | Get a value indicating whether the tiered vector has a fixed size.
IsReadOnly | Get a value indicating whether the tiered vector is read-only.
IsSynchronized | Get a value indicating whether the tiered vector is safe for multithreaded operations.
Item | Retrieve a vector element by index.
SyncRoot | Get an object suitable for thread synchronization.

See Also

TieredVector Class | Ringlet.Collections Namespace


TieredVector.Capacity Property

Get the total vector capacity.

public int Capacity {get;}

See Also

TieredVector Class | Ringlet.Collections Namespace


TieredVector.Count Property

Get the number of elements in the vector.

public int Count {get;}

Implements

ICollection.Count

See Also

TieredVector Class | Ringlet.Collections Namespace


TieredVector.Empty Property

Check if the vector is empty.

public bool Empty {get;}

See Also

TieredVector Class | Ringlet.Collections Namespace


TieredVector.Full Property

Check if the vector is filled to capacity and adding another element would cause it to grow.

public bool Full {get;}

See Also

TieredVector Class | Ringlet.Collections Namespace


TieredVector.IsFixedSize Property

Get a value indicating whether the tiered vector has a fixed size.

public virtual bool IsFixedSize {get;}

Implements

IList.IsFixedSize

See Also

TieredVector Class | Ringlet.Collections Namespace


TieredVector.IsReadOnly Property

Get a value indicating whether the tiered vector is read-only.

public virtual bool IsReadOnly {get;}

Implements

IList.IsReadOnly

See Also

TieredVector Class | Ringlet.Collections Namespace


TieredVector.IsSynchronized Property

Get a value indicating whether the tiered vector is safe for multithreaded operations.

public virtual bool IsSynchronized {get;}

Implements

ICollection.IsSynchronized

See Also

TieredVector Class | Ringlet.Collections Namespace


TieredVector.Item Property

Retrieve a vector element by index.

public virtual object this[
int idx
] {get; set;}

Implements

IList.Item

Exceptions

Exception Type | Condition
ArgumentOutOfRangeException | A negative or overly large value was specified for the idx parameter.
InvalidOperationException | Direct setting of tiered vector elements is not supported.

See Also

TieredVector Class | Ringlet.Collections Namespace


TieredVector.SyncRoot Property

Get an object suitable for thread synchronization.

public virtual object SyncRoot {get;}

Implements

ICollection.SyncRoot

See Also

TieredVector Class | Ringlet.Collections Namespace


TieredVector Methods

The methods of the TieredVector class are listed below. For a complete list of TieredVector class members, see the TieredVector Members topic.

Public Instance Methods

Add | Overloaded. Adds an element into the vector, preserving the sorting of the rest.
Clear | Removes all elements from the vector.
Clone | Perform a shallow copy of the tiered vector.
Contains | Determines whether an element is contained in the vector.
CopyTo | Copy the vector's elements to an array.
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetEnumerator | Get an enumerator on the tiered vector.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
IndexOf | Overloaded. Find the first occurrence of an element in the vector.
Insert | Insert an element at a specified position into the tiered vector.
Remove | Overloaded. Remove the first occurrence of the specified object.
RemoveAt | Remove the element at the specified index.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
GetPosInD | Find the deque in which an object should be placed.
GetPosInDeque | Find the position at which an object would be placed in a deque.
Grow | Grow the tiered vector.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.
Shrink | Shrink the tiered vector.

See Also

TieredVector Class | Ringlet.Collections Namespace


Add Method

An NDoc Documented Class Library

TieredVector.Add Method

Add an element to the tiered vector.

Overload List

Add an element to the tiered vector.

public virtual int Add(IComparable);

Adds an element into the vector, preserving the sorting of the rest.

public virtual int Add(object);

See Also

TieredVector Class | Ringlet.Collections Namespace


TieredVector.Add Method (IComparable)

Add an element to the tiered vector.

public virtual int Add(
IComparable o
);

Parameters

o
The element to add.

Return Value

The position the element was added at.

See Also

TieredVector Class | Ringlet.Collections Namespace | TieredVector.Add Overload List


TieredVector.Add Method (Object)

Adds an element into the vector, preserving the sorting of the rest.

public virtual int Add(
object o
);

Parameters

o
The element to add.

Return Value

The position of the newly-added element.

Implements

IList.Add

See Also

TieredVector Class | Ringlet.Collections Namespace | TieredVector.Add Overload List


TieredVector.Clear Method

Removes all elements from the vector.

public virtual void Clear();

Implements

IList.Clear

See Also

TieredVector Class | Ringlet.Collections Namespace


TieredVector.Clone Method

Perform a shallow copy of the tiered vector.

public virtual object Clone();

Return Value

A shallow copy of the vector.

Implements

ICloneable.Clone

See Also

TieredVector Class | Ringlet.Collections Namespace


TieredVector.Contains Method

Determines whether an element is contained in the vector.

public virtual bool Contains(
object o
);

Parameters

o
The element to look for.

Return Value

True if the vector contains this element.

Implements

IList.Contains

See Also

TieredVector Class | Ringlet.Collections Namespace


TieredVector.CopyTo Method

Copy the vector's elements to an array.

public virtual void CopyTo(
Array array,
int idx
);

Parameters

array
The array to copy to.
idx
The index to start copying from.

Implements

ICollection.CopyTo

Exceptions

Exception Type | Condition
ArgumentException | The array parameter was either multidimensional or did not have enough free elements to accomodate all of the tiered vector's ones.
ArgumentNullException | An undefined value was specified for the array parameter.
ArgumentOutOfRangeException | A negative value was specified for the idx parameter.

See Also

TieredVector Class | Ringlet.Collections Namespace


TieredVector.GetEnumerator Method

Get an enumerator on the tiered vector.

public virtual IEnumerator GetEnumerator();

Return Value

A vector enumerator.

Implements

IEnumerable.GetEnumerator

See Also

TieredVector Class | Ringlet.Collections Namespace


TieredVector.GetPosInD Method

Find the deque in which an object should be placed.

protected int GetPosInD(
IComparable o
);

Parameters

o
The object to examine.

Return Value

The index in the deques[] array.

See Also

TieredVector Class | Ringlet.Collections Namespace


TieredVector.GetPosInDeque Method

Find the position at which an object would be placed in a deque.

protected int GetPosInDeque(
int idx,
IComparable o
);

Parameters

idx
The deque's index.
o
The object to examine.

Return Value

The position within the specified deque.

See Also

TieredVector Class | Ringlet.Collections Namespace


TieredVector.Grow Method

Grow the tiered vector.

protected virtual void Grow();

Exceptions

Exception Type | Condition
InvalidOperationException | A tiered vector should only be grown when it is full.

See Also

TieredVector Class | Ringlet.Collections Namespace


IndexOf Method

An NDoc Documented Class Library

TieredVector.IndexOf Method

Find the first occurrence of an element in the vector.

Overload List

Find the first occurrence of an element in the vector.

public virtual int IndexOf(IComparable);

Find the first occurrence of an element in the vector.

public virtual int IndexOf(object);

See Also

TieredVector Class | Ringlet.Collections Namespace


TieredVector.IndexOf Method (IComparable)

Find the first occurrence of an element in the vector.

public virtual int IndexOf(
IComparable o
);

Parameters

o
The element to look for.

Return Value

The index of the first occurrence, or -1 if not found.

See Also

TieredVector Class | Ringlet.Collections Namespace | TieredVector.IndexOf Overload List


TieredVector.IndexOf Method (Object)

Find the first occurrence of an element in the vector.

public virtual int IndexOf(
object o
);

Parameters

o
The element to look for.

Return Value

The index of the first occurrence, or -1 if not found.

Implements

IList.IndexOf

See Also

TieredVector Class | Ringlet.Collections Namespace | TieredVector.IndexOf Overload List


TieredVector.Insert Method

Insert an element at a specified position into the tiered vector.

public virtual void Insert(
int pos,
object o
);

Parameters

pos
The position to insert the element at.
o
The element to insert.

Implements

IList.Insert

Remarks

Unless overridden by a derived class, this method will always throw an InvalidOperationException, since the tiered vector does not support direct insertion for fear of unsorting the elements.

Exceptions

Exception Type | Condition
InvalidOperationException | Direct insertion into a tiered vector is not supported.

See Also

TieredVector Class | Ringlet.Collections Namespace


Remove Method

An NDoc Documented Class Library

TieredVector.Remove Method

Remove the first occurrence of the specified object.

Overload List

Remove the first occurrence of the specified object.

public virtual void Remove(IComparable);

Remove the first occurrence of the specified object.

public virtual void Remove(object);

See Also

TieredVector Class | Ringlet.Collections Namespace


TieredVector.Remove Method (IComparable)

Remove the first occurrence of the specified object.

public virtual void Remove(
IComparable o
);

Parameters

o
The object to remove.

See Also

TieredVector Class | Ringlet.Collections Namespace | TieredVector.Remove Overload List


TieredVector.Remove Method (Object)

Remove the first occurrence of the specified object.

public virtual void Remove(
object o
);

Parameters

o
The object to remove.

Implements

IList.Remove

See Also

TieredVector Class | Ringlet.Collections Namespace | TieredVector.Remove Overload List


TieredVector.RemoveAt Method

Remove the element at the specified index.

public virtual void RemoveAt(
int idx
);

Parameters

idx
The index of the element to remove.

Implements

IList.RemoveAt

Exceptions

Exception Type | Condition
ArgumentOutOfRangeException | A negative or too large value was specified for the idx parameter.

See Also

TieredVector Class | Ringlet.Collections Namespace


TieredVector.Shrink Method

Shrink the tiered vector.

protected virtual void Shrink();

Exceptions

Exception Type | Condition
InvalidOperationException | It would make no sense to shrink the vector, since it contains more than 2^(n-3) elements.

See Also

TieredVector Class | Ringlet.Collections Namespace


TieredVector.TieredVectorEnumerator Class

An enumerator for the TieredVector class.

For a list of all members of this type, see TieredVector.TieredVectorEnumerator Members.

System.Object
TieredVector.TieredVectorEnumerator

protected sealed class TieredVector.TieredVectorEnumerator : IEnumerator

Requirements

Namespace: Ringlet.Collections

Assembly: Ringlet.Collections (in Ringlet.Collections.dll)

See Also

TieredVector.TieredVectorEnumerator Members | Ringlet.Collections Namespace


TieredVector.TieredVectorEnumerator Members

TieredVector.TieredVectorEnumerator overview

Public Instance Constructors

TieredVector.TieredVectorEnumerator Constructor Initialize a TieredVectorEnumerator object at the start of a tiered vector.

Public Instance Properties

Current Retrieve the current element.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
MoveNext | Advance the enumerator.
Reset | Reset the enumerator to the beginning of the vector.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

TieredVector.TieredVectorEnumerator Class | Ringlet.Collections Namespace


TieredVector.TieredVectorEnumerator Constructor

Initialize a TieredVectorEnumerator object at the start of a tiered vector.

public TieredVector.TieredVectorEnumerator(
TieredVector vec
);

Parameters

vec
The vector to enumerate.

See Also

TieredVector.TieredVectorEnumerator Class | Ringlet.Collections Namespace


TieredVector.TieredVectorEnumerator Properties

The properties of the TieredVector.TieredVectorEnumerator class are listed below. For a complete list of TieredVector.TieredVectorEnumerator class members, see the TieredVector.TieredVectorEnumerator Members topic.

Public Instance Properties

Current Retrieve the current element.

See Also

TieredVector.TieredVectorEnumerator Class | Ringlet.Collections Namespace


TieredVector.TieredVectorEnumerator.Current Property

Retrieve the current element.

public object Current {get;}

Implements

IEnumerator.Current

See Also

TieredVector.TieredVectorEnumerator Class | Ringlet.Collections Namespace


TieredVector.TieredVectorEnumerator Methods

The methods of the TieredVector.TieredVectorEnumerator class are listed below. For a complete list of TieredVector.TieredVectorEnumerator class members, see the TieredVector.TieredVectorEnumerator Members topic.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
MoveNext | Advance the enumerator.
Reset | Reset the enumerator to the beginning of the vector.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

TieredVector.TieredVectorEnumerator Class | Ringlet.Collections Namespace


TieredVector.TieredVectorEnumerator.MoveNext Method

Advance the enumerator.

public bool MoveNext();

Return Value

True if there are more elements.

Implements

IEnumerator.MoveNext

See Also

TieredVector.TieredVectorEnumerator Class | Ringlet.Collections Namespace


TieredVector.TieredVectorEnumerator.Reset Method

Reset the enumerator to the beginning of the vector.

public void Reset();

Implements

IEnumerator.Reset

See Also

TieredVector.TieredVectorEnumerator Class | Ringlet.Collections Namespace