import { JavaMapEntry, cast_java_util_Map_Entry } from '../../../java/util/JavaMapEntry'; import { JavaSet, cast_java_util_Set } from '../../../java/util/JavaSet'; import { JavaIterator, cast_java_util_Iterator } from '../../../java/util/JavaIterator'; import { Collection, cast_java_util_Collection } from '../../../java/util/Collection'; import { JavaObject, cast_java_lang_Object } from '../../../java/lang/JavaObject'; import { JavaString, cast_java_lang_String } from '../../../java/lang/JavaString'; import { JavaMap, cast_java_util_Map } from '../../../java/util/JavaMap'; import { AVLMapSubMap, cast_de_nrw_schule_svws_core_adt_map_AVLMapSubMap } from '../../../core/adt/map/AVLMapSubMap'; export class AVLMapSubEntrySet extends JavaObject implements JavaSet> { private readonly _sub : AVLMapSubMap; /** * Erstellt ein neues SubEntrySet auf die übergebene {@link AVLMap}. * * @param sub Die {@link AVLMapSubMap} auf der operiert wird. */ constructor(sub : AVLMapSubMap) { super(); this._sub = sub; } public toString() : String { return this._sub.toString(); } public size() : number { return this._sub.size(); } public isEmpty() : boolean { return this._sub.isEmpty(); } public contains(o : unknown) : boolean { return this._sub.bcContainsEntry(o); } public iterator() : JavaIterator> { return this._sub.bcGetSubEntrySetIterator(); } public toArray() : Array; public toArray(a : Array) : Array; /** * Implementation for method overloads of 'toArray' */ public toArray(__param0? : Array) : Array | Array { if ((typeof __param0 === "undefined")) { return this._sub.bcGetArrayListOfEntries().toArray(); } else if (((typeof __param0 !== "undefined") && Array.isArray(__param0))) { let a : Array = __param0; return this._sub.bcGetArrayListOfEntries().toArray(a); } else throw new Error('invalid method overload'); } public add(e : JavaMapEntry) : boolean { return this._sub.bcAddEntryReturnBool(e); } public remove(o : unknown) : boolean { return this._sub.bcRemoveEntry(o); } public containsAll(c : Collection) : boolean { return this._sub.bcContainsAllEntries(c); } public addAll(c : Collection>) : boolean { return this._sub.bcAddAllEntries(c); } public retainAll(c : Collection) : boolean { return this._sub.bcRetainAllEntries(c); } public removeAll(c : Collection) : boolean { return this._sub.bcRemoveAllEntries(c); } public clear() : void { this._sub.clear(); } isTranspiledInstanceOf(name : string): boolean { return ['java.util.Collection', 'java.util.Set', 'java.lang.Iterable', 'de.nrw.schule.svws.core.adt.map.AVLMapSubEntrySet'].includes(name); } public [Symbol.iterator](): Iterator> { let iter : JavaIterator> = this.iterator(); const result : Iterator> = { next() : IteratorResult> { if (iter.hasNext()) return { value : iter.next(), done : false }; return { value : null, done : true }; } }; return result; } } export function cast_de_nrw_schule_svws_core_adt_map_AVLMapSubEntrySet(obj : unknown) : AVLMapSubEntrySet { return obj as AVLMapSubEntrySet; }