You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
456 B
21 lines
456 B
|
4 months ago
|
import { checkColumnIndex } from '../util';
|
||
|
|
|
||
|
|
import BaseView from './base';
|
||
|
|
|
||
|
|
export default class MatrixColumnView extends BaseView {
|
||
|
|
constructor(matrix, column) {
|
||
|
|
checkColumnIndex(matrix, column);
|
||
|
|
super(matrix, matrix.rows, 1);
|
||
|
|
this.column = column;
|
||
|
|
}
|
||
|
|
|
||
|
|
set(rowIndex, columnIndex, value) {
|
||
|
|
this.matrix.set(rowIndex, this.column, value);
|
||
|
|
return this;
|
||
|
|
}
|
||
|
|
|
||
|
|
get(rowIndex) {
|
||
|
|
return this.matrix.get(rowIndex, this.column);
|
||
|
|
}
|
||
|
|
}
|