All files / src StringArrayStorage.ts

90% Statements 9/10
100% Branches 0/0
100% Functions 2/2
90% Lines 9/10
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 541x   1x       529x           5998x                             32365x             7570x             526x             526x 5998x        
import { Utils } from './Utils';
 
export class StringArray {
    /**
     * @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()
    }
}