UnicodeArray.ts 936 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. import { Utils } from "./Utils";
  2. export class UnicodeArray {
  3. /**
  4. * @type {string[]}
  5. */
  6. private array: string[] = [];
  7. /**
  8. * @param value
  9. */
  10. public addToArray (value: string): void {
  11. this.array.push(value);
  12. }
  13. /**
  14. * @returns {string[]}
  15. */
  16. public getArray (): string[] {
  17. return this.array;
  18. }
  19. /**
  20. * @param value
  21. * @returns {number}
  22. */
  23. public getIndexOf(value: string): number {
  24. return this.array.indexOf(value);
  25. }
  26. /**
  27. * @returns {number}
  28. */
  29. public getLength (): number {
  30. return this.array.length;
  31. }
  32. /**
  33. * @param rotationValue
  34. */
  35. public rotateArray (rotationValue: number): void {
  36. this.array = Utils.arrayRotate(this.array, rotationValue);
  37. }
  38. /**
  39. * @returns {string}
  40. */
  41. public toString (): string {
  42. return this.array.toString();
  43. }
  44. }