Class: ObjectMatrix<T>
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/object-matrix.ts:221
Beta
A two-dimensional array represented by a two-level deep object and provides an array-like API
Type Parameters
Type Parameter |
---|
T |
Constructors
new ObjectMatrix()
new ObjectMatrix<T>(matrix): ObjectMatrix<T>
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/object-matrix.ts:224
Beta
Parameters
Parameter | Type |
---|---|
matrix | IObjectMatrixPrimitiveType <T > |
Returns
ObjectMatrix
<T
>
Methods
clone()
clone(): IObjectMatrixPrimitiveType<T>
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/object-matrix.ts:547
Beta
Returns
deleteValue()
deleteValue(row, column): void
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/object-matrix.ts:357
Beta
!! Please +1 ‘!’, who fell into this pit.
Parameters
Parameter | Type |
---|---|
row | number |
column | number |
Returns
void
Deprecated
use realDelete
or splice
forEach()
forEach(callback): ObjectMatrix<T>
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/object-matrix.ts:238
Beta
Parameters
Parameter | Type |
---|---|
callback | (row , objectArray ) => Nullable <boolean > |
Returns
ObjectMatrix
<T
>
forRow()
forRow(callback): ObjectMatrix<T>
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/object-matrix.ts:253
Beta
Parameters
Parameter | Type |
---|---|
callback | (row , cols ) => Nullable <boolean > |
Returns
ObjectMatrix
<T
>
forValue()
forValue(callback): ObjectMatrix<T>
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/object-matrix.ts:275
Beta
Iterate the object matrix with row priority, which means it scan the whole range row by row.
Parameters
Parameter | Type |
---|---|
callback | (row , col , value ) => Nullable <boolean > |
Returns
ObjectMatrix
<T
>
getArrayData()
getArrayData(): IObjectMatrixPrimitiveType<T>
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/object-matrix.ts:560
Beta
Returns
getData()
getData(): IObjectMatrixPrimitiveType<T>
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/object-matrix.ts:555
Beta
Returns
Deprecated
Use clone as a substitute.
getDataRange()
getDataRange(): IRange
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/object-matrix.ts:616
Beta
Returns
getDiscreteRanges()
getDiscreteRanges(): IRange[]
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/object-matrix.ts:664
Beta
Returns
IRange
[]
getFragment()
getFragment(
startRow,
endRow,
startColumn,
endColumn): ObjectMatrix<T>
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/object-matrix.ts:430
Beta
Return a fragment of the original data matrix. Note that the returned matrix’s row matrix would start from
0 not startRow
. Neither does its column matrix. If you want to get the original matrix, use getSlice
.
Parameters
Parameter | Type |
---|---|
startRow | number |
endRow | number |
startColumn | number |
endColumn | number |
Returns
ObjectMatrix
<T
>
getLength()
getLength(): number
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/object-matrix.ts:476
Beta
Returns
number
getMatrix()
getMatrix(): IObjectMatrixPrimitiveType<T>
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/object-matrix.ts:234
Beta
Returns
getRange()
getRange(): IRange
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/object-matrix.ts:480
Beta
Returns
getRow()
getRow(rowIndex): Nullable<IObjectArrayPrimitiveType<T>>
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/object-matrix.ts:307
Beta
Parameters
Parameter | Type |
---|---|
rowIndex | number |
Returns
Nullable
<IObjectArrayPrimitiveType
<T
>>
getRowOrCreate()
getRowOrCreate(rowIndex): IObjectArrayPrimitiveType<T>
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/object-matrix.ts:311
Beta
Parameters
Parameter | Type |
---|---|
rowIndex | number |
Returns
getSizeOf()
getSizeOf(): number
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/object-matrix.ts:471
Beta
Returns
number
getSlice()
getSlice(
startRow,
endRow,
startColumn,
endColumn): ObjectMatrix<T>
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/object-matrix.ts:458
Beta
Return a slice of the original data matrix. Note that the returned matrix’s row matrix would start from
startRow
not 0, and the same does its column index. You may be looking for getFragment
if you want
both of the indexes start from 0.
Parameters
Parameter | Type |
---|---|
startRow | number |
endRow | number |
startColumn | number |
endColumn | number |
Returns
ObjectMatrix
<T
>
getStartEndScope()
getStartEndScope(): IRange
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/object-matrix.ts:593
Beta
the function can only be used in all the row and column are positive integer
Returns
the start and end scope of the matrix
Description
the positive integer in V8 Object is stored in a fast memory space and it is sorted when we get the keys
getValue()
getValue(row, column): Nullable<T>
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/object-matrix.ts:343
Beta
Parameters
Parameter | Type |
---|---|
row | number |
column | number |
Returns
Nullable
<T
>
hasValue()
hasValue(): boolean
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/object-matrix.ts:325
Beta
Returns
boolean
insertColumns()
insertColumns(start, count): void
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/object-matrix.ts:398
Beta
Parameters
Parameter | Type |
---|---|
start | number |
count | number |
Returns
void
insertRows()
insertRows(start, count): void
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/object-matrix.ts:391
Beta
Parameters
Parameter | Type |
---|---|
start | number |
count | number |
Returns
void
merge()
merge(newObject): void
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/object-matrix.ts:704
Beta
Parameters
Parameter | Type |
---|---|
newObject | ObjectMatrix <T > |
Returns
void
moveColumns()
moveColumns(
start,
count,
target): void
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/object-matrix.ts:384
Beta
Parameters
Parameter | Type |
---|---|
start | number |
count | number |
target | number |
Returns
void
moveRows()
moveRows(
start,
count,
target): void
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/object-matrix.ts:380
Beta
Parameters
Parameter | Type |
---|---|
start | number |
count | number |
target | number |
Returns
void
realDeleteValue()
realDeleteValue(row, column): void
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/object-matrix.ts:361
Beta
Parameters
Parameter | Type |
---|---|
row | number |
column | number |
Returns
void
removeColumns()
removeColumns(start, count): void
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/object-matrix.ts:412
Beta
Parameters
Parameter | Type |
---|---|
start | number |
count | number |
Returns
void
removeRows()
removeRows(start, count): void
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/object-matrix.ts:408
Beta
Parameters
Parameter | Type |
---|---|
start | number |
count | number |
Returns
void
reset()
reset(): void
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/object-matrix.ts:321
Beta
Returns
void
setRow()
setRow(rowNumber, row): void
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/object-matrix.ts:376
Beta
Parameters
Parameter | Type |
---|---|
rowNumber | number |
row | IObjectArrayPrimitiveType <T > |
Returns
void
setValue()
setValue(
row,
column,
value): void
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/object-matrix.ts:347
Beta
Parameters
Parameter | Type |
---|---|
row | number |
column | number |
value | T |
Returns
void
swapRow()
swapRow(src, target): void
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/object-matrix.ts:298
Beta
Parameters
Parameter | Type |
---|---|
src | number |
target | number |
Returns
void
toArray()
toArray(): T[][]
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/object-matrix.ts:510
Beta
Returns
T
[][]
toFullArray()
toFullArray(): T[][]
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/object-matrix.ts:524
Beta
Returns
T
[][]
toJSON()
toJSON(): IObjectMatrixPrimitiveType<T>
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/object-matrix.ts:543
Beta
Returns
Deprecated
Use getMatrix as a substitute.
toNativeArray()
toNativeArray(): T[]
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/object-matrix.ts:502
Beta
Returns
T
[]
MakeObjectMatrixSize()
static MakeObjectMatrixSize<T>(size): ObjectMatrix<T>
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/object-matrix.ts:228
Beta
Type Parameters
Type Parameter |
---|
T |
Parameters
Parameter | Type |
---|---|
size | number |
Returns
ObjectMatrix
<T
>