AVLMapSubCollectionIterator.js 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.cast_de_nrw_schule_svws_core_adt_map_AVLMapSubCollectionIterator = exports.AVLMapSubCollectionIterator = void 0;
  4. const JavaObject_1 = require("../../../java/lang/JavaObject");
  5. const IllegalStateException_1 = require("../../../java/lang/IllegalStateException");
  6. const NoSuchElementException_1 = require("../../../java/util/NoSuchElementException");
  7. class AVLMapSubCollectionIterator extends JavaObject_1.JavaObject {
  8. _sub;
  9. _current = null;
  10. _next = null;
  11. /**
  12. * Erstellt einen neuen VALUES-Iterator, welcher auf der {@link AVLMapSubMap} operiert.
  13. *
  14. * @param sub Die {@link AVLMapSubMap} auf der dieser Iterator operiert.
  15. */
  16. constructor(sub) {
  17. super();
  18. this._sub = sub;
  19. this._current = null;
  20. this._next = this._sub.firstEntryAsNode();
  21. }
  22. next() {
  23. if (this._next === null)
  24. throw new NoSuchElementException_1.NoSuchElementException();
  25. this._current = this._next;
  26. this._next = this._sub.nextEntryOrNull(this._current);
  27. return this._current._val;
  28. }
  29. hasNext() {
  30. return this._next !== null;
  31. }
  32. remove() {
  33. if (this._current === null)
  34. throw new IllegalStateException_1.IllegalStateException();
  35. this._sub.remove(this._current.getKey());
  36. this._current = null;
  37. }
  38. isTranspiledInstanceOf(name) {
  39. return ['java.util.Iterator', 'de.nrw.schule.svws.core.adt.map.AVLMapSubCollectionIterator'].includes(name);
  40. }
  41. }
  42. exports.AVLMapSubCollectionIterator = AVLMapSubCollectionIterator;
  43. function cast_de_nrw_schule_svws_core_adt_map_AVLMapSubCollectionIterator(obj) {
  44. return obj;
  45. }
  46. exports.cast_de_nrw_schule_svws_core_adt_map_AVLMapSubCollectionIterator = cast_de_nrw_schule_svws_core_adt_map_AVLMapSubCollectionIterator;
  47. //# sourceMappingURL=AVLMapSubCollectionIterator.js.map