SparseMatrix Class
This API is deprecated and will be removed in a future release.
SparseMatrix is an abandoned prototype. Use SharedMatrix instead.
Signature
export declare class SparseMatrix extends SharedSegmentSequence<MatrixSegment>
Extends: SharedSegmentSequence<MatrixSegment
Constructors
| Constructor | Description | 
|---|---|
| (constructor)(document, id, attributes) | Constructs a new instance of the SparseMatrix class | 
  
Static Methods
| Method | Return Type | Description | 
|---|---|---|
| create(runtime, id) | SparseMatrix | Create a new sparse matrix | 
| getFactory() | IChannelFactory | Get a factory for SharedMap to register with the data store. | 
Properties
| Property | Type | Description | 
|---|---|---|
| id | string | |
| numRows | number | 
Methods
| Method | Return Type | Description | 
|---|---|---|
| annotatePosition(row, col, props) | void | |
| getItem(row, col) | Jsonable<string | number | boolean | IFluidHandle> | |
| getPositionProperties(row, col) | PropertySet | |
| getTag(row, col) | any | |
| insertCols(col, numCols) | void | |
| insertRows(row, numRows) | void | |
| removeCols(col, numCols) | void | |
| removeRows(row, numRows) | void | |
| setItems(row, col, values, props) | void | |
| setTag(row, col, tag) | void | 
Constructor Details
(constructor)
Constructs a new instance of the SparseMatrix class
Signature
constructor(document: IFluidDataStoreRuntime, id: string, attributes: IChannelAttributes);
Parameters
| Parameter | Type | Description | 
|---|---|---|
| document | IFluidDataStoreRuntime | |
| id | string | |
| attributes | IChannelAttributes | 
Property Details
id
Signature
id: string;
Type: string
numRows
Signature
get numRows(): number;
Type: number
Method Details
annotatePosition
Signature
annotatePosition(row: number, col: number, props: PropertySet): void;
Parameters
| Parameter | Type | Description | 
|---|---|---|
| row | number | |
| col | number | |
| props | PropertySet | 
create
Create a new sparse matrix
Signature
static create(runtime: IFluidDataStoreRuntime, id?: string): SparseMatrix;
Parameters
| Parameter | Modifiers | Type | Description | 
|---|---|---|---|
| runtime | IFluidDataStoreRuntime | data store runtime the new sparse matrix belongs to | |
| id | optional | string | optional name of the sparse matrix | 
Returns
newly create sparse matrix (but not attached yet)
Return type: SparseMatrix
getFactory
Get a factory for SharedMap to register with the data store.
Signature
static getFactory(): IChannelFactory;
Returns
a factory that creates and load SharedMap
Return type: IChannelFactory
getItem
Signature
getItem(row: number, col: number): Jsonable<string | number | boolean | IFluidHandle>;
Parameters
| Parameter | Type | Description | 
|---|---|---|
| row | number | |
| col | number | 
Returns
Return type: Jsonable<string | number | boolean | IFluidHandle>
getPositionProperties
Signature
getPositionProperties(row: number, col: number): PropertySet;
Parameters
| Parameter | Type | Description | 
|---|---|---|
| row | number | |
| col | number | 
Returns
Return type: PropertySet
getTag
Signature
getTag(row: number, col: number): any;
Parameters
| Parameter | Type | Description | 
|---|---|---|
| row | number | |
| col | number | 
Returns
Return type: any
insertCols
Signature
insertCols(col: number, numCols: number): void;
Parameters
| Parameter | Type | Description | 
|---|---|---|
| col | number | |
| numCols | number | 
insertRows
Signature
insertRows(row: number, numRows: number): void;
Parameters
| Parameter | Type | Description | 
|---|---|---|
| row | number | |
| numRows | number | 
removeCols
Signature
removeCols(col: number, numCols: number): void;
Parameters
| Parameter | Type | Description | 
|---|---|---|
| col | number | |
| numCols | number | 
removeRows
Signature
removeRows(row: number, numRows: number): void;
Parameters
| Parameter | Type | Description | 
|---|---|---|
| row | number | |
| numRows | number | 
setItems
Signature
setItems(row: number, col: number, values: SparseMatrixItem[], props?: PropertySet): void;
Parameters
| Parameter | Modifiers | Type | Description | 
|---|---|---|---|
| row | number | ||
| col | number | ||
| values | SparseMatrixItem[] | ||
| props | optional | PropertySet | 
setTag
Signature
setTag(row: number, col: number, tag: any): void;
Parameters
| Parameter | Type | Description | 
|---|---|---|
| row | number | |
| col | number | |
| tag | any |