69d96756f0800088f59b64b27d052faf525d35ccfa846d5e822e8d9a5443de72fca6a43c5d833eaa37bacfa4173fa28ce39cd7fb8f83bb4e581b8cdc1b7072 1011 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. /**
  2. * @fileoverview Define the abstract class about cursors which manipulate another cursor.
  3. * @author Toru Nagashima
  4. */
  5. "use strict";
  6. //------------------------------------------------------------------------------
  7. // Requirements
  8. //------------------------------------------------------------------------------
  9. const Cursor = require("./cursor");
  10. //------------------------------------------------------------------------------
  11. // Exports
  12. //------------------------------------------------------------------------------
  13. /**
  14. * The abstract class about cursors which manipulate another cursor.
  15. */
  16. module.exports = class DecorativeCursor extends Cursor {
  17. /**
  18. * Initializes this cursor.
  19. * @param {Cursor} cursor The cursor to be decorated.
  20. */
  21. constructor(cursor) {
  22. super();
  23. this.cursor = cursor;
  24. }
  25. /** @inheritdoc */
  26. moveNext() {
  27. const retv = this.cursor.moveNext();
  28. this.current = this.cursor.current;
  29. return retv;
  30. }
  31. };