DualArray<T1, T2>

public class DualArray<T1, T2>
Maintains and synchronizes two arrays. Note: this is probably useless now that Tuples are part of the lang.spec.
T1
T2

Constructors

DualArray

#
Create a new, empty multi-array.
public DualArray()

DualArray

#
Create a new multi-array from collections.
public DualArray(
aItems,
Collection of T1 items.
bItems
Collection of T2 items.
)

DualArray

#
Create a new multi-array with a specified capacity.
public DualArray(
capacity
)

DualArray

#
Create a new, singular pair dual array.
public DualArray(
T1
a,
T2
b
)

Properties

A

#
Get access to the internal T1 array.
public Accessor<T1> A { get; }

AItems

#
Enumerate over all T1 items.
public IEnumerable<T1> AItems { get; }

B

#
Get access to the internal T2 array.
public Accessor<T2> B { get; }

BItems

#
Enumerate over all T2 items.
public IEnumerable<T2> BItems { get; }

Capacity

#
Gets the capacity for each array.
public int Capacity { get; }

Count

#
Gets the number of items stored in each array.
public int Count { get; }

Methods

Add

#
Add a pair to this multi array.
public void Add(
T1
a,
A value.
T2
b
B value.
)

Clear

#
Clear the array.
public void Clear()

ContainsA

#
Gets whether a value equal to item is already part of the T1 array.
public bool ContainsA(
T1
item
Item to check.
)
True if item is part of T1 array.

ContainsB

#
Gets whether a value equal to item is already part of the T2 array.
public bool ContainsB(
T2
item
Item to check.
)
True if item is part of T2 array.

EnsureCapacity

#
Ensure the capacity of this multi-array is at least the given amount.
public void EnsureCapacity(
capacity
Required capacity.
)

FindA

#
Find the first occurence of a T1 item.
public int FindA(
T1
item,
Item to find.
startIndex
First index to take into account.
)
First index of matching item or -1.

FindA

#
Find the first occurence of a T1 item.
public int FindA(
T1
item
Item to find.
)
First index of matching item or -1.

FindB

#
Find the first occurence of a T2 item.
public int FindB(
T2
item,
Item to find.
startIndex
First index to take into account.
)
First index of matching item or -1.

FindB

#
Find the first occurence of a T2 item.
public int FindB(
T2
item
Item to find.
)
First index of matching item or -1.

Insert

#
Insert a pair into this multi array.
public void Insert(
index,
T1
a,
T2
b
)

Remove

#
Remove the values at the given index.
public void Remove(
index
Index to remove.
)

Replace

#
Replace the values at the given index.
public void Replace(
index,
Index of pair to replace.
T1
newA,
New A value.
T2
newB
New B value.
)

ToAArray

#
Copy the internal T1 array into a new array.
public T1[] ToAArray()
T1 items.

ToBArray

#
Copy the internal T2 array into a new array.
public T2[] ToBArray()
T2 items.

TrimExcess

#
Release unused memory.
public void TrimExcess()