MatrixMap<T> class

A data structure that organizes items of T in a 2d map with int keys.

This structure prioritize rows over columns.

Implemented types

Constructors

MatrixMap()

Properties

hashCode int
The hash code for this object.
no setterinherited
isEmpty bool
MatrixMapReadOnly.isEmpty
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

clear() → void
Clear all items in the collection
clearRow(int rowIndex) → void
Remove an entire row from the collection
computeSize() IntVector2
MatrixMapReadOnly.computeSize
override
elementAt({required int colIndex, required int rowIndex}) → T?
MatrixMapReadOnly.elementAt
override
forEach(MatrixMapIterator<T> iterate) → void
MatrixMapReadOnly.forEach
override
forEachExistingItemOn({required Iterable<int> colIndices, required Iterable<int> rowIndices, required MatrixMapIterator<T> iterate}) → void
Iterate in all existing items in a given list of columns and rows.
override
forEachInRange({required Iterable<int> colIndices, required Iterable<int> rowIndices}) Iterable<MatrixMapIterableResult<T?>>
See MatrixMapReadOnly.forEachInRange.
override
forEachInRow(int rowIndex, MatrixMapIterator<T> iterate) → void
MatrixMapReadOnly.forEachInRow
override
forEachPositionOn({required Iterable<int> colIndices, required Iterable<int> rowIndices, required MaybeMatrixMapIterator<T> iterate}) → void
Iterate in all positions, with existing items or not in a given list of columns and rows.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
put(T item, {required int colIndex, required int rowIndex}) → void
Add item to a column/row position
remove({required int colIndex, required int rowIndex}) → T?
Remove items at column colIndex and row rowIndex Returns the removed item if found or null otherwise
removeWhere(bool predicate(int colIndex, int rowIndex, T value)) → void
removeWhereInRow(int rowIndex, bool predicate(int colIndex, T value)) → void
Remove items in row rowIndex that respect to a predicate
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited
operator [](IntVector2 coordinate) → T?
Get element at a position corresponding to coordinate.
override
operator []=(IntVector2 coordinate, T item) → void
Insert an item into the matrix in the give coordinate.