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
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
rowint
Returns
- T
InsertRows(int, int)
Moves entries down when rows are inserted at index.
public void InsertRows(int index, int count)
Parameters
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
newOrderint[]
Remove(int)
Removes the entry for a row. Returns False if there was none.
public bool Remove(int row)
Parameters
rowint
Returns
RemoveRows(int, int)
Removes entries of the removed rows and moves the rest up.
public void RemoveRows(int index, int count)
Parameters
Set(int, T)
Sets the entry for a row.
public void Set(int row, T value)
Parameters
rowintvalueT
TruncateRows(int)
Removes entries for rows at or after rowCount.
public void TruncateRows(int rowCount)
Parameters
rowCountint
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
rowintvalueT