import { NavigableSet, cast_java_util_NavigableSet } from '../../../java/util/NavigableSet'; 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 { SortedSet, cast_java_util_SortedSet } from '../../../java/util/SortedSet'; import { AVLMapSubMap, cast_de_nrw_schule_svws_core_adt_map_AVLMapSubMap } from '../../../core/adt/map/AVLMapSubMap'; import { Comparator, cast_java_util_Comparator } from '../../../java/util/Comparator'; export class AVLMapSubKeySet extends JavaObject implements NavigableSet { private readonly _sub : AVLMapSubMap; /** * Erstellt eine neues Sub-Set auf die übergebene {@link AVLMap}. * * @param sub Die {@link AVLMap} auf der operiert wird. */ constructor(sub : AVLMapSubMap) { super(); this._sub = sub; } public toString() : String { return this._sub.toString(); } public comparator() : Comparator> { return this._sub.comparator(); } public first() : K { return this._sub.firstKey(); } public last() : K { return this._sub.lastKey(); } public size() : number { return this._sub.size(); } public isEmpty() : boolean { return this._sub.isEmpty(); } public contains(o : unknown) : boolean { return this._sub.containsKey(o); } 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.bcGetArrayListOfKeys().toArray(); } else if (((typeof __param0 !== "undefined") && Array.isArray(__param0))) { let a : Array = __param0; return this._sub.bcGetArrayListOfKeys().toArray(a); } else throw new Error('invalid method overload'); } public add(e : K) : boolean { return this._sub.bcAddKey(e); } public remove(o : unknown) : boolean { return this._sub.bcRemoveKeyReturnBool(o); } public containsAll(c : Collection) : boolean { return this._sub.bcContainsAllKeys(c); } public addAll(c : Collection) : boolean { return this._sub.bcAddAllKeys(c); } public retainAll(c : Collection) : boolean { return this._sub.bcRetainAllKeys(c); } public removeAll(c : Collection) : boolean { return this._sub.bcRemoveAllKeys(c); } public clear() : void { this._sub.clear(); } public lower(e : K) : K | null { return this._sub.bcGetLowerKeyOrNull(e); } public floor(e : K) : K | null { return this._sub.bcGetFloorKeyOrNull(e); } public ceiling(e : K) : K | null { return this._sub.bcGetCeilingKeyOrNull(e); } public higher(e : K) : K | null { return this._sub.bcGetHigherKeyOrNull(e); } public pollFirst() : K | null { return this._sub.bcPollFirstKeyOrNull(); } public pollLast() : K | null { return this._sub.bcPollLastKeyOrNull(); } public iterator() : JavaIterator { return this._sub.bcGetSubKeySetIterator(); } public descendingSet() : NavigableSet { return this._sub.bcGetSubKeySetDescending(); } public descendingIterator() : JavaIterator { return this._sub.bcGetSubKeySetDescendingIterator(); } public subSet(fromElement : K, fromInclusive : boolean, toElement : K, toInclusive : boolean) : NavigableSet; public subSet(fromElement : K, toElement : K) : SortedSet; /** * Implementation for method overloads of 'subSet' */ public subSet(__param0 : K, __param1 : K | boolean, __param2? : K, __param3? : boolean) : NavigableSet | SortedSet { if (((typeof __param0 !== "undefined") && (typeof __param0 !== "undefined")) && ((typeof __param1 !== "undefined") && typeof __param1 === "boolean") && ((typeof __param2 !== "undefined") && (typeof __param2 !== "undefined")) && ((typeof __param3 !== "undefined") && typeof __param3 === "boolean")) { let fromElement : K = __param0 as unknown as K; let fromInclusive : boolean = __param1 as boolean; let toElement : K = __param2 as unknown as K; let toInclusive : boolean = __param3 as boolean; return this._sub.bcGetSubKeySet(fromElement, fromInclusive, toElement, toInclusive); } else if (((typeof __param0 !== "undefined") && (typeof __param0 !== "undefined")) && ((typeof __param1 !== "undefined") && (typeof __param1 !== "undefined")) && (typeof __param2 === "undefined") && (typeof __param3 === "undefined")) { let fromElement : K = __param0 as unknown as K; let toElement : K = __param1 as unknown as K; return this._sub.bcGetSubKeySet(fromElement, toElement); } else throw new Error('invalid method overload'); } public headSet(toElement : K, inclusive : boolean) : NavigableSet; public headSet(toElement : K) : SortedSet; /** * Implementation for method overloads of 'headSet' */ public headSet(__param0 : K, __param1? : boolean) : NavigableSet | SortedSet { if (((typeof __param0 !== "undefined") && (typeof __param0 !== "undefined")) && ((typeof __param1 !== "undefined") && typeof __param1 === "boolean")) { let toElement : K = __param0 as unknown as K; let inclusive : boolean = __param1 as boolean; return this._sub.bcGetSubKeyHeadSet(toElement, inclusive); } else if (((typeof __param0 !== "undefined") && (typeof __param0 !== "undefined")) && (typeof __param1 === "undefined")) { let toElement : K = __param0 as unknown as K; return this._sub.bcGetSubKeyHeadSet(toElement); } else throw new Error('invalid method overload'); } public tailSet(fromElement : K, inclusive : boolean) : NavigableSet; public tailSet(fromElement : K) : SortedSet; /** * Implementation for method overloads of 'tailSet' */ public tailSet(__param0 : K, __param1? : boolean) : NavigableSet | SortedSet { if (((typeof __param0 !== "undefined") && (typeof __param0 !== "undefined")) && ((typeof __param1 !== "undefined") && typeof __param1 === "boolean")) { let fromElement : K = __param0 as unknown as K; let inclusive : boolean = __param1 as boolean; return this._sub.bcGetSubKeyTailSet(fromElement, inclusive); } else if (((typeof __param0 !== "undefined") && (typeof __param0 !== "undefined")) && (typeof __param1 === "undefined")) { let fromElement : K = __param0 as unknown as K; return this._sub.bcGetSubKeyTailSet(fromElement); } else throw new Error('invalid method overload'); } isTranspiledInstanceOf(name : string): boolean { return ['java.util.SortedSet', 'java.util.Collection', 'de.nrw.schule.svws.core.adt.map.AVLMapSubKeySet', 'java.util.Set', 'java.util.NavigableSet', 'java.lang.Iterable'].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_AVLMapSubKeySet(obj : unknown) : AVLMapSubKeySet { return obj as AVLMapSubKeySet; }