1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- import { Utils } from './Utils';
- export class StringsArray {
- /**
- * @type {string[]}
- */
- private array: string[] = [];
- /**
- * @param value
- */
- public addToArray (value: string): void {
- this.array.push(value);
- }
- /**
- * @returns {string[]}
- */
- public getArray (): string[] {
- return this.array;
- }
- /**
- * @param value
- * @returns {number}
- */
- public getIndexOf(value: string): number {
- return this.array.indexOf(value);
- }
- /**
- * @returns {number}
- */
- public getLength (): number {
- return this.array.length;
- }
- /**
- * @param rotationValue
- */
- public rotateArray (rotationValue: number): void {
- this.array = Utils.arrayRotate(this.array, rotationValue);
- }
- /**
- * @returns {string}
- */
- public toString (): string {
- return this.array.map((value: string) => {
- return `'${value}'`;
- }).toString()
- }
- }
|