AVLMapSubEntrySetIterator.js 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.cast_de_nrw_schule_svws_core_adt_map_AVLMapSubEntrySetIterator = exports.AVLMapSubEntrySetIterator = 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 AVLMapSubEntrySetIterator extends JavaObject_1.JavaObject {
  8. _sub;
  9. _current = null;
  10. _next = null;
  11. /**
  12. * Erstellt einen neuen ENTRY-Iterator für die angegebene {@link AVLMapSubMap} im gültigen
  13. * {@link AVLMapIntervall}.
  14. *
  15. * @param sub Die {@link AVLMapSubMap} auf der operiert wird.
  16. */
  17. constructor(sub) {
  18. super();
  19. this._sub = sub;
  20. this._current = null;
  21. this._next = this._sub.firstEntry();
  22. }
  23. next() {
  24. if (this._next === null)
  25. throw new NoSuchElementException_1.NoSuchElementException();
  26. this._current = this._next;
  27. this._next = this._sub.higherEntry(this._next.getKey());
  28. return this._current;
  29. }
  30. hasNext() {
  31. return this._next !== null;
  32. }
  33. remove() {
  34. if (this._current === null)
  35. throw new IllegalStateException_1.IllegalStateException();
  36. this._sub.remove(this._current.getKey());
  37. this._current = null;
  38. }
  39. isTranspiledInstanceOf(name) {
  40. return ['java.util.Iterator', 'de.nrw.schule.svws.core.adt.map.AVLMapSubEntrySetIterator'].includes(name);
  41. }
  42. }
  43. exports.AVLMapSubEntrySetIterator = AVLMapSubEntrySetIterator;
  44. function cast_de_nrw_schule_svws_core_adt_map_AVLMapSubEntrySetIterator(obj) {
  45. return obj;
  46. }
  47. exports.cast_de_nrw_schule_svws_core_adt_map_AVLMapSubEntrySetIterator = cast_de_nrw_schule_svws_core_adt_map_AVLMapSubEntrySetIterator;
  48. //# sourceMappingURL=AVLMapSubEntrySetIterator.js.map