Table of Contents

Class ParallelArrays<TKey, TValue>

Namespace
AlgorithmsSW.List
Assembly
AlgorithmsSW.dll

Represents a list of key-value pairs using two parallel arrays.

public class ParallelArrays<TKey, TValue>

Type Parameters

TKey

The type of keys in the list.

TValue

The type of values in the list.

Inheritance
ParallelArrays<TKey, TValue>
Inherited Members
Extension Methods

Constructors

ParallelArrays(int)

Initializes a new instance of the ParallelArrays<TKey, TValue> class.

public ParallelArrays(int initialCapacity)

Parameters

initialCapacity int

The initial number of key-value pairs this instance can support.

Properties

Capacity

Gets the capacity of this instance.

public int Capacity { get; }

Property Value

int

Count

Gets the number of key-value pairs this instance contains.

public int Count { get; }

Property Value

int

IsEmpty

Gets a value indicating whether this instance is empty.

public bool IsEmpty { get; }

Property Value

bool

IsFull

Gets a value indicating whether this instance is full.

public bool IsFull { get; }

Property Value

bool

Keys

Gets the keys of this instance.

public IReadonlyRandomAccessList<TKey> Keys { get; }

Property Value

IReadonlyRandomAccessList<TKey>

Values

Gets the values of this instance.

public IReadonlyRandomAccessList<TValue> Values { get; }

Property Value

IReadonlyRandomAccessList<TValue>

Methods

Add(TKey, TValue)

Adds a key-value pair to this instance.

public void Add(TKey key, TValue value)

Parameters

key TKey

The key to add.

value TValue

The value associated with the key to add.

Clear()

Removes all key-value pairs from this instance.

public void Clear()

Copy()

Creates a copy of this instance.

public ParallelArrays<TKey, TValue> Copy()

Returns

ParallelArrays<TKey, TValue>

DeleteAt(int)

Deletes the key-value pair at the specified index.

public void DeleteAt(int index)

Parameters

index int

Get(int, out TKey, out TValue)

Gets the key-value pair at the specified index.

public void Get(int index, out TKey key, out TValue value)

Parameters

index int

The index of the key-value pair to get.

key TKey

The key at the specified index.

value TValue

The value at the specified index.

GetKey(int)

Gets the key at the specified index.

public TKey GetKey(int index)

Parameters

index int

The index of the key to get.

Returns

TKey

GetValue(int)

Gets the value at the specified index.

public TValue GetValue(int index)

Parameters

index int

The index of the key to get.

Returns

TValue

InsertAt(int, TKey, TValue)

Inserts a key-value pair at the specified index.

public void InsertAt(int index, TKey key, TValue value)

Parameters

index int

The index at which to insert the key-value pair.

key TKey

The key to insert.

value TValue

The value associated with the key to insert.

RemoveLast(int)

Removes the last n key-value pairs from this instance.

public void RemoveLast(int n)

Parameters

n int

The number of key-value pairs to remove.

RemoveLast(out TKey, out TValue)

Removes the last key-value pair from this instance.

public void RemoveLast(out TKey key, out TValue value)

Parameters

key TKey

The remove key.

value TValue

The value associated with the removed key.

Set(int, TKey, TValue)

Sets the key-value pair at the specified index.

public void Set(int index, TKey key, TValue value)

Parameters

index int

The index of the key-value pair to set.

key TKey

The key to set.

value TValue

The value associated with the key to set.

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.