AVLMapIntervall.ts 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. import { JavaObject, cast_java_lang_Object } from '../../../java/lang/JavaObject';
  2. import { JavaString, cast_java_lang_String } from '../../../java/lang/JavaString';
  3. export class AVLMapIntervall<K> extends JavaObject {
  4. static readonly _INFINITY_MINUS : unknown | null = new Object();
  5. static readonly _INFINITY_PLUS : unknown | null = new Object();
  6. readonly from : K;
  7. readonly fromInc : boolean;
  8. readonly to : K;
  9. readonly toInc : boolean;
  10. /**
  11. * @param pFrom Der Anfang des Intervalls.
  12. * @param pFromInc Gibt an, ob der Intervall-Anfang inklusive ist.
  13. * @param pTo Das Ende des Intervalls.
  14. * @param pToInc Gibt an, ob das Intervall-Ende inklusive ist.
  15. */
  16. constructor(pFrom : K, pFromInc : boolean, pTo : K, pToInc : boolean) {
  17. super();
  18. this.from = pFrom;
  19. this.fromInc = pFromInc;
  20. this.to = pTo;
  21. this.toInc = pToInc;
  22. }
  23. public toString() : String {
  24. let sFrom : String = (this.from === AVLMapIntervall._INFINITY_MINUS) ? "-INF" : "" + this.from;
  25. let sTo : String = (this.to === AVLMapIntervall._INFINITY_PLUS) ? "+INF" : "" + this.to;
  26. return "[" + sFrom.valueOf() + ", " + this.fromInc + ", " + sTo.valueOf() + ", " + this.toInc + "]";
  27. }
  28. isTranspiledInstanceOf(name : string): boolean {
  29. return ['de.nrw.schule.svws.core.adt.map.AVLMapIntervall'].includes(name);
  30. }
  31. }
  32. export function cast_de_nrw_schule_svws_core_adt_map_AVLMapIntervall<K>(obj : unknown) : AVLMapIntervall<K> {
  33. return obj as AVLMapIntervall<K>;
  34. }