Table of Contents

Class NoxRowMap<T>

Namespace
Nox.Grid
Assembly
Nox.Grid.dll

Per-row data store (only rows with data are kept; entries move when rows are inserted, deleted, or sorted).

public sealed class NoxRowMap<T>

Type Parameters

T
Inheritance
NoxRowMap<T>
Inherited Members

Remarks

Kept as a row list like NoxCellMap<T>, so inserting or deleting rows only moves row slots.

Properties

Count

Number of rows that have an entry.

public int Count { get; }

Property Value

int

Items

Every entry as (row, value) pairs.

public IEnumerable<KeyValuePair<int, T>> Items { get; }

Property Value

IEnumerable<KeyValuePair<int, T>>

Methods

Clear()

Removes every entry.

public void Clear()

Get(int)

Entry for the row, or the default value if none.

public T Get(int row)

Parameters

row int

Returns

T

InsertRows(int, int)

Moves entries down when rows are inserted at index.

public void InsertRows(int index, int count)

Parameters

index int
count int

PermuteRows(int[])

Reorders entries after rows are reordered (newOrder[i] is the old row now at i; -1 for a new row).

public void PermuteRows(int[] newOrder)

Parameters

newOrder int[]

Remove(int)

Removes the entry for a row. Returns False if there was none.

public bool Remove(int row)

Parameters

row int

Returns

bool

RemoveRows(int, int)

Removes entries of the removed rows and moves the rest up.

public void RemoveRows(int index, int count)

Parameters

index int
count int

Set(int, T)

Sets the entry for a row.

public void Set(int row, T value)

Parameters

row int
value T

TruncateRows(int)

Removes entries for rows at or after rowCount.

public void TruncateRows(int rowCount)

Parameters

rowCount int

TryGet(int, out T)

Gets the entry for a row. Returns False if the row has none.

public bool TryGet(int row, out T value)

Parameters

row int
value T

Returns

bool