@univerjs/core v0.5.0-beta.1 • Docs
Class: ObjectMatrix<T>
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>
Beta
Parameters
Parameter | Type |
---|---|
matrix | IObjectMatrixPrimitiveType <T > |
Returns
ObjectMatrix
<T
>
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/object-matrix.ts:224
Methods
clone()
clone(): IObjectMatrixPrimitiveType<T>
Beta
Returns
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/object-matrix.ts:547
deleteValue()
deleteValue(row, column): void
Beta
!! Please +1 ‘!’, who fell into this pit.
Parameters
Parameter | Type |
---|---|
row | number |
column | number |
Returns
void
Deprecated
use realDelete
or splice
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/object-matrix.ts:357
forEach()
forEach(callback): ObjectMatrix<T>
Beta
Parameters
Parameter | Type |
---|---|
callback | (row , objectArray ) => Nullable <boolean > |
Returns
ObjectMatrix
<T
>
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/object-matrix.ts:238
forRow()
forRow(callback): ObjectMatrix<T>
Beta
Parameters
Parameter | Type |
---|---|
callback | (row , cols ) => Nullable <boolean > |
Returns
ObjectMatrix
<T
>
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/object-matrix.ts:253
forValue()
forValue(callback): ObjectMatrix<T>
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
>
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/object-matrix.ts:275
getArrayData()
getArrayData(): IObjectMatrixPrimitiveType<T>
Beta
Returns
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/object-matrix.ts:560
getData()
getData(): IObjectMatrixPrimitiveType<T>
Beta
Returns
Deprecated
Use clone as a substitute.
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/object-matrix.ts:555
getDataRange()
getDataRange(): IRange
Beta
Returns
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/object-matrix.ts:616
getDiscreteRanges()
getDiscreteRanges(): IRange[]
Beta
Returns
IRange
[]
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/object-matrix.ts:664
getFragment()
getFragment(
startRow,
endRow,
startColumn,
endColumn): ObjectMatrix<T>
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
>
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/object-matrix.ts:430
getLength()
getLength(): number
Beta
Returns
number
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/object-matrix.ts:476
getMatrix()
getMatrix(): IObjectMatrixPrimitiveType<T>
Beta
Returns
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/object-matrix.ts:234
getRange()
getRange(): IRange
Beta
Returns
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/object-matrix.ts:480
getRow()
getRow(rowIndex): Nullable<IObjectArrayPrimitiveType<T>>
Beta
Parameters
Parameter | Type |
---|---|
rowIndex | number |
Returns
Nullable
<IObjectArrayPrimitiveType
<T
>>
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/object-matrix.ts:307
getRowOrCreate()
getRowOrCreate(rowIndex): IObjectArrayPrimitiveType<T>
Beta
Parameters
Parameter | Type |
---|---|
rowIndex | number |
Returns
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/object-matrix.ts:311
getSizeOf()
getSizeOf(): number
Beta
Returns
number
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/object-matrix.ts:471
getSlice()
getSlice(
startRow,
endRow,
startColumn,
endColumn): ObjectMatrix<T>
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
>
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/object-matrix.ts:458
getStartEndScope()
getStartEndScope(): IRange
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
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/object-matrix.ts:593
getValue()
getValue(row, column): Nullable<T>
Beta
Parameters
Parameter | Type |
---|---|
row | number |
column | number |
Returns
Nullable
<T
>
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/object-matrix.ts:343
hasValue()
hasValue(): boolean
Beta
Returns
boolean
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/object-matrix.ts:325
insertColumns()
insertColumns(start, count): void
Beta
Parameters
Parameter | Type |
---|---|
start | number |
count | number |
Returns
void
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/object-matrix.ts:398
insertRows()
insertRows(start, count): void
Beta
Parameters
Parameter | Type |
---|---|
start | number |
count | number |
Returns
void
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/object-matrix.ts:391
merge()
merge(newObject): void
Beta
Parameters
Parameter | Type |
---|---|
newObject | ObjectMatrix <T > |
Returns
void
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/object-matrix.ts:704
moveColumns()
moveColumns(
start,
count,
target): void
Beta
Parameters
Parameter | Type |
---|---|
start | number |
count | number |
target | number |
Returns
void
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/object-matrix.ts:384
moveRows()
moveRows(
start,
count,
target): void
Beta
Parameters
Parameter | Type |
---|---|
start | number |
count | number |
target | number |
Returns
void
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/object-matrix.ts:380
realDeleteValue()
realDeleteValue(row, column): void
Beta
Parameters
Parameter | Type |
---|---|
row | number |
column | number |
Returns
void
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/object-matrix.ts:361
removeColumns()
removeColumns(start, count): void
Beta
Parameters
Parameter | Type |
---|---|
start | number |
count | number |
Returns
void
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/object-matrix.ts:412
removeRows()
removeRows(start, count): void
Beta
Parameters
Parameter | Type |
---|---|
start | number |
count | number |
Returns
void
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/object-matrix.ts:408
reset()
reset(): void
Beta
Returns
void
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/object-matrix.ts:321
setRow()
setRow(rowNumber, row): void
Beta
Parameters
Parameter | Type |
---|---|
rowNumber | number |
row | IObjectArrayPrimitiveType <T > |
Returns
void
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/object-matrix.ts:376
setValue()
setValue(
row,
column,
value): void
Beta
Parameters
Parameter | Type |
---|---|
row | number |
column | number |
value | T |
Returns
void
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/object-matrix.ts:347
swapRow()
swapRow(src, target): void
Beta
Parameters
Parameter | Type |
---|---|
src | number |
target | number |
Returns
void
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/object-matrix.ts:298
toArray()
toArray(): T[][]
Beta
Returns
T
[][]
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/object-matrix.ts:510
toFullArray()
toFullArray(): T[][]
Beta
Returns
T
[][]
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/object-matrix.ts:524
toJSON()
toJSON(): IObjectMatrixPrimitiveType<T>
Beta
Returns
Deprecated
Use getMatrix as a substitute.
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/object-matrix.ts:543
toNativeArray()
toNativeArray(): T[]
Beta
Returns
T
[]
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/object-matrix.ts:502
MakeObjectMatrixSize()
static MakeObjectMatrixSize<T>(size): ObjectMatrix<T>
Beta
Type Parameters
Type Parameter |
---|
T |
Parameters
Parameter | Type |
---|---|
size | number |
Returns
ObjectMatrix
<T
>
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/object-matrix.ts:228