1234567891011121314151617181920212223242526272829303132333435 |
- import { IStoreValue } from "./istore_value";
- import { Type } from "../../typeSystem/type";
- export class ArrayStoreValue implements IStoreValue {
- public type: Type;
- public id: String | null;
- public isConst: boolean;
- public lines: number;
- public columns: number;
- public values: any[];
- constructor(type: Type, values: any[], id: String | null, lines: number, columns: number, isConst = false) {
- this.type = type;
- this.id = id;
- this.isConst = isConst
- this.values = values;
- this.lines = lines;
- this.columns = columns;
- }
- get (): any[] {
- return this.values;
- }
- getAt (line: number, column = 0): any {
- const pos = column * this.lines + line;
- return this.values[pos];
- }
- setAt (value: any, line:number, column = 0): any {
- const pos = column * this.lines + line;
- this.values[pos] = value;
- }
- }
|