boolean as an object.
+ * @param {boolean} value
+ * @class
+ */
+ var BooleanHelper = /** @class */ (function () {
+ function BooleanHelper() {
+ }
+ BooleanHelper.TYPE_$LI$ = function () { if (BooleanHelper.TYPE == null) {
+ BooleanHelper.TYPE = Boolean;
+ } return BooleanHelper.TYPE; };
+ ;
+ BooleanHelper.compare = function (x, y) {
+ return (x === y) ? 0 : (x ? 1 : -1);
+ };
+ BooleanHelper.hashCode = function (value) {
+ return value ? 1231 : 1237;
+ };
+ BooleanHelper.logicalAnd = function (a, b) {
+ return a && b;
+ };
+ BooleanHelper.logicalOr = function (a, b) {
+ return a || b;
+ };
+ BooleanHelper.logicalXor = function (a, b) {
+ return (a) !== (b);
+ };
+ BooleanHelper.parseBoolean = function (s) {
+ return /* equalsIgnoreCase */ (function (o1, o2) { return o1.toUpperCase() === (o2 === null ? o2 : o2.toUpperCase()); })("true", s);
+ };
+ BooleanHelper.toString = function (x) {
+ return /* valueOf */ new String(x).toString();
+ };
+ BooleanHelper.valueOf$boolean = function (b) {
+ return b ? BooleanHelper.TRUE : BooleanHelper.FALSE;
+ };
+ BooleanHelper.valueOf$java_lang_String = function (s) {
+ return BooleanHelper.valueOf$boolean(BooleanHelper.parseBoolean(s));
+ };
+ BooleanHelper.valueOf = function (s) {
+ if (((typeof s === 'string') || s === null)) {
+ return javaemul.internal.BooleanHelper.valueOf$java_lang_String(s);
+ }
+ else if (((typeof s === 'boolean') || s === null)) {
+ return javaemul.internal.BooleanHelper.valueOf$boolean(s);
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ BooleanHelper.prototype.booleanValue = function () {
+ return BooleanHelper.unsafeCast((javaemul.internal.InternalPreconditions.checkNotNull(this)));
+ };
+ /*private*/ BooleanHelper.unsafeCast = function (value) {
+ return value;
+ };
+ BooleanHelper.prototype.compareTo$javaemul_internal_BooleanHelper = function (b) {
+ return BooleanHelper.compare(this.booleanValue(), b.booleanValue());
+ };
+ /**
+ *
+ * @param {javaemul.internal.BooleanHelper} b
+ * @return {number}
+ */
+ BooleanHelper.prototype.compareTo = function (b) {
+ if (((b != null && b instanceof javaemul.internal.BooleanHelper) || b === null)) {
+ return this.compareTo$javaemul_internal_BooleanHelper(b);
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ /**
+ *
+ * @param {*} o
+ * @return {boolean}
+ */
+ BooleanHelper.prototype.equals = function (o) {
+ return javaemul.internal.InternalPreconditions.checkNotNull(this) === o;
+ };
+ /**
+ *
+ * @return {number}
+ */
+ BooleanHelper.prototype.hashCode = function () {
+ return BooleanHelper.hashCode(this.booleanValue());
+ };
+ /**
+ *
+ * @return {string}
+ */
+ BooleanHelper.prototype.toString = function () {
+ return BooleanHelper.toString(this.booleanValue());
+ };
+ BooleanHelper.FALSE = false;
+ BooleanHelper.TRUE = true;
+ return BooleanHelper;
+ }());
+ internal.BooleanHelper = BooleanHelper;
+ BooleanHelper["__class"] = "javaemul.internal.BooleanHelper";
+ BooleanHelper["__interfaces"] = ["java.lang.Comparable", "java.io.Serializable"];
+ })(internal = javaemul.internal || (javaemul.internal = {}));
+})(javaemul || (javaemul = {}));
+(function (javaemul) {
+ var internal;
+ (function (internal) {
+ /**
+ * Hashcode caching for strings.
+ * @class
+ */
+ var StringHashCache = /** @class */ (function () {
+ function StringHashCache() {
+ }
+ StringHashCache.back_$LI$ = function () { if (StringHashCache.back == null) {
+ StringHashCache.back = StringHashCache.createNativeObject();
+ } return StringHashCache.back; };
+ ;
+ StringHashCache.front_$LI$ = function () { if (StringHashCache.front == null) {
+ StringHashCache.front = StringHashCache.createNativeObject();
+ } return StringHashCache.front; };
+ ;
+ StringHashCache.getHashCode = function (str) {
+ var key = ":" + str;
+ var result = StringHashCache.getProperty(StringHashCache.front_$LI$(), key);
+ if (!javaemul.internal.JsUtils.isUndefined(result)) {
+ return StringHashCache.unsafeCastToInt(result);
+ }
+ result = StringHashCache.getProperty(StringHashCache.back_$LI$(), key);
+ var hashCode = javaemul.internal.JsUtils.isUndefined(result) ? StringHashCache.compute(str) : StringHashCache.unsafeCastToInt(result);
+ StringHashCache.increment();
+ javaemul.internal.JsUtils.setIntProperty(StringHashCache.front_$LI$(), key, hashCode);
+ return hashCode;
+ };
+ /*private*/ StringHashCache.compute = function (str) {
+ var hashCode = 0;
+ var n = str.length;
+ var nBatch = n - 4;
+ var i = 0;
+ while ((i < nBatch)) {
+ {
+ hashCode = (function (c) { return c.charCodeAt == null ? c : c.charCodeAt(0); })(str.charAt(i + 3)) + 31 * ((function (c) { return c.charCodeAt == null ? c : c.charCodeAt(0); })(str.charAt(i + 2)) + 31 * ((function (c) { return c.charCodeAt == null ? c : c.charCodeAt(0); })(str.charAt(i + 1)) + 31 * ((function (c) { return c.charCodeAt == null ? c : c.charCodeAt(0); })(str.charAt(i)) + 31 * hashCode)));
+ hashCode = javaemul.internal.Coercions.ensureInt(hashCode);
+ i += 4;
+ }
+ }
+ ;
+ while ((i < n)) {
+ {
+ hashCode = hashCode * 31 + (function (c) { return c.charCodeAt == null ? c : c.charCodeAt(0); })(str.charAt(i++));
+ }
+ }
+ ;
+ hashCode = javaemul.internal.Coercions.ensureInt(hashCode);
+ return hashCode;
+ };
+ /*private*/ StringHashCache.increment = function () {
+ if (StringHashCache.count === StringHashCache.MAX_CACHE) {
+ StringHashCache.back = StringHashCache.front;
+ StringHashCache.front = StringHashCache.createNativeObject();
+ StringHashCache.count = 0;
+ }
+ ++StringHashCache.count;
+ };
+ /*private*/ StringHashCache.getProperty = function (map, key) {
+ return (map[key]);
+ };
+ /*private*/ StringHashCache.createNativeObject = function () {
+ return ({});
+ };
+ /*private*/ StringHashCache.unsafeCastToInt = function (o) {
+ return (o);
+ };
+ /**
+ * Tracks the number of entries in front.
+ */
+ StringHashCache.count = 0;
+ /**
+ * Pulled this number out of thin air.
+ */
+ StringHashCache.MAX_CACHE = 256;
+ return StringHashCache;
+ }());
+ internal.StringHashCache = StringHashCache;
+ StringHashCache["__class"] = "javaemul.internal.StringHashCache";
+ })(internal = javaemul.internal || (javaemul.internal = {}));
+})(javaemul || (javaemul = {}));
+(function (javaemul) {
+ var internal;
+ (function (internal) {
+ var stream;
+ (function (stream) {
+ var ConsumingFunction = /** @class */ (function () {
+ function ConsumingFunction(consumer) {
+ if (this.consumer === undefined) {
+ this.consumer = null;
+ }
+ this.consumer = (consumer);
+ }
+ /**
+ *
+ * @param {*} t
+ * @return {*}
+ */
+ ConsumingFunction.prototype.apply = function (t) {
+ (function (target) { return (typeof target === 'function') ? target(t) : target.accept(t); })(this.consumer);
+ return t;
+ };
+ return ConsumingFunction;
+ }());
+ stream.ConsumingFunction = ConsumingFunction;
+ ConsumingFunction["__class"] = "javaemul.internal.stream.ConsumingFunction";
+ ConsumingFunction["__interfaces"] = ["java.util.function.Function"];
+ })(stream = internal.stream || (internal.stream = {}));
+ })(internal = javaemul.internal || (javaemul.internal = {}));
+})(javaemul || (javaemul = {}));
+(function (javaemul) {
+ var internal;
+ (function (internal) {
+ var stream;
+ (function (stream) {
+ var TerminalStreamRow = /** @class */ (function () {
+ function TerminalStreamRow() {
+ }
+ TerminalStreamRow.prototype.chain = function (next) {
+ if (next.constructor === javaemul.internal.stream.StreamRowEnd) {
+ return;
+ }
+ throw new java.lang.IllegalStateException();
+ };
+ TerminalStreamRow.prototype.end = function () {
+ };
+ return TerminalStreamRow;
+ }());
+ stream.TerminalStreamRow = TerminalStreamRow;
+ TerminalStreamRow["__class"] = "javaemul.internal.stream.TerminalStreamRow";
+ TerminalStreamRow["__interfaces"] = ["javaemul.internal.stream.StreamRow"];
+ })(stream = internal.stream || (internal.stream = {}));
+ })(internal = javaemul.internal || (javaemul.internal = {}));
+})(javaemul || (javaemul = {}));
+(function (javaemul) {
+ var internal;
+ (function (internal) {
+ var stream;
+ (function (stream) {
+ var RunnableChain = /** @class */ (function () {
+ function RunnableChain(run) {
+ if (this.run === undefined) {
+ this.run = null;
+ }
+ if (this.next === undefined) {
+ this.next = null;
+ }
+ this.run = (run);
+ }
+ RunnableChain.prototype.chain = function (next) {
+ if (this.next == null) {
+ this.next = next;
+ return;
+ }
+ this.next.chain(next);
+ };
+ RunnableChain.prototype.runChain = function () {
+ ((function (target) { return (target['run'] === undefined) ? target : target['run']; })(this.run))();
+ if (this.next == null) {
+ return;
+ }
+ this.next.runChain();
+ };
+ return RunnableChain;
+ }());
+ stream.RunnableChain = RunnableChain;
+ RunnableChain["__class"] = "javaemul.internal.stream.RunnableChain";
+ })(stream = internal.stream || (internal.stream = {}));
+ })(internal = javaemul.internal || (javaemul.internal = {}));
+})(javaemul || (javaemul = {}));
+(function (javaemul) {
+ var internal;
+ (function (internal) {
+ var stream;
+ (function (stream) {
+ var QuiteRunnable = /** @class */ (function () {
+ function QuiteRunnable(loudRunnable) {
+ if (this.loudRunnable === undefined) {
+ this.loudRunnable = null;
+ }
+ this.loudRunnable = (loudRunnable);
+ }
+ /**
+ *
+ */
+ QuiteRunnable.prototype.run = function () {
+ try {
+ ((function (target) { return (target['run'] === undefined) ? target : target['run']; })(this.loudRunnable))();
+ }
+ catch (e) {
+ console.error(e.message, e);
+ }
+ ;
+ };
+ return QuiteRunnable;
+ }());
+ stream.QuiteRunnable = QuiteRunnable;
+ QuiteRunnable["__class"] = "javaemul.internal.stream.QuiteRunnable";
+ QuiteRunnable["__interfaces"] = ["java.lang.Runnable"];
+ })(stream = internal.stream || (internal.stream = {}));
+ })(internal = javaemul.internal || (javaemul.internal = {}));
+})(javaemul || (javaemul = {}));
+(function (javaemul) {
+ var internal;
+ (function (internal) {
+ var stream;
+ (function (stream) {
+ var ChooseSmallest = /** @class */ (function () {
+ function ChooseSmallest(comparator) {
+ if (this.comparator === undefined) {
+ this.comparator = null;
+ }
+ this.comparator = (comparator);
+ }
+ ChooseSmallest.prototype.apply = function (t1, t2) {
+ if (((function (target) { return (target['compare'] === undefined) ? target : target['compare']; })(this.comparator))(t1, t2) <= 0) {
+ return t1;
+ }
+ return t2;
+ };
+ return ChooseSmallest;
+ }());
+ stream.ChooseSmallest = ChooseSmallest;
+ ChooseSmallest["__class"] = "javaemul.internal.stream.ChooseSmallest";
+ ChooseSmallest["__interfaces"] = ["java.util.function.BiFunction", "java.util.function.BinaryOperator"];
+ })(stream = internal.stream || (internal.stream = {}));
+ })(internal = javaemul.internal || (javaemul.internal = {}));
+})(javaemul || (javaemul = {}));
+(function (javaemul) {
+ var internal;
+ (function (internal) {
+ var stream;
+ (function (stream) {
+ var StreamHelper = /** @class */ (function () {
+ function StreamHelper(data) {
+ if (this.onCloseChain === undefined) {
+ this.onCloseChain = null;
+ }
+ if (this.head === undefined) {
+ this.head = null;
+ }
+ if (this.end === undefined) {
+ this.end = null;
+ }
+ if (this.data === undefined) {
+ this.data = null;
+ }
+ this.head = new javaemul.internal.stream.StreamRowMap(function (o) { return o; });
+ this.end = new javaemul.internal.stream.StreamRowEnd(this.head);
+ this.head.chain(this.end);
+ this.data = data;
+ }
+ /*private*/ StreamHelper.prototype.chain = function (streamRow) {
+ this.end.chain(streamRow);
+ return this;
+ };
+ /*private*/ StreamHelper.prototype.play = function () {
+ for (var index121 = this.data.iterator(); index121.hasNext();) {
+ var item = index121.next();
+ {
+ if (!this.head.item(item)) {
+ break;
+ }
+ }
+ }
+ this.head.end();
+ };
+ /*private*/ StreamHelper.prototype.foldRight = function (identity, accumulator) {
+ var rowReduce = new javaemul.internal.stream.StreamRowReduce(identity, (accumulator));
+ this.chain(rowReduce);
+ this.play();
+ return rowReduce.getResult();
+ };
+ StreamHelper.prototype.filter = function (predicate) {
+ return this.chain(new javaemul.internal.stream.StreamRowFilter((predicate)));
+ };
+ StreamHelper.prototype.map = function (mapper) {
+ return this.chain(new javaemul.internal.stream.StreamRowMap((mapper)));
+ };
+ StreamHelper.prototype.mapToObj = function (mapper) {
+ return this.chain(new javaemul.internal.stream.StreamRowMap(function (n) { return (function (target) { return (typeof target === 'function') ? target(n) : target.apply(n); })(mapper); }));
+ };
+ StreamHelper.prototype.flatMap = function (mapper) {
+ return this.chain(new javaemul.internal.stream.StreamRowFlatMap((mapper)));
+ };
+ StreamHelper.prototype.distinct = function () {
+ return this.chain(new javaemul.internal.stream.StreamRowCollector((new java.util.LinkedHashSet())));
+ };
+ StreamHelper.prototype.sorted$ = function () {
+ return this.sorted$java_util_Comparator(function (a, b) { return a.compareTo(b); });
+ };
+ StreamHelper.prototype.sorted$java_util_Comparator = function (comparator) {
+ return this.chain(new javaemul.internal.stream.StreamRowSortingCollector((new java.util.ArrayList()), (comparator)));
+ };
+ StreamHelper.prototype.sorted = function (comparator) {
+ if (((typeof comparator === 'function' && comparator.length === 2) || comparator === null)) {
+ return this.sorted$java_util_Comparator(comparator);
+ }
+ else if (comparator === undefined) {
+ return this.sorted$();
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ StreamHelper.prototype.peek = function (action) {
+ return this.chain(new javaemul.internal.stream.StreamRowMap(function (arg0) { return new javaemul.internal.stream.ConsumingFunction(action).apply(arg0); }));
+ };
+ StreamHelper.prototype.limit = function (maxSize) {
+ return this.chain(new javaemul.internal.stream.StreamRowFilterFlop(function (arg0) { return new javaemul.internal.stream.CountingPredicate(maxSize).test(arg0); }));
+ };
+ StreamHelper.prototype.skip = function (n) {
+ var p = (new javaemul.internal.stream.CountingPredicate(n));
+ return this.chain(new javaemul.internal.stream.StreamRowFilter((function (p) {
+ return function (v) { return !p.test(v); };
+ })(p)));
+ };
+ StreamHelper.prototype.forEach = function (action) {
+ this.peek((action));
+ this.play();
+ };
+ StreamHelper.prototype.forEachOrdered = function (action) {
+ this.forEach((action));
+ };
+ StreamHelper.prototype.toArray$ = function () {
+ var result = (new java.util.ArrayList());
+ this.chain(new javaemul.internal.stream.StreamRowCollector(result));
+ this.play();
+ return result['toArray$']();
+ };
+ StreamHelper.prototype.toArray$java_util_function_IntFunction = function (generator) {
+ var result = (new java.util.ArrayList());
+ this.chain(new javaemul.internal.stream.StreamRowCollector(result));
+ this.play();
+ return result['toArray$java_lang_Object_A']((function (target) { return (typeof target === 'function') ? target(result.size()) : target.apply(result.size()); })(generator));
+ };
+ StreamHelper.prototype.toArray = function (generator) {
+ if (((typeof generator === 'function' && generator.length === 1) || generator === null)) {
+ return this.toArray$java_util_function_IntFunction(generator);
+ }
+ else if (generator === undefined) {
+ return this.toArray$();
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ StreamHelper.prototype.reduce$java_lang_Object$java_util_function_BinaryOperator = function (identity, accumulator) {
+ return this.foldRight(java.util.Optional.of(identity), (accumulator)).get();
+ };
+ StreamHelper.prototype.reduce$java_util_function_BinaryOperator = function (accumulator) {
+ return this.foldRight(java.util.Optional.empty(), (accumulator));
+ };
+ StreamHelper.prototype.collect$java_util_stream_Collector = function (collector) {
+ var container = (function (target) { return (typeof target === 'function') ? target() : target.get(); })(collector.supplier());
+ var accumulator = (collector.accumulator());
+ this.chain(new javaemul.internal.stream.StreamRowMap(function (arg0) {
+ return new javaemul.internal.stream.ConsumingFunction((function (container, accumulator) {
+ return function (item) { return (function (target) { return (typeof target === 'function') ? target(container, item) : target.accept(container, item); })(accumulator); };
+ })(container, accumulator)).apply(arg0);
+ }));
+ this.play();
+ return container;
+ };
+ StreamHelper.prototype.min = function (comparator) {
+ return this.foldRight(java.util.Optional.empty(), function (a, b) { return ((function (target) { return (target['compare'] === undefined) ? target : target['compare']; })(comparator))(a, b) <= 0 ? a : b; });
+ };
+ StreamHelper.prototype.max = function (comparator) {
+ return this.foldRight(java.util.Optional.empty(), function (a, b) { return ((function (target) { return (target['compare'] === undefined) ? target : target['compare']; })(comparator))(a, b) >= 0 ? a : b; });
+ };
+ StreamHelper.prototype.count = function () {
+ var counter = new javaemul.internal.stream.StreamRowCount();
+ this.chain(counter);
+ this.play();
+ return counter.getCount();
+ };
+ StreamHelper.prototype.anyMatch = function (predicate) {
+ var streamRow = new javaemul.internal.stream.StreamRowOnceFilter((predicate));
+ this.chain(streamRow);
+ this.play();
+ return streamRow.getPredicateValue();
+ };
+ StreamHelper.prototype.allMatch = function (predicate) {
+ var streamRow = new javaemul.internal.stream.StreamRowAllFilter((predicate));
+ this.chain(streamRow);
+ this.play();
+ return streamRow.getPredicateValue();
+ };
+ StreamHelper.prototype.noneMatch = function (predicate) {
+ return this.allMatch(function (v) { return !(function (target) { return (typeof target === 'function') ? target(v) : target.test(v); })(predicate); });
+ };
+ StreamHelper.prototype.findFirst = function () {
+ var streamRow = new javaemul.internal.stream.StreamRowOnceFilter(function (o) { return true; });
+ this.chain(streamRow);
+ this.play();
+ return streamRow.getFirstMatch();
+ };
+ StreamHelper.prototype.findAny = function () {
+ return this.findFirst();
+ };
+ StreamHelper.prototype.iterator = function () {
+ var result = (new java.util.ArrayList());
+ this.chain(new javaemul.internal.stream.StreamRowCollector(result));
+ this.play();
+ return result.iterator();
+ };
+ StreamHelper.prototype.isParallel = function () {
+ return false;
+ };
+ StreamHelper.prototype.sequential = function () {
+ return this;
+ };
+ StreamHelper.prototype.parallel = function () {
+ return this;
+ };
+ StreamHelper.prototype.unordered = function () {
+ return this;
+ };
+ StreamHelper.prototype.onClose = function (closeHandler) {
+ var chainItem = new javaemul.internal.stream.RunnableChain(function () { return new javaemul.internal.stream.QuiteRunnable(closeHandler).run(); });
+ if (this.onCloseChain == null) {
+ this.onCloseChain = chainItem;
+ }
+ else {
+ this.onCloseChain.chain(chainItem);
+ }
+ return this;
+ };
+ StreamHelper.prototype.close = function () {
+ if (this.onCloseChain == null) {
+ return;
+ }
+ this.onCloseChain.runChain();
+ };
+ StreamHelper.prototype.mapToInt = function (mapper) {
+ throw new java.lang.IllegalStateException();
+ };
+ StreamHelper.prototype.mapToLong = function (mapper) {
+ throw new java.lang.IllegalStateException();
+ };
+ StreamHelper.prototype.mapToDouble = function (mapper) {
+ throw new java.lang.IllegalStateException();
+ };
+ StreamHelper.prototype.flatMapToInt = function (mapper) {
+ throw new java.lang.IllegalStateException();
+ };
+ StreamHelper.prototype.flatMapToLong = function (mapper) {
+ throw new java.lang.IllegalStateException();
+ };
+ StreamHelper.prototype.flatMapToDouble = function (mapper) {
+ throw new java.lang.IllegalStateException();
+ };
+ StreamHelper.prototype.spliterator = function () {
+ throw new java.lang.IllegalStateException();
+ };
+ StreamHelper.prototype.reduce$java_lang_Object$java_util_function_BiFunction$java_util_function_BinaryOperator = function (identity, accumulator, combiner) {
+ throw new java.lang.IllegalStateException();
+ };
+ StreamHelper.prototype.reduce = function (identity, accumulator, combiner) {
+ if (((identity != null) || identity === null) && ((typeof accumulator === 'function' && accumulator.length === 2) || accumulator === null) && ((typeof combiner === 'function' && combiner.length === 2) || combiner === null)) {
+ return this.reduce$java_lang_Object$java_util_function_BiFunction$java_util_function_BinaryOperator(identity, accumulator, combiner);
+ }
+ else if (((identity != null) || identity === null) && ((typeof accumulator === 'function' && accumulator.length === 2) || accumulator === null) && combiner === undefined) {
+ return this.reduce$java_lang_Object$java_util_function_BinaryOperator(identity, accumulator);
+ }
+ else if (((typeof identity === 'function' && identity.length === 2) || identity === null) && accumulator === undefined && combiner === undefined) {
+ return this.reduce$java_util_function_BinaryOperator(identity);
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ StreamHelper.prototype.collect$java_util_function_Supplier$java_util_function_BiConsumer$java_util_function_BiConsumer = function (supplier, accumulator, combiner) {
+ throw new java.lang.IllegalStateException();
+ };
+ StreamHelper.prototype.collect = function (supplier, accumulator, combiner) {
+ if (((typeof supplier === 'function' && supplier.length === 0) || supplier === null) && ((typeof accumulator === 'function' && accumulator.length === 2) || accumulator === null) && ((typeof combiner === 'function' && combiner.length === 2) || combiner === null)) {
+ return this.collect$java_util_function_Supplier$java_util_function_BiConsumer$java_util_function_BiConsumer(supplier, accumulator, combiner);
+ }
+ else if (((supplier != null && (supplier["__interfaces"] != null && supplier["__interfaces"].indexOf("java.util.stream.Collector") >= 0 || supplier.constructor != null && supplier.constructor["__interfaces"] != null && supplier.constructor["__interfaces"].indexOf("java.util.stream.Collector") >= 0)) || supplier === null) && accumulator === undefined && combiner === undefined) {
+ return this.collect$java_util_stream_Collector(supplier);
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ return StreamHelper;
+ }());
+ stream.StreamHelper = StreamHelper;
+ StreamHelper["__class"] = "javaemul.internal.stream.StreamHelper";
+ StreamHelper["__interfaces"] = ["java.util.stream.Stream"];
+ })(stream = internal.stream || (internal.stream = {}));
+ })(internal = javaemul.internal || (javaemul.internal = {}));
+})(javaemul || (javaemul = {}));
+(function (javaemul) {
+ var internal;
+ (function (internal) {
+ var stream;
+ (function (stream) {
+ var CountingPredicate = /** @class */ (function () {
+ function CountingPredicate(n) {
+ if (this.countDown === undefined) {
+ this.countDown = 0;
+ }
+ this.countDown = n;
+ }
+ /**
+ *
+ * @param {*} t
+ * @return {boolean}
+ */
+ CountingPredicate.prototype.test = function (t) {
+ if (this.countDown <= 0) {
+ return false;
+ }
+ --this.countDown;
+ return true;
+ };
+ return CountingPredicate;
+ }());
+ stream.CountingPredicate = CountingPredicate;
+ CountingPredicate["__class"] = "javaemul.internal.stream.CountingPredicate";
+ CountingPredicate["__interfaces"] = ["java.util.function.Predicate"];
+ })(stream = internal.stream || (internal.stream = {}));
+ })(internal = javaemul.internal || (javaemul.internal = {}));
+})(javaemul || (javaemul = {}));
+(function (javaemul) {
+ var internal;
+ (function (internal) {
+ var stream;
+ (function (stream) {
+ var TransientStreamRow = /** @class */ (function () {
+ function TransientStreamRow() {
+ if (this.next === undefined) {
+ this.next = null;
+ }
+ }
+ TransientStreamRow.prototype.chain = function (next) {
+ this.next = next;
+ };
+ return TransientStreamRow;
+ }());
+ stream.TransientStreamRow = TransientStreamRow;
+ TransientStreamRow["__class"] = "javaemul.internal.stream.TransientStreamRow";
+ TransientStreamRow["__interfaces"] = ["javaemul.internal.stream.StreamRow"];
+ })(stream = internal.stream || (internal.stream = {}));
+ })(internal = javaemul.internal || (javaemul.internal = {}));
+})(javaemul || (javaemul = {}));
+(function (javaemul) {
+ var internal;
+ (function (internal) {
+ var stream;
+ (function (stream) {
+ var VoidRunnable = /** @class */ (function () {
+ function VoidRunnable() {
+ }
+ VoidRunnable.dryRun_$LI$ = function () { if (VoidRunnable.dryRun == null) {
+ VoidRunnable.dryRun = new VoidRunnable();
+ } return VoidRunnable.dryRun; };
+ ;
+ VoidRunnable.prototype.run = function () {
+ };
+ return VoidRunnable;
+ }());
+ stream.VoidRunnable = VoidRunnable;
+ VoidRunnable["__class"] = "javaemul.internal.stream.VoidRunnable";
+ VoidRunnable["__interfaces"] = ["java.lang.Runnable"];
+ })(stream = internal.stream || (internal.stream = {}));
+ })(internal = javaemul.internal || (javaemul.internal = {}));
+})(javaemul || (javaemul = {}));
+(function (javaemul) {
+ var internal;
+ (function (internal) {
+ /**
+ * Provides an interface for simple JavaScript idioms that can not be expressed in Java.
+ * @class
+ */
+ var JsUtils = /** @class */ (function () {
+ function JsUtils() {
+ }
+ JsUtils.getInfinity = function () {
+ return Infinity;
+ };
+ JsUtils.isUndefined = function (value) {
+ return value == null;
+ };
+ JsUtils.unsafeCastToString = function (string) {
+ return string;
+ };
+ JsUtils.setPropertySafe = function (map, key, value) {
+ try {
+ (map)[key] = value;
+ }
+ catch (e) {
+ }
+ ;
+ };
+ JsUtils.getIntProperty = function (map, key) {
+ return ((map)[key]);
+ };
+ JsUtils.setIntProperty = function (map, key, value) {
+ (map)[key] = value;
+ };
+ JsUtils.typeOf = function (o) {
+ return typeof o;
+ };
+ return JsUtils;
+ }());
+ internal.JsUtils = JsUtils;
+ JsUtils["__class"] = "javaemul.internal.JsUtils";
+ })(internal = javaemul.internal || (javaemul.internal = {}));
+})(javaemul || (javaemul = {}));
+(function (javaemul) {
+ var internal;
+ (function (internal) {
+ /**
+ * A helper class for long comparison.
+ * @class
+ */
+ var LongCompareHolder = /** @class */ (function () {
+ function LongCompareHolder() {
+ }
+ LongCompareHolder.getLongComparator = function () {
+ return function (l1, l2) { return l2 - l1; };
+ };
+ return LongCompareHolder;
+ }());
+ internal.LongCompareHolder = LongCompareHolder;
+ LongCompareHolder["__class"] = "javaemul.internal.LongCompareHolder";
+ })(internal = javaemul.internal || (javaemul.internal = {}));
+})(javaemul || (javaemul = {}));
+(function (javaemul) {
+ var internal;
+ (function (internal) {
+ var ObjectHelper = /** @class */ (function () {
+ function ObjectHelper() {
+ }
+ ObjectHelper.clone = function (obj) {
+ var copy;
+ if (null == obj || "object" != typeof obj)
+ return obj;
+ if (obj instanceof Date) {
+ copy = new Date();
+ copy.setTime(obj.getTime());
+ return copy;
+ }
+ ;
+ if (obj instanceof Array) {
+ copy = [];
+ for (var i = 0, len = obj.length; i < len; i++) {
+ copy[i] = javaemul.internal.ObjectHelper.clone(obj[i]);
+ }
+ return copy;
+ }
+ ;
+ if (obj instanceof Object) {
+ copy = {};
+ for (var attr in obj) {
+ if (obj.hasOwnProperty(attr))
+ copy[attr] = javaemul.internal.ObjectHelper.clone(obj[attr]);
+ }
+ return copy;
+ }
+ ;
+ throw new Error("Unable to copy obj! Its type isn\'t supported.");
+ };
+ return ObjectHelper;
+ }());
+ internal.ObjectHelper = ObjectHelper;
+ ObjectHelper["__class"] = "javaemul.internal.ObjectHelper";
+ })(internal = javaemul.internal || (javaemul.internal = {}));
+})(javaemul || (javaemul = {}));
+(function (javaemul) {
+ var internal;
+ (function (internal) {
+ /**
+ * Wraps a native char as an object.
+ *
+ * TODO(jat): many of the classification methods implemented here are not
+ * correct in that they only handle ASCII characters, and many other methods are
+ * not currently implemented. I think the proper approach is to introduce * a
+ * deferred binding parameter which substitutes an implementation using a
+ * fully-correct Unicode character database, at the expense of additional data
+ * being downloaded. That way developers that need the functionality can get it
+ * without those who don't need it paying for it.
+ *
+ * + * The following methods are still not implemented -- most would require Unicode + * character db to be useful: + * - digit / is* / to*(int codePoint) + * - isDefined(char) + * - isIdentifierIgnorable(char) + * - isJavaIdentifierPart(char) + * - isJavaIdentifierStart(char) + * - isJavaLetter(char) -- deprecated, so probably not + * - isJavaLetterOrDigit(char) -- deprecated, so probably not + * - isISOControl(char) + * - isMirrored(char) + * - isSpaceChar(char) + * - isTitleCase(char) + * - isUnicodeIdentifierPart(char) + * - isUnicodeIdentifierStart(char) + * - getDirectionality(*) + * - getNumericValue(*) + * - getType(*) + * - reverseBytes(char) -- any use for this at all in the browser? + * - toTitleCase(*) + * - all the category constants for classification + * + * The following do not properly handle characters outside of ASCII: + * - digit(char c, int radix) + * - isDigit(char c) + * - isLetter(char c) + * - isLetterOrDigit(char c) + * - isLowerCase(char c) + * - isUpperCase(char c) + *+ * @param {string} value + * @class + */ + var CharacterHelper = /** @class */ (function () { + function CharacterHelper(value) { + if (this.value === undefined) { + this.value = null; + } + this.value = value; + } + CharacterHelper.TYPE_$LI$ = function () { if (CharacterHelper.TYPE == null) { + CharacterHelper.TYPE = String; + } return CharacterHelper.TYPE; }; + ; + CharacterHelper.charCount = function (codePoint) { + return codePoint >= CharacterHelper.MIN_SUPPLEMENTARY_CODE_POINT ? 2 : 1; + }; + CharacterHelper.codePointAt$char_A$int = function (a, index) { + return CharacterHelper.codePointAt$java_lang_CharSequence$int$int(new String(a), index, a.length); + }; + CharacterHelper.codePointAt$char_A$int$int = function (a, index, limit) { + return CharacterHelper.codePointAt$java_lang_CharSequence$int$int(new String(a), index, limit); + }; + CharacterHelper.codePointAt = function (a, index, limit) { + if (((a != null && a instanceof Array && (a.length == 0 || a[0] == null || (typeof a[0] === 'string'))) || a === null) && ((typeof index === 'number') || index === null) && ((typeof limit === 'number') || limit === null)) { + return javaemul.internal.CharacterHelper.codePointAt$char_A$int$int(a, index, limit); + } + else if (((a != null && (a["__interfaces"] != null && a["__interfaces"].indexOf("java.lang.CharSequence") >= 0 || a.constructor != null && a.constructor["__interfaces"] != null && a.constructor["__interfaces"].indexOf("java.lang.CharSequence") >= 0 || typeof a === "string")) || a === null) && ((typeof index === 'number') || index === null) && ((typeof limit === 'number') || limit === null)) { + return javaemul.internal.CharacterHelper.codePointAt$java_lang_CharSequence$int$int(a, index, limit); + } + else if (((a != null && a instanceof Array && (a.length == 0 || a[0] == null || (typeof a[0] === 'string'))) || a === null) && ((typeof index === 'number') || index === null) && limit === undefined) { + return javaemul.internal.CharacterHelper.codePointAt$char_A$int(a, index); + } + else if (((a != null && (a["__interfaces"] != null && a["__interfaces"].indexOf("java.lang.CharSequence") >= 0 || a.constructor != null && a.constructor["__interfaces"] != null && a.constructor["__interfaces"].indexOf("java.lang.CharSequence") >= 0 || typeof a === "string")) || a === null) && ((typeof index === 'number') || index === null) && limit === undefined) { + return javaemul.internal.CharacterHelper.codePointAt$java_lang_CharSequence$int(a, index); + } + else + throw new Error('invalid overload'); + }; + CharacterHelper.codePointAt$java_lang_CharSequence$int = function (seq, index) { + return CharacterHelper.codePointAt$java_lang_CharSequence$int$int(seq, index, seq.length); + }; + CharacterHelper.codePointBefore$char_A$int = function (a, index) { + return CharacterHelper.codePointBefore$java_lang_CharSequence$int$int(new String(a), index, 0); + }; + CharacterHelper.codePointBefore$char_A$int$int = function (a, index, start) { + return CharacterHelper.codePointBefore$java_lang_CharSequence$int$int(new String(a), index, start); + }; + CharacterHelper.codePointBefore = function (a, index, start) { + if (((a != null && a instanceof Array && (a.length == 0 || a[0] == null || (typeof a[0] === 'string'))) || a === null) && ((typeof index === 'number') || index === null) && ((typeof start === 'number') || start === null)) { + return javaemul.internal.CharacterHelper.codePointBefore$char_A$int$int(a, index, start); + } + else if (((a != null && (a["__interfaces"] != null && a["__interfaces"].indexOf("java.lang.CharSequence") >= 0 || a.constructor != null && a.constructor["__interfaces"] != null && a.constructor["__interfaces"].indexOf("java.lang.CharSequence") >= 0 || typeof a === "string")) || a === null) && ((typeof index === 'number') || index === null) && ((typeof start === 'number') || start === null)) { + return javaemul.internal.CharacterHelper.codePointBefore$java_lang_CharSequence$int$int(a, index, start); + } + else if (((a != null && a instanceof Array && (a.length == 0 || a[0] == null || (typeof a[0] === 'string'))) || a === null) && ((typeof index === 'number') || index === null) && start === undefined) { + return javaemul.internal.CharacterHelper.codePointBefore$char_A$int(a, index); + } + else if (((a != null && (a["__interfaces"] != null && a["__interfaces"].indexOf("java.lang.CharSequence") >= 0 || a.constructor != null && a.constructor["__interfaces"] != null && a.constructor["__interfaces"].indexOf("java.lang.CharSequence") >= 0 || typeof a === "string")) || a === null) && ((typeof index === 'number') || index === null) && start === undefined) { + return javaemul.internal.CharacterHelper.codePointBefore$java_lang_CharSequence$int(a, index); + } + else + throw new Error('invalid overload'); + }; + CharacterHelper.codePointBefore$java_lang_CharSequence$int = function (cs, index) { + return CharacterHelper.codePointBefore$java_lang_CharSequence$int$int(cs, index, 0); + }; + CharacterHelper.codePointCount$char_A$int$int = function (a, offset, count) { + return CharacterHelper.codePointCount$java_lang_CharSequence$int$int(new String(a), offset, offset + count); + }; + CharacterHelper.codePointCount = function (a, offset, count) { + if (((a != null && a instanceof Array && (a.length == 0 || a[0] == null || (typeof a[0] === 'string'))) || a === null) && ((typeof offset === 'number') || offset === null) && ((typeof count === 'number') || count === null)) { + return javaemul.internal.CharacterHelper.codePointCount$char_A$int$int(a, offset, count); + } + else if (((a != null && (a["__interfaces"] != null && a["__interfaces"].indexOf("java.lang.CharSequence") >= 0 || a.constructor != null && a.constructor["__interfaces"] != null && a.constructor["__interfaces"].indexOf("java.lang.CharSequence") >= 0 || typeof a === "string")) || a === null) && ((typeof offset === 'number') || offset === null) && ((typeof count === 'number') || count === null)) { + return javaemul.internal.CharacterHelper.codePointCount$java_lang_CharSequence$int$int(a, offset, count); + } + else + throw new Error('invalid overload'); + }; + CharacterHelper.codePointCount$java_lang_CharSequence$int$int = function (seq, beginIndex, endIndex) { + var count = 0; + for (var idx = beginIndex; idx < endIndex;) { + { + var ch = seq.charAt(idx++); + if (CharacterHelper.isHighSurrogate(ch) && idx < endIndex && (CharacterHelper.isLowSurrogate(seq.charAt(idx)))) { + ++idx; + } + ++count; + } + ; + } + return count; + }; + CharacterHelper.compare = function (x, y) { + return (function (c) { return c.charCodeAt == null ? c : c.charCodeAt(0); })(x) - (function (c) { return c.charCodeAt == null ? c : c.charCodeAt(0); })(y); + }; + CharacterHelper.digit = function (c, radix) { + if (radix < CharacterHelper.MIN_RADIX || radix > CharacterHelper.MAX_RADIX) { + return -1; + } + if ((function (c) { return c.charCodeAt == null ? c : c.charCodeAt(0); })(c) >= '0'.charCodeAt(0) && (function (c) { return c.charCodeAt == null ? c : c.charCodeAt(0); })(c) < '0'.charCodeAt(0) + Math.min(radix, 10)) { + return (function (c) { return c.charCodeAt == null ? c : c.charCodeAt(0); })(c) - '0'.charCodeAt(0); + } + if ((function (c) { return c.charCodeAt == null ? c : c.charCodeAt(0); })(c) >= 'a'.charCodeAt(0) && (function (c) { return c.charCodeAt == null ? c : c.charCodeAt(0); })(c) < (radix + 'a'.charCodeAt(0) - 10)) { + return (function (c) { return c.charCodeAt == null ? c : c.charCodeAt(0); })(c) - 'a'.charCodeAt(0) + 10; + } + if ((function (c) { return c.charCodeAt == null ? c : c.charCodeAt(0); })(c) >= 'A'.charCodeAt(0) && (function (c) { return c.charCodeAt == null ? c : c.charCodeAt(0); })(c) < (radix + 'A'.charCodeAt(0) - 10)) { + return (function (c) { return c.charCodeAt == null ? c : c.charCodeAt(0); })(c) - 'A'.charCodeAt(0) + 10; + } + return -1; + }; + CharacterHelper.getNumericValue = function (ch) { + return (ch.charCodeAt(0) | 0); + }; + CharacterHelper.forDigit$int$int = function (digit, radix) { + if (radix < CharacterHelper.MIN_RADIX || radix > CharacterHelper.MAX_RADIX) { + return String.fromCharCode(0); + } + if (digit < 0 || digit >= radix) { + return String.fromCharCode(0); + } + return CharacterHelper.forDigit$int(digit); + }; + CharacterHelper.forDigit = function (digit, radix) { + if (((typeof digit === 'number') || digit === null) && ((typeof radix === 'number') || radix === null)) { + return javaemul.internal.CharacterHelper.forDigit$int$int(digit, radix); + } + else if (((typeof digit === 'number') || digit === null) && radix === undefined) { + return javaemul.internal.CharacterHelper.forDigit$int(digit); + } + else + throw new Error('invalid overload'); + }; + /** + * @skip + * + * public for shared implementation with Arrays.hashCode + * @param {string} c + * @return {number} + */ + CharacterHelper.hashCode = function (c) { + return (c).charCodeAt(0); + }; + CharacterHelper.isDigit = function (c) { + var result = ( /* valueOf */new String(c).toString()).match(CharacterHelper.digitRegex()); + return result != null && result.length > 0; + }; + CharacterHelper.digitRegex = function () { + return new RegExp("\\d"); + }; + CharacterHelper.isHighSurrogate = function (ch) { + return (function (c) { return c.charCodeAt == null ? c : c.charCodeAt(0); })(ch) >= (function (c) { return c.charCodeAt == null ? c : c.charCodeAt(0); })(CharacterHelper.MIN_HIGH_SURROGATE) && (function (c) { return c.charCodeAt == null ? c : c.charCodeAt(0); })(ch) <= (function (c) { return c.charCodeAt == null ? c : c.charCodeAt(0); })(CharacterHelper.MAX_HIGH_SURROGATE); + }; + CharacterHelper.isLetter = function (c) { + return ( /* valueOf */new String(c).toString()).match(CharacterHelper.leterRegex()).length > 0; + }; + CharacterHelper.leterRegex = function () { + return new RegExp("[A-Z]", "i"); + }; + CharacterHelper.isLetterOrDigit = function (c) { + var array = ( /* valueOf */new String(c).toString()).match(CharacterHelper.leterOrDigitRegex()); + if (array != null) + return ( /* valueOf */new String(c).toString()).match(CharacterHelper.leterOrDigitRegex()).length > 0; + return false; + }; + CharacterHelper.leterOrDigitRegex = function () { + return new RegExp("[A-Z\\d]", "i"); + }; + CharacterHelper.isLowerCase = function (c) { + return (function (c) { return c.charCodeAt == null ? c : c.charCodeAt(0); })(CharacterHelper.toLowerCase$char(c)) == (function (c) { return c.charCodeAt == null ? c : c.charCodeAt(0); })(c) && CharacterHelper.isLetter(c); + }; + CharacterHelper.isLowSurrogate = function (ch) { + return (function (c) { return c.charCodeAt == null ? c : c.charCodeAt(0); })(ch) >= (function (c) { return c.charCodeAt == null ? c : c.charCodeAt(0); })(CharacterHelper.MIN_LOW_SURROGATE) && (function (c) { return c.charCodeAt == null ? c : c.charCodeAt(0); })(ch) <= (function (c) { return c.charCodeAt == null ? c : c.charCodeAt(0); })(CharacterHelper.MAX_LOW_SURROGATE); + }; + /** + * Deprecated - see isWhitespace(char). + * @param {string} c + * @return {boolean} + */ + CharacterHelper.isSpace = function (c) { + switch ((c).charCodeAt(0)) { + case 32 /* ' ' */: + return true; + case 10 /* '\n' */: + return true; + case 9 /* '\t' */: + return true; + case 12 /* '\f' */: + return true; + case 13 /* '\r' */: + return true; + default: + return false; + } + }; + CharacterHelper.isWhitespace$char = function (ch) { + return ( /* valueOf */new String(ch).toString()).match(CharacterHelper.whitespaceRegex()).length > 0; + }; + CharacterHelper.isWhitespace = function (ch) { + if (((typeof ch === 'string') || ch === null)) { + return javaemul.internal.CharacterHelper.isWhitespace$char(ch); + } + else if (((typeof ch === 'number') || ch === null)) { + return javaemul.internal.CharacterHelper.isWhitespace$int(ch); + } + else + throw new Error('invalid overload'); + }; + CharacterHelper.isWhitespace$int = function (codePoint) { + return String.fromCharCode(codePoint).match(CharacterHelper.whitespaceRegex()).length > 0; + }; + CharacterHelper.whitespaceRegex = function () { + return new RegExp("[\\t-\\r \\u1680\\u180E\\u2000-\\u2006\\u2008-\\u200A\\u2028\\u2029\\u205F\\u3000\\uFEFF]|[\\x1C-\\x1F]"); + }; + CharacterHelper.isSupplementaryCodePoint = function (codePoint) { + return codePoint >= CharacterHelper.MIN_SUPPLEMENTARY_CODE_POINT && codePoint <= CharacterHelper.MAX_CODE_POINT; + }; + CharacterHelper.isSurrogatePair = function (highSurrogate, lowSurrogate) { + return CharacterHelper.isHighSurrogate(highSurrogate) && CharacterHelper.isLowSurrogate(lowSurrogate); + }; + CharacterHelper.isUpperCase = function (c) { + return (function (c) { return c.charCodeAt == null ? c : c.charCodeAt(0); })(CharacterHelper.toUpperCase$char(c)) == (function (c) { return c.charCodeAt == null ? c : c.charCodeAt(0); })(c) && CharacterHelper.isLetter(c); + }; + CharacterHelper.isValidCodePoint = function (codePoint) { + return codePoint >= CharacterHelper.MIN_CODE_POINT && codePoint <= CharacterHelper.MAX_CODE_POINT; + }; + CharacterHelper.offsetByCodePoints$char_A$int$int$int$int = function (a, start, count, index, codePointOffset) { + return CharacterHelper.offsetByCodePoints$java_lang_CharSequence$int$int((function (str, index, len) { return str.substring(index, index + len); })((a).join(''), start, count), index, codePointOffset); + }; + CharacterHelper.offsetByCodePoints = function (a, start, count, index, codePointOffset) { + if (((a != null && a instanceof Array && (a.length == 0 || a[0] == null || (typeof a[0] === 'string'))) || a === null) && ((typeof start === 'number') || start === null) && ((typeof count === 'number') || count === null) && ((typeof index === 'number') || index === null) && ((typeof codePointOffset === 'number') || codePointOffset === null)) { + return javaemul.internal.CharacterHelper.offsetByCodePoints$char_A$int$int$int$int(a, start, count, index, codePointOffset); + } + else if (((a != null && (a["__interfaces"] != null && a["__interfaces"].indexOf("java.lang.CharSequence") >= 0 || a.constructor != null && a.constructor["__interfaces"] != null && a.constructor["__interfaces"].indexOf("java.lang.CharSequence") >= 0 || typeof a === "string")) || a === null) && ((typeof start === 'number') || start === null) && ((typeof count === 'number') || count === null) && index === undefined && codePointOffset === undefined) { + return javaemul.internal.CharacterHelper.offsetByCodePoints$java_lang_CharSequence$int$int(a, start, count); + } + else + throw new Error('invalid overload'); + }; + CharacterHelper.offsetByCodePoints$java_lang_CharSequence$int$int = function (seq, index, codePointOffset) { + if (codePointOffset < 0) { + while ((codePointOffset < 0)) { + { + --index; + if (CharacterHelper.isLowSurrogate(seq.charAt(index)) && CharacterHelper.isHighSurrogate(seq.charAt(index - 1))) { + --index; + } + ++codePointOffset; + } + } + ; + } + else { + while ((codePointOffset > 0)) { + { + if (CharacterHelper.isHighSurrogate(seq.charAt(index)) && CharacterHelper.isLowSurrogate(seq.charAt(index + 1))) { + ++index; + } + ++index; + --codePointOffset; + } + } + ; + } + return index; + }; + CharacterHelper.toChars$int = function (codePoint) { + javaemul.internal.InternalPreconditions.checkCriticalArgument(codePoint >= 0 && codePoint <= CharacterHelper.MAX_CODE_POINT, "CodePoint %s not in range [%s, %s]", /* toString */ ('' + (codePoint)), "0", /* toString */ ('' + (CharacterHelper.MAX_CODE_POINT))); + if (codePoint >= CharacterHelper.MIN_SUPPLEMENTARY_CODE_POINT) { + return [CharacterHelper.getHighSurrogate(codePoint), CharacterHelper.getLowSurrogate(codePoint)]; + } + else { + return [String.fromCharCode(codePoint)]; + } + }; + CharacterHelper.toChars$int$char_A$int = function (codePoint, dst, dstIndex) { + javaemul.internal.InternalPreconditions.checkCriticalArgument(codePoint >= 0 && codePoint <= CharacterHelper.MAX_CODE_POINT, "CodePoint %s not in range [%s, %s]", /* toString */ ('' + (codePoint)), "0", /* toString */ ('' + (CharacterHelper.MAX_CODE_POINT))); + if (codePoint >= CharacterHelper.MIN_SUPPLEMENTARY_CODE_POINT) { + dst[dstIndex++] = CharacterHelper.getHighSurrogate(codePoint); + dst[dstIndex] = CharacterHelper.getLowSurrogate(codePoint); + return 2; + } + else { + dst[dstIndex] = String.fromCharCode(codePoint); + return 1; + } + }; + CharacterHelper.toChars = function (codePoint, dst, dstIndex) { + if (((typeof codePoint === 'number') || codePoint === null) && ((dst != null && dst instanceof Array && (dst.length == 0 || dst[0] == null || (typeof dst[0] === 'string'))) || dst === null) && ((typeof dstIndex === 'number') || dstIndex === null)) { + return javaemul.internal.CharacterHelper.toChars$int$char_A$int(codePoint, dst, dstIndex); + } + else if (((typeof codePoint === 'number') || codePoint === null) && dst === undefined && dstIndex === undefined) { + return javaemul.internal.CharacterHelper.toChars$int(codePoint); + } + else + throw new Error('invalid overload'); + }; + CharacterHelper.toCodePoint = function (highSurrogate, lowSurrogate) { + return CharacterHelper.MIN_SUPPLEMENTARY_CODE_POINT + (((function (c) { return c.charCodeAt == null ? c : c.charCodeAt(0); })(highSurrogate) & 1023) << 10) + ((function (c) { return c.charCodeAt == null ? c : c.charCodeAt(0); })(lowSurrogate) & 1023); + }; + CharacterHelper.toLowerCase$char = function (c) { + return /* valueOf */ new String(c).toString().toLowerCase().charAt(0); + }; + CharacterHelper.toLowerCase = function (c) { + if (((typeof c === 'string') || c === null)) { + return javaemul.internal.CharacterHelper.toLowerCase$char(c); + } + else if (((typeof c === 'number') || c === null)) { + return javaemul.internal.CharacterHelper.toLowerCase$int(c); + } + else + throw new Error('invalid overload'); + }; + CharacterHelper.toLowerCase$int = function (c) { + return ( /* valueOf */new String(String.fromCharCode(c)).toString().toLowerCase().charAt(0)).charCodeAt(0); + }; + CharacterHelper.toString = function (x) { + return /* valueOf */ new String(x).toString(); + }; + CharacterHelper.toUpperCase$char = function (c) { + return /* valueOf */ new String(c).toString().toUpperCase().charAt(0); + }; + CharacterHelper.toUpperCase = function (c) { + if (((typeof c === 'string') || c === null)) { + return javaemul.internal.CharacterHelper.toUpperCase$char(c); + } + else if (((typeof c === 'number') || c === null)) { + return javaemul.internal.CharacterHelper.toUpperCase$int(c); + } + else + throw new Error('invalid overload'); + }; + CharacterHelper.toUpperCase$int = function (c) { + return /* valueOf */ new String(String.fromCharCode(c)).toString().toUpperCase().charAt(0); + }; + CharacterHelper.valueOf = function (c) { + if ((function (c) { return c.charCodeAt == null ? c : c.charCodeAt(0); })(c) < 128) { + var result = CharacterHelper.BoxedValues.boxedValues_$LI$()[(c).charCodeAt(0)]; + if ((function (c) { return c.charCodeAt == null ? c : c.charCodeAt(0); })(result) == null) { + result = CharacterHelper.BoxedValues.boxedValues_$LI$()[(c).charCodeAt(0)] = new String(c); + } + return result; + } + return new String(c); + }; + CharacterHelper.codePointAt$java_lang_CharSequence$int$int = function (cs, index, limit) { + var hiSurrogate = cs.charAt(index++); + var loSurrogate; + if (CharacterHelper.isHighSurrogate(hiSurrogate) && index < limit && CharacterHelper.isLowSurrogate(loSurrogate = cs.charAt(index))) { + return CharacterHelper.toCodePoint(hiSurrogate, loSurrogate); + } + return (hiSurrogate).charCodeAt(0); + }; + CharacterHelper.codePointBefore$java_lang_CharSequence$int$int = function (cs, index, start) { + var loSurrogate = cs.charAt(--index); + var highSurrogate; + if (CharacterHelper.isLowSurrogate(loSurrogate) && index > start && CharacterHelper.isHighSurrogate(highSurrogate = cs.charAt(index - 1))) { + return CharacterHelper.toCodePoint(highSurrogate, loSurrogate); + } + return (loSurrogate).charCodeAt(0); + }; + CharacterHelper.forDigit$int = function (digit) { + var overBaseTen = digit - 10; + return String.fromCharCode((overBaseTen < 0 ? '0'.charCodeAt(0) + digit : 'a'.charCodeAt(0) + overBaseTen)); + }; + /** + * Computes the high surrogate character of the UTF16 representation of a + * non-BMP code point. See {@link getLowSurrogate}. + * + * @param {number} codePoint + * requested codePoint, required to be >= + * MIN_SUPPLEMENTARY_CODE_POINT + * @return {string} high surrogate character + */ + CharacterHelper.getHighSurrogate = function (codePoint) { + return String.fromCharCode(((function (c) { return c.charCodeAt == null ? c : c.charCodeAt(0); })(CharacterHelper.MIN_HIGH_SURROGATE) + (((codePoint - CharacterHelper.MIN_SUPPLEMENTARY_CODE_POINT) >> 10) & 1023))); + }; + /** + * Computes the low surrogate character of the UTF16 representation of a non-BMP + * code point. See {@link getHighSurrogate}. + * + * @param {number} codePoint + * requested codePoint, required to be >= + * MIN_SUPPLEMENTARY_CODE_POINT + * @return {string} low surrogate character + */ + CharacterHelper.getLowSurrogate = function (codePoint) { + return String.fromCharCode(((function (c) { return c.charCodeAt == null ? c : c.charCodeAt(0); })(CharacterHelper.MIN_LOW_SURROGATE) + ((codePoint - CharacterHelper.MIN_SUPPLEMENTARY_CODE_POINT) & 1023))); + }; + CharacterHelper.prototype.charValue = function () { + return this.value; + }; + CharacterHelper.prototype.compareTo$javaemul_internal_CharacterHelper = function (c) { + return CharacterHelper.compare(this.value, c.value); + }; + /** + * + * @param {javaemul.internal.CharacterHelper} c + * @return {number} + */ + CharacterHelper.prototype.compareTo = function (c) { + if (((c != null && c instanceof javaemul.internal.CharacterHelper) || c === null)) { + return this.compareTo$javaemul_internal_CharacterHelper(c); + } + else + throw new Error('invalid overload'); + }; + /** + * + * @param {*} o + * @return {boolean} + */ + CharacterHelper.prototype.equals = function (o) { + return (o != null && o instanceof javaemul.internal.CharacterHelper) && ((function (c) { return c.charCodeAt == null ? c : c.charCodeAt(0); })(o.value) == (function (c) { return c.charCodeAt == null ? c : c.charCodeAt(0); })(this.value)); + }; + /** + * + * @return {number} + */ + CharacterHelper.prototype.hashCode = function () { + return CharacterHelper.hashCode(this.value); + }; + /** + * + * @return {string} + */ + CharacterHelper.prototype.toString = function () { + return /* valueOf */ new String(this.value).toString(); + }; + CharacterHelper.MIN_RADIX = 2; + CharacterHelper.MAX_RADIX = 36; + CharacterHelper.MIN_VALUE = '\u0000'; + CharacterHelper.MAX_VALUE = '\uffff'; + CharacterHelper.MIN_SURROGATE = '\ud800'; + CharacterHelper.MAX_SURROGATE = '\udfff'; + CharacterHelper.MIN_LOW_SURROGATE = '\udc00'; + CharacterHelper.MAX_LOW_SURROGATE = '\udfff'; + CharacterHelper.MIN_HIGH_SURROGATE = '\ud800'; + CharacterHelper.MAX_HIGH_SURROGATE = '\udbff'; + CharacterHelper.MIN_SUPPLEMENTARY_CODE_POINT = 65536; + CharacterHelper.MIN_CODE_POINT = 0; + CharacterHelper.MAX_CODE_POINT = 1114111; + CharacterHelper.SIZE = 16; + return CharacterHelper; + }()); + internal.CharacterHelper = CharacterHelper; + CharacterHelper["__class"] = "javaemul.internal.CharacterHelper"; + CharacterHelper["__interfaces"] = ["java.lang.Comparable", "java.io.Serializable"]; + (function (CharacterHelper) { + /** + * Use nested class to avoid clinit on outer. + * @class + */ + var BoxedValues = /** @class */ (function () { + function BoxedValues() { + } + BoxedValues.boxedValues_$LI$ = function () { if (BoxedValues.boxedValues == null) { + BoxedValues.boxedValues = (function (s) { var a = []; while (s-- > 0) + a.push(null); return a; })(128); + } return BoxedValues.boxedValues; }; + ; + return BoxedValues; + }()); + CharacterHelper.BoxedValues = BoxedValues; + BoxedValues["__class"] = "javaemul.internal.CharacterHelper.BoxedValues"; + })(CharacterHelper = internal.CharacterHelper || (internal.CharacterHelper = {})); + })(internal = javaemul.internal || (javaemul.internal = {})); +})(javaemul || (javaemul = {})); +(function (javaemul) { + var internal; + (function (internal) { + /** + * Simple Helper class to return Date.now. + * @class + */ + var DateUtil = /** @class */ (function () { + function DateUtil() { + } + /** + * Returns the numeric value corresponding to the current time - the number + * of milliseconds elapsed since 1 January 1970 00:00:00 UTC. + * @return {number} + */ + DateUtil.now = function () { + if (Date.now) { + return Date.now(); + } + ; + return ((new Date()).getTime()); + }; + return DateUtil; + }()); + internal.DateUtil = DateUtil; + DateUtil["__class"] = "javaemul.internal.DateUtil"; + })(internal = javaemul.internal || (javaemul.internal = {})); +})(javaemul || (javaemul = {})); +(function (javaemul) { + var internal; + (function (internal) { + /** + * Provides utilities to perform operations on Arrays. + * @class + */ + var ArrayHelper = /** @class */ (function () { + function ArrayHelper() { + } + ArrayHelper.clone = function (array, fromIndex, toIndex) { + var result = ArrayHelper.unsafeClone(array, fromIndex, toIndex); + return javaemul.internal.ArrayStamper.stampJavaTypeInfo(result, array); + }; + /** + * Unlike clone, this method returns a copy of the array that is not type + * marked. This is only safe for temp arrays as returned array will not do + * any type checks. + * @param {*} array + * @param {number} fromIndex + * @param {number} toIndex + * @return {Array} + */ + ArrayHelper.unsafeClone = function (array, fromIndex, toIndex) { + return array.slice(fromIndex, toIndex); + }; + ArrayHelper.createFrom = function (array, length) { + var result = ArrayHelper.createNativeArray(length); + return javaemul.internal.ArrayStamper.stampJavaTypeInfo(result, array); + }; + /*private*/ ArrayHelper.createNativeArray = function (length) { + return (new Array(length)); + }; + ArrayHelper.getLength = function (array) { + return (array.length | 0); + }; + ArrayHelper.setLength = function (array, length) { + array.length = length; + }; + ArrayHelper.removeFrom = function (array, index, deleteCount) { + array.splice(index, deleteCount); + }; + ArrayHelper.insertTo$java_lang_Object$int$java_lang_Object = function (array, index, value) { + array.splice(index, 0, value); + }; + ArrayHelper.insertTo$java_lang_Object$int$java_lang_Object_A = function (array, index, values) { + ArrayHelper.copy$java_lang_Object$int$java_lang_Object$int$int$boolean(values, 0, array, index, values.length, false); + }; + ArrayHelper.insertTo = function (array, index, values) { + if (((array != null) || array === null) && ((typeof index === 'number') || index === null) && ((values != null && values instanceof Array && (values.length == 0 || values[0] == null || (values[0] != null))) || values === null)) { + return javaemul.internal.ArrayHelper.insertTo$java_lang_Object$int$java_lang_Object_A(array, index, values); + } + else if (((array != null) || array === null) && ((typeof index === 'number') || index === null) && ((values != null) || values === null)) { + return javaemul.internal.ArrayHelper.insertTo$java_lang_Object$int$java_lang_Object(array, index, values); + } + else + throw new Error('invalid overload'); + }; + /** + * This version of insertTo is specified only for arrays. + * Same implementation (and arguments) as "public static void insertTo(Object array, int index, Object[] values)" + * @param {*} array + * @param {number} index + * @param {Array} values + */ + ArrayHelper.insertValuesToArray = function (array, index, values) { + ArrayHelper.copy$java_lang_Object$int$java_lang_Object$int$int$boolean(values, 0, array, index, values.length, false); + }; + ArrayHelper.copy$java_lang_Object$int$java_lang_Object$int$int = function (array, srcOfs, dest, destOfs, len) { + ArrayHelper.copy$java_lang_Object$int$java_lang_Object$int$int$boolean(array, srcOfs, dest, destOfs, len, true); + }; + ArrayHelper.copy$java_lang_Object$int$java_lang_Object$int$int$boolean = function (src, srcOfs, dest, destOfs, len, overwrite) { + if (src === dest) { + src = ArrayHelper.unsafeClone(src, srcOfs, srcOfs + len); + srcOfs = 0; + } + for (var batchStart = srcOfs, end = srcOfs + len; batchStart < end;) { + { + var batchEnd = Math.min(batchStart + ArrayHelper.ARRAY_PROCESS_BATCH_SIZE, end); + len = batchEnd - batchStart; + ArrayHelper.applySplice(dest, destOfs, overwrite ? len : 0, ArrayHelper.unsafeClone(src, batchStart, batchEnd)); + batchStart = batchEnd; + destOfs += len; + } + ; + } + }; + ArrayHelper.copy = function (src, srcOfs, dest, destOfs, len, overwrite) { + if (((src != null) || src === null) && ((typeof srcOfs === 'number') || srcOfs === null) && ((dest != null) || dest === null) && ((typeof destOfs === 'number') || destOfs === null) && ((typeof len === 'number') || len === null) && ((typeof overwrite === 'boolean') || overwrite === null)) { + return javaemul.internal.ArrayHelper.copy$java_lang_Object$int$java_lang_Object$int$int$boolean(src, srcOfs, dest, destOfs, len, overwrite); + } + else if (((src != null) || src === null) && ((typeof srcOfs === 'number') || srcOfs === null) && ((dest != null) || dest === null) && ((typeof destOfs === 'number') || destOfs === null) && ((typeof len === 'number') || len === null) && overwrite === undefined) { + return javaemul.internal.ArrayHelper.copy$java_lang_Object$int$java_lang_Object$int$int(src, srcOfs, dest, destOfs, len); + } + else + throw new Error('invalid overload'); + }; + /*private*/ ArrayHelper.applySplice = function (arrayObject, index, deleteCount, arrayToAdd) { + Array.prototype.splice.apply(arrayObject, [index, deleteCount].concat(arrayToAdd)); + }; + ArrayHelper.ARRAY_PROCESS_BATCH_SIZE = 10000; + return ArrayHelper; + }()); + internal.ArrayHelper = ArrayHelper; + ArrayHelper["__class"] = "javaemul.internal.ArrayHelper"; + })(internal = javaemul.internal || (javaemul.internal = {})); +})(javaemul || (javaemul = {})); +(function (javaemul) { + var internal; + (function (internal) { + /** + * Math utility methods and constants. + * @class + */ + var MathHelper = /** @class */ (function () { + function MathHelper() { + } + MathHelper.EPSILON_$LI$ = function () { if (MathHelper.EPSILON == null) { + MathHelper.EPSILON = MathHelper.pow(2, -52); + } return MathHelper.EPSILON; }; + ; + MathHelper.MAX_VALUE_$LI$ = function () { if (MathHelper.MAX_VALUE == null) { + MathHelper.MAX_VALUE = (2 - MathHelper.EPSILON_$LI$()) * MathHelper.pow(2, 1023); + } return MathHelper.MAX_VALUE; }; + ; + MathHelper.MIN_VALUE_$LI$ = function () { if (MathHelper.MIN_VALUE == null) { + MathHelper.MIN_VALUE = MathHelper.pow(2, -1022); + } return MathHelper.MIN_VALUE; }; + ; + MathHelper.nextDown = function (x) { + return -MathHelper.nextUp(-x); + }; + MathHelper.ulp = function (x) { + return x < 0 ? MathHelper.nextUp(x) - x : x - (-MathHelper.nextUp(-x)); + }; + MathHelper.nextUp = function (x) { + if (x !== x) { + return x; + } + if (x === (-1 / 0 | 0)) { + return -MathHelper.MAX_VALUE_$LI$(); + } + if (x === (+1 / 0 | 0)) { + return (+1 / 0 | 0); + } + if (x === +MathHelper.MAX_VALUE_$LI$()) { + return (+1 / 0 | 0); + } + var y = x * (x < 0 ? 1 - MathHelper.EPSILON_$LI$() / 2 : 1 + MathHelper.EPSILON_$LI$()); + if (y === x) { + y = MathHelper.MIN_VALUE_$LI$() * MathHelper.EPSILON_$LI$() > 0 ? x + MathHelper.MIN_VALUE_$LI$() * MathHelper.EPSILON_$LI$() : x + MathHelper.MIN_VALUE_$LI$(); + } + if (y === (+1 / 0 | 0)) { + y = +MathHelper.MAX_VALUE_$LI$(); + } + var b = x + (y - x) / 2; + if (x < b && b < y) { + y = b; + } + var c = (y + x) / 2; + if (x < c && c < y) { + y = c; + } + return y === 0 ? -0 : y; + }; + MathHelper.PI_OVER_180_$LI$ = function () { if (MathHelper.PI_OVER_180 == null) { + MathHelper.PI_OVER_180 = MathHelper.PI / 180.0; + } return MathHelper.PI_OVER_180; }; + ; + MathHelper.PI_UNDER_180_$LI$ = function () { if (MathHelper.PI_UNDER_180 == null) { + MathHelper.PI_UNDER_180 = 180.0 / MathHelper.PI; + } return MathHelper.PI_UNDER_180; }; + ; + MathHelper.abs$double = function (x) { + return x <= 0 ? 0.0 - x : x; + }; + MathHelper.abs$float = function (x) { + return MathHelper.abs$double(x); + }; + MathHelper.abs$int = function (x) { + return x < 0 ? -x : x; + }; + MathHelper.abs = function (x) { + if (((typeof x === 'number') || x === null)) { + return javaemul.internal.MathHelper.abs$int(x); + } + else if (((typeof x === 'number') || x === null)) { + return javaemul.internal.MathHelper.abs$long(x); + } + else if (((typeof x === 'number') || x === null)) { + return javaemul.internal.MathHelper.abs$float(x); + } + else if (((typeof x === 'number') || x === null)) { + return javaemul.internal.MathHelper.abs$double(x); + } + else + throw new Error('invalid overload'); + }; + MathHelper.abs$long = function (x) { + return x < 0 ? -x : x; + }; + MathHelper.acos = function (x) { + return Math.acos(x); + }; + MathHelper.asin = function (x) { + return Math.asin(x); + }; + MathHelper.atan = function (x) { + return Math.atan(x); + }; + MathHelper.atan2 = function (y, x) { + return Math.atan2(y, x); + }; + MathHelper.cbrt = function (x) { + return MathHelper.pow(x, 1.0 / 3.0); + }; + MathHelper.ceil = function (x) { + return Math.ceil(x); + }; + MathHelper.copySign$double$double = function (magnitude, sign) { + if (sign < 0) { + return (magnitude < 0) ? magnitude : -magnitude; + } + else { + return (magnitude > 0) ? magnitude : -magnitude; + } + }; + MathHelper.copySign$float$float = function (magnitude, sign) { + return (MathHelper.copySign$double$double(magnitude, sign)); + }; + MathHelper.copySign = function (magnitude, sign) { + if (((typeof magnitude === 'number') || magnitude === null) && ((typeof sign === 'number') || sign === null)) { + return javaemul.internal.MathHelper.copySign$float$float(magnitude, sign); + } + else if (((typeof magnitude === 'number') || magnitude === null) && ((typeof sign === 'number') || sign === null)) { + return javaemul.internal.MathHelper.copySign$double$double(magnitude, sign); + } + else + throw new Error('invalid overload'); + }; + MathHelper.cos = function (x) { + return Math.cos(x); + }; + MathHelper.cosh = function (x) { + return (MathHelper.exp(x) + MathHelper.exp(-x)) / 2.0; + }; + MathHelper.exp = function (x) { + return Math.exp(x); + }; + MathHelper.expm1 = function (d) { + if (d === 0.0 || /* isNaN */ isNaN(d)) { + return d; + } + else if (!(function (value) { return Number.NEGATIVE_INFINITY === value || Number.POSITIVE_INFINITY === value; })(d)) { + if (d < 0.0) { + return -1.0; + } + else { + return javaemul.internal.DoubleHelper.POSITIVE_INFINITY; + } + } + return MathHelper.exp(d) + 1.0; + }; + MathHelper.floor = function (x) { + return Math.floor(x); + }; + MathHelper.hypot = function (x, y) { + return MathHelper.sqrt(x * x + y * y); + }; + MathHelper.log = function (x) { + return Math.log(x); + }; + MathHelper.log10 = function (x) { + return Math.log(x) * Math.LOG10E; + }; + MathHelper.log1p = function (x) { + return MathHelper.log(x + 1.0); + }; + MathHelper.max$double$double = function (x, y) { + return Math.max(x, y); + }; + MathHelper.max$float$float = function (x, y) { + return Math.max(x, y); + }; + MathHelper.max$int$int = function (x, y) { + return x > y ? x : y; + }; + MathHelper.max = function (x, y) { + if (((typeof x === 'number') || x === null) && ((typeof y === 'number') || y === null)) { + return javaemul.internal.MathHelper.max$int$int(x, y); + } + else if (((typeof x === 'number') || x === null) && ((typeof y === 'number') || y === null)) { + return javaemul.internal.MathHelper.max$long$long(x, y); + } + else if (((typeof x === 'number') || x === null) && ((typeof y === 'number') || y === null)) { + return javaemul.internal.MathHelper.max$float$float(x, y); + } + else if (((typeof x === 'number') || x === null) && ((typeof y === 'number') || y === null)) { + return javaemul.internal.MathHelper.max$double$double(x, y); + } + else + throw new Error('invalid overload'); + }; + MathHelper.max$long$long = function (x, y) { + return x > y ? x : y; + }; + MathHelper.min$double$double = function (x, y) { + return Math.min(x, y); + }; + MathHelper.min$float$float = function (x, y) { + return Math.min(x, y); + }; + MathHelper.min$int$int = function (x, y) { + return x < y ? x : y; + }; + MathHelper.min = function (x, y) { + if (((typeof x === 'number') || x === null) && ((typeof y === 'number') || y === null)) { + return javaemul.internal.MathHelper.min$int$int(x, y); + } + else if (((typeof x === 'number') || x === null) && ((typeof y === 'number') || y === null)) { + return javaemul.internal.MathHelper.min$long$long(x, y); + } + else if (((typeof x === 'number') || x === null) && ((typeof y === 'number') || y === null)) { + return javaemul.internal.MathHelper.min$float$float(x, y); + } + else if (((typeof x === 'number') || x === null) && ((typeof y === 'number') || y === null)) { + return javaemul.internal.MathHelper.min$double$double(x, y); + } + else + throw new Error('invalid overload'); + }; + MathHelper.min$long$long = function (x, y) { + return x < y ? x : y; + }; + MathHelper.pow = function (x, exp) { + return Math.pow(x, exp); + }; + MathHelper.random = function () { + return Math.random(); + }; + MathHelper.rint = function (d) { + if ( /* isNaN */isNaN(d)) { + return d; + } + else if ( /* isInfinite */(function (value) { return Number.NEGATIVE_INFINITY === value || Number.POSITIVE_INFINITY === value; })(d)) { + return d; + } + else if (d === 0.0) { + return d; + } + else { + return MathHelper.round$double(d); + } + }; + MathHelper.round$double = function (x) { + return (function (n) { return n < 0 ? Math.ceil(n) : Math.floor(n); })(Math.round(x)); + }; + MathHelper.round$float = function (x) { + var roundedValue = Math.round(x); + return MathHelper.unsafeCastToInt(roundedValue); + }; + MathHelper.round = function (x) { + if (((typeof x === 'number') || x === null)) { + return javaemul.internal.MathHelper.round$float(x); + } + else if (((typeof x === 'number') || x === null)) { + return javaemul.internal.MathHelper.round$double(x); + } + else + throw new Error('invalid overload'); + }; + /*private*/ MathHelper.unsafeCastToInt = function (d) { + return (d); + }; + MathHelper.scalb$double$int = function (d, scaleFactor) { + if (scaleFactor >= 31 || scaleFactor <= -31) { + return d * MathHelper.pow(2, scaleFactor); + } + else if (scaleFactor > 0) { + return d * (1 << scaleFactor); + } + else if (scaleFactor === 0) { + return d; + } + else { + return d * 1.0 / (1 << -scaleFactor); + } + }; + MathHelper.scalb$float$int = function (f, scaleFactor) { + if (scaleFactor >= 31 || scaleFactor <= -31) { + return f * MathHelper.pow(2, scaleFactor); + } + else if (scaleFactor > 0) { + return f * (1 << scaleFactor); + } + else if (scaleFactor === 0) { + return f; + } + else { + return f * 1.0 / (1 << -scaleFactor); + } + }; + MathHelper.scalb = function (f, scaleFactor) { + if (((typeof f === 'number') || f === null) && ((typeof scaleFactor === 'number') || scaleFactor === null)) { + return javaemul.internal.MathHelper.scalb$float$int(f, scaleFactor); + } + else if (((typeof f === 'number') || f === null) && ((typeof scaleFactor === 'number') || scaleFactor === null)) { + return javaemul.internal.MathHelper.scalb$double$int(f, scaleFactor); + } + else + throw new Error('invalid overload'); + }; + MathHelper.signum$double = function (d) { + if (d > 0.0) { + return 1.0; + } + else if (d < 0.0) { + return -1.0; + } + else { + return 0.0; + } + }; + MathHelper.signum$float = function (f) { + if (f > 0.0) { + return 1.0; + } + else if (f < 0.0) { + return -1.0; + } + else { + return 0.0; + } + }; + MathHelper.signum = function (f) { + if (((typeof f === 'number') || f === null)) { + return javaemul.internal.MathHelper.signum$float(f); + } + else if (((typeof f === 'number') || f === null)) { + return javaemul.internal.MathHelper.signum$double(f); + } + else + throw new Error('invalid overload'); + }; + MathHelper.sin = function (x) { + return Math.sin(x); + }; + MathHelper.sinh = function (x) { + return (MathHelper.exp(x) - MathHelper.exp(-x)) / 2.0; + }; + MathHelper.sqrt = function (x) { + return Math.sqrt(x); + }; + MathHelper.tan = function (x) { + return Math.tan(x); + }; + MathHelper.tanh = function (x) { + if (x === javaemul.internal.JsUtils.getInfinity()) { + return 1.0; + } + else if (x === -javaemul.internal.JsUtils.getInfinity()) { + return -1.0; + } + var e2x = MathHelper.exp(2.0 * x); + return (e2x - 1) / (e2x + 1); + }; + MathHelper.toDegrees = function (x) { + return x * MathHelper.PI_UNDER_180_$LI$(); + }; + MathHelper.toRadians = function (x) { + return x * MathHelper.PI_OVER_180_$LI$(); + }; + MathHelper.IEEEremainder = function (f1, f2) { + var r = Math.abs(f1 % f2); + if ( /* isNaN */isNaN(r) || r === f2 || r <= Math.abs(f2) / 2.0) { + return r; + } + else { + return /* signum */ (function (f) { if (f > 0) { + return 1; + } + else if (f < 0) { + return -1; + } + else { + return 0; + } })(f1) * (r - f2); + } + }; + MathHelper.E = 2.718281828459045; + MathHelper.PI = 3.141592653589793; + return MathHelper; + }()); + internal.MathHelper = MathHelper; + MathHelper["__class"] = "javaemul.internal.MathHelper"; + })(internal = javaemul.internal || (javaemul.internal = {})); +})(javaemul || (javaemul = {})); +(function (javaemul) { + var internal; + (function (internal) { + /** + * A utility to provide array stamping. Provided as a separate class to simplify + * super-source. + * @class + */ + var ArrayStamper = /** @class */ (function () { + function ArrayStamper() { + } + ArrayStamper.stampJavaTypeInfo = function (array, referenceType) { + return array; + }; + return ArrayStamper; + }()); + internal.ArrayStamper = ArrayStamper; + ArrayStamper["__class"] = "javaemul.internal.ArrayStamper"; + })(internal = javaemul.internal || (javaemul.internal = {})); +})(javaemul || (javaemul = {})); +(function (javaemul) { + var internal; + (function (internal) { + /** + * Contains logics for calculating hash codes in JavaScript. + * @class + */ + var HashCodes = /** @class */ (function () { + function HashCodes() { + } + HashCodes.hashCodeForString = function (s) { + return javaemul.internal.StringHashCache.getHashCode(s); + }; + HashCodes.getIdentityHashCode = function (o) { + if (o == null) { + return 0; + } + return (typeof o === 'string') ? HashCodes.hashCodeForString(javaemul.internal.JsUtils.unsafeCastToString(o)) : HashCodes.getObjectIdentityHashCode(o); + }; + HashCodes.getObjectIdentityHashCode = function (o) { + if ((o)[HashCodes.HASH_CODE_PROPERTY] != null) { + return ((o)[HashCodes.HASH_CODE_PROPERTY]); + } + else { + return ((o)[HashCodes.HASH_CODE_PROPERTY] = HashCodes.getNextHashId()); + } + }; + /** + * Called from JSNI. Do not change this implementation without updating: + *
+ * The returned comparator is serializable if the specified comparator is also
+ * serializable.
+ *
+ * @param
+ * Each observer has its
+ * Implementation notes:
+ *
+ * A key's hashCode is the index in backingMap which should contain that key. Since several keys may
+ * have the same hash, each value in hashCodeMap is actually an array containing all entries whose
+ * keys share the same hash.
+ * @param {java.util.AbstractHashMap} host
+ * @class
+ */
+ var InternalHashCodeMap = /** @class */ (function () {
+ function InternalHashCodeMap(host) {
+ this.backingMap = java.util.InternalJsMapFactory.newJsMap();
+ if (this.host === undefined) {
+ this.host = null;
+ }
+ if (this.__size === undefined) {
+ this.__size = 0;
+ }
+ this.host = host;
+ }
+ /* Default method injected from java.lang.Iterable */
+ InternalHashCodeMap.prototype.forEach = function (action) {
+ javaemul.internal.InternalPreconditions.checkNotNull((action));
+ var _loop_1 = function (index123) {
+ var t = index123.next();
+ {
+ (function (target) { return (typeof target === 'function') ? target(t) : target.accept(t); })(action);
+ }
+ };
+ for (var index123 = this.iterator(); index123.hasNext();) {
+ _loop_1(index123);
+ }
+ };
+ InternalHashCodeMap.prototype.put = function (key, value) {
+ var hashCode = this.hash(key);
+ var chain = this.getChainOrEmpty(hashCode);
+ if (chain.length === 0) {
+ this.backingMap.set(hashCode, chain);
+ }
+ else {
+ var entry = this.findEntryInChain(key, chain);
+ if (entry != null) {
+ return entry.setValue(value);
+ }
+ }
+ chain[chain.length] = (new java.util.AbstractMap.SimpleEntry(key, value));
+ this.__size++;
+ java.util.ConcurrentModificationDetector.structureChanged(this.host);
+ return null;
+ };
+ InternalHashCodeMap.prototype.remove = function (key) {
+ var hashCode = this.hash(key);
+ var chain = this.getChainOrEmpty(hashCode);
+ for (var i = 0; i < chain.length; i++) {
+ {
+ var entry = chain[i];
+ if (this.host._equals(key, entry.getKey())) {
+ if (chain.length === 1) {
+ javaemul.internal.ArrayHelper.setLength(chain, 0);
+ this.backingMap["delete"](hashCode);
+ }
+ else {
+ javaemul.internal.ArrayHelper.removeFrom(chain, i, 1);
+ }
+ this.__size--;
+ java.util.ConcurrentModificationDetector.structureChanged(this.host);
+ return entry.getValue();
+ }
+ }
+ ;
+ }
+ return null;
+ };
+ InternalHashCodeMap.prototype.getEntry = function (key) {
+ return this.findEntryInChain(key, this.getChainOrEmpty(this.hash(key)));
+ };
+ /*private*/ InternalHashCodeMap.prototype.findEntryInChain = function (key, chain) {
+ for (var index124 = 0; index124 < chain.length; index124++) {
+ var entry = chain[index124];
+ {
+ if (this.host._equals(key, entry.getKey())) {
+ return entry;
+ }
+ }
+ }
+ return null;
+ };
+ InternalHashCodeMap.prototype.size = function () {
+ return this.__size;
+ };
+ /**
+ *
+ * @return {*}
+ */
+ InternalHashCodeMap.prototype.iterator = function () {
+ return new InternalHashCodeMap.InternalHashCodeMap$0(this);
+ };
+ /*private*/ InternalHashCodeMap.prototype.getChainOrEmpty = function (hashCode) {
+ var chain = this.unsafeCastToArray(this.backingMap.get(hashCode));
+ return chain == null ? this.newEntryChain() : chain;
+ };
+ /*private*/ InternalHashCodeMap.prototype.newEntryChain = function () {
+ return ([]);
+ };
+ /*private*/ InternalHashCodeMap.prototype.unsafeCastToArray = function (arr) {
+ return (arr);
+ };
+ /**
+ * Returns hash code of the key as calculated by {@link AbstractHashMap#getHashCode(Object)} but
+ * also handles null keys as well.
+ * @param {*} key
+ * @return {number}
+ * @private
+ */
+ /*private*/ InternalHashCodeMap.prototype.hash = function (key) {
+ return key == null ? 0 : this.host.getHashCode(key);
+ };
+ return InternalHashCodeMap;
+ }());
+ util.InternalHashCodeMap = InternalHashCodeMap;
+ InternalHashCodeMap["__class"] = "java.util.InternalHashCodeMap";
+ InternalHashCodeMap["__interfaces"] = ["java.lang.Iterable"];
+ (function (InternalHashCodeMap) {
+ var InternalHashCodeMap$0 = /** @class */ (function () {
+ function InternalHashCodeMap$0(__parent) {
+ this.__parent = __parent;
+ this.chains = this.__parent.backingMap.entries();
+ this.itemIndex = 0;
+ this.chain = this.__parent.newEntryChain();
+ this.lastEntry = null;
+ }
+ /* Default method injected from java.util.Iterator */
+ InternalHashCodeMap$0.prototype.forEachRemaining = function (consumer) {
+ var _this = this;
+ javaemul.internal.InternalPreconditions.checkNotNull((consumer));
+ while ((this.hasNext())) {
+ {
+ (function (target) { return (typeof target === 'function') ? target(_this.next()) : target.accept(_this.next()); })(consumer);
+ }
+ }
+ ;
+ };
+ /**
+ *
+ * @return {boolean}
+ */
+ InternalHashCodeMap$0.prototype.hasNext = function () {
+ if (this.itemIndex < this.chain.length) {
+ return true;
+ }
+ var current = this.chains.next();
+ if (!current.done) {
+ this.chain = this.__parent.unsafeCastToArray(current.value[1]);
+ this.itemIndex = 0;
+ return true;
+ }
+ return false;
+ };
+ /**
+ *
+ * @return {*}
+ */
+ InternalHashCodeMap$0.prototype.next = function () {
+ this.lastEntry = this.chain[this.itemIndex++];
+ return this.lastEntry;
+ };
+ /**
+ *
+ */
+ InternalHashCodeMap$0.prototype.remove = function () {
+ this.__parent.remove(this.lastEntry.getKey());
+ if (this.itemIndex !== 0) {
+ this.itemIndex--;
+ }
+ };
+ return InternalHashCodeMap$0;
+ }());
+ InternalHashCodeMap.InternalHashCodeMap$0 = InternalHashCodeMap$0;
+ InternalHashCodeMap$0["__interfaces"] = ["java.util.Iterator"];
+ })(InternalHashCodeMap = util.InternalHashCodeMap || (util.InternalHashCodeMap = {}));
+ })(util = java.util || (java.util = {}));
+})(java || (java = {}));
+(function (java) {
+ var util;
+ (function (util) {
+ var stream;
+ (function (stream) {
+ var IntStream;
+ (function (IntStream) {
+ function range(startInclusive, endExclusive) {
+ if (startInclusive >= endExclusive) {
+ return java.util.Collections.emptyList().stream();
+ }
+ else {
+ var result = (new java.util.ArrayList());
+ for (; startInclusive < endExclusive; ++startInclusive) {
+ {
+ result.add(startInclusive);
+ }
+ ;
+ }
+ return result.stream();
+ }
+ }
+ IntStream.range = range;
+ })(IntStream = stream.IntStream || (stream.IntStream = {}));
+ })(stream = util.stream || (util.stream = {}));
+ })(util = java.util || (java.util = {}));
+})(java || (java = {}));
+(function (java) {
+ var util;
+ (function (util) {
+ var stream;
+ (function (stream) {
+ var Collector;
+ (function (Collector) {
+ var Characteristics;
+ (function (Characteristics) {
+ /**
+ * Indicates that this collector is concurrent, meaning that
+ * the result container can support the accumulator function being
+ * called concurrently with the same result container from multiple
+ * threads.
+ *
+ * If a {@code CONCURRENT} collector is not also {@code UNORDERED},
+ * then it should only be evaluated concurrently if applied to an
+ * unordered data source.
+ */
+ Characteristics[Characteristics["CONCURRENT"] = 0] = "CONCURRENT";
+ /**
+ * Indicates that the collection operation does not commit to preserving
+ * the encounter order of input elements. (This might be true if the
+ * result container has no intrinsic order, such as a {@link Set}.)
+ */
+ Characteristics[Characteristics["UNORDERED"] = 1] = "UNORDERED";
+ /**
+ * Indicates that the finisher function is the identity function and
+ * can be elided. If set, it must be the case that an unchecked cast
+ * from A to R will succeed.
+ */
+ Characteristics[Characteristics["IDENTITY_FINISH"] = 2] = "IDENTITY_FINISH";
+ })(Characteristics = Collector.Characteristics || (Collector.Characteristics = {}));
+ })(Collector = stream.Collector || (stream.Collector = {}));
+ })(stream = util.stream || (util.stream = {}));
+ })(util = java.util || (java.util = {}));
+})(java || (java = {}));
+(function (java) {
+ var util;
+ (function (util) {
+ var stream;
+ (function (stream) {
+ var Stream;
+ (function (Stream) {
+ function of() {
+ var values = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ values[_i] = arguments[_i];
+ }
+ return java.util.Arrays.asList.apply(null, values).stream();
+ }
+ Stream.of = of;
+ })(Stream = stream.Stream || (stream.Stream = {}));
+ })(stream = util.stream || (util.stream = {}));
+ })(util = java.util || (java.util = {}));
+})(java || (java = {}));
+(function (java) {
+ var util;
+ (function (util) {
+ /**
+ * See
+ * the official Java API doc for details.
+ * @class
+ */
+ var OptionalInt = /** @class */ (function () {
+ function OptionalInt(value) {
+ if (((typeof value === 'number') || value === null)) {
+ var __args = arguments;
+ if (this.ref === undefined) {
+ this.ref = 0;
+ }
+ if (this.present === undefined) {
+ this.present = false;
+ }
+ this.ref = value;
+ this.present = true;
+ }
+ else if (value === undefined) {
+ var __args = arguments;
+ if (this.ref === undefined) {
+ this.ref = 0;
+ }
+ if (this.present === undefined) {
+ this.present = false;
+ }
+ this.ref = 0;
+ this.present = false;
+ }
+ else
+ throw new Error('invalid overload');
+ }
+ OptionalInt.empty = function () {
+ return OptionalInt.EMPTY_$LI$();
+ };
+ OptionalInt.of = function (value) {
+ return new OptionalInt(value);
+ };
+ OptionalInt.EMPTY_$LI$ = function () { if (OptionalInt.EMPTY == null) {
+ OptionalInt.EMPTY = new OptionalInt();
+ } return OptionalInt.EMPTY; };
+ ;
+ OptionalInt.prototype.isPresent = function () {
+ return this.present;
+ };
+ OptionalInt.prototype.getAsInt = function () {
+ javaemul.internal.InternalPreconditions.checkCriticalElement(this.present);
+ return this.ref;
+ };
+ OptionalInt.prototype.ifPresent = function (consumer) {
+ var _this = this;
+ if (this.present) {
+ (function (target) { return (typeof target === 'function') ? target(_this.ref) : target.accept(_this.ref); })(consumer);
+ }
+ };
+ OptionalInt.prototype.orElse = function (other) {
+ return this.present ? this.ref : other;
+ };
+ OptionalInt.prototype.orElseGet = function (other) {
+ return this.present ? this.ref : (function (target) { return (typeof target === 'function') ? target() : target.getAsInt(); })(other);
+ };
+ OptionalInt.prototype.orElseThrow = function (exceptionSupplier) {
+ if (this.present) {
+ return this.ref;
+ }
+ throw (function (target) { return (typeof target === 'function') ? target() : target.get(); })(exceptionSupplier);
+ };
+ /**
+ *
+ * @param {*} obj
+ * @return {boolean}
+ */
+ OptionalInt.prototype.equals = function (obj) {
+ if (obj === this) {
+ return true;
+ }
+ if (!(obj != null && obj instanceof java.util.OptionalInt)) {
+ return false;
+ }
+ var other = obj;
+ return this.present === other.present && /* compare */ (this.ref - other.ref) === 0;
+ };
+ /**
+ *
+ * @return {number}
+ */
+ OptionalInt.prototype.hashCode = function () {
+ return this.present ? javaemul.internal.IntegerHelper.hashCode(this.ref) : 0;
+ };
+ /**
+ *
+ * @return {string}
+ */
+ OptionalInt.prototype.toString = function () {
+ return this.present ? "OptionalInt.of(" + /* toString */ ('' + (this.ref)) + ")" : "OptionalInt.empty()";
+ };
+ return OptionalInt;
+ }());
+ util.OptionalInt = OptionalInt;
+ OptionalInt["__class"] = "java.util.OptionalInt";
+ })(util = java.util || (java.util = {}));
+})(java || (java = {}));
+(function (java) {
+ var util;
+ (function (util) {
+ /**
+ * See
+ * the official Java API doc for details.
+ * @class
+ */
+ var OptionalLong = /** @class */ (function () {
+ function OptionalLong(value) {
+ if (((typeof value === 'number') || value === null)) {
+ var __args = arguments;
+ if (this.ref === undefined) {
+ this.ref = 0;
+ }
+ if (this.present === undefined) {
+ this.present = false;
+ }
+ this.ref = value;
+ this.present = true;
+ }
+ else if (value === undefined) {
+ var __args = arguments;
+ if (this.ref === undefined) {
+ this.ref = 0;
+ }
+ if (this.present === undefined) {
+ this.present = false;
+ }
+ this.ref = 0;
+ this.present = false;
+ }
+ else
+ throw new Error('invalid overload');
+ }
+ OptionalLong.empty = function () {
+ return OptionalLong.EMPTY_$LI$();
+ };
+ OptionalLong.of = function (value) {
+ return new OptionalLong(value);
+ };
+ OptionalLong.EMPTY_$LI$ = function () { if (OptionalLong.EMPTY == null) {
+ OptionalLong.EMPTY = new OptionalLong();
+ } return OptionalLong.EMPTY; };
+ ;
+ OptionalLong.prototype.isPresent = function () {
+ return this.present;
+ };
+ OptionalLong.prototype.getAsLong = function () {
+ javaemul.internal.InternalPreconditions.checkCriticalElement(this.present);
+ return this.ref;
+ };
+ OptionalLong.prototype.ifPresent = function (consumer) {
+ var _this = this;
+ if (this.present) {
+ (function (target) { return (typeof target === 'function') ? target(_this.ref) : target.accept(_this.ref); })(consumer);
+ }
+ };
+ OptionalLong.prototype.orElse = function (other) {
+ return this.present ? this.ref : other;
+ };
+ OptionalLong.prototype.orElseGet = function (other) {
+ return this.present ? this.ref : (function (target) { return (typeof target === 'function') ? target() : target.getAsLong(); })(other);
+ };
+ OptionalLong.prototype.orElseThrow = function (exceptionSupplier) {
+ if (this.present) {
+ return this.ref;
+ }
+ throw (function (target) { return (typeof target === 'function') ? target() : target.get(); })(exceptionSupplier);
+ };
+ /**
+ *
+ * @param {*} obj
+ * @return {boolean}
+ */
+ OptionalLong.prototype.equals = function (obj) {
+ if (obj === this) {
+ return true;
+ }
+ if (!(obj != null && obj instanceof java.util.OptionalLong)) {
+ return false;
+ }
+ var other = obj;
+ return this.present === other.present && /* compare */ (this.ref - other.ref) === 0;
+ };
+ /**
+ *
+ * @return {number}
+ */
+ OptionalLong.prototype.hashCode = function () {
+ return this.present ? javaemul.internal.LongHelper.hashCode(this.ref) : 0;
+ };
+ /**
+ *
+ * @return {string}
+ */
+ OptionalLong.prototype.toString = function () {
+ return this.present ? "OptionalLong.of(" + /* toString */ ('' + (this.ref)) + ")" : "OptionalLong.empty()";
+ };
+ return OptionalLong;
+ }());
+ util.OptionalLong = OptionalLong;
+ OptionalLong["__class"] = "java.util.OptionalLong";
+ })(util = java.util || (java.util = {}));
+})(java || (java = {}));
+(function (java) {
+ var util;
+ (function (util) {
+ /**
+ * Available as a superclass of event objects.
+ * @param {*} source
+ * @class
+ */
+ var EventObject = /** @class */ (function () {
+ function EventObject(source) {
+ if (this.source === undefined) {
+ this.source = null;
+ }
+ this.source = source;
+ }
+ EventObject.prototype.getSource = function () {
+ return this.source;
+ };
+ return EventObject;
+ }());
+ util.EventObject = EventObject;
+ EventObject["__class"] = "java.util.EventObject";
+ })(util = java.util || (java.util = {}));
+})(java || (java = {}));
+(function (java) {
+ var util;
+ (function (util) {
+ var InternalJsMap;
+ (function (InternalJsMap) {
+ })(InternalJsMap = util.InternalJsMap || (util.InternalJsMap = {}));
+ })(util = java.util || (java.util = {}));
+})(java || (java = {}));
+(function (java) {
+ var util;
+ (function (util) {
+ /**
+ * Constructs a string tokenizer for the specified string. All
+ * characters in the
+ * If the
+ * Note that if delim is null, this constructor does
+ * not throw an exception. However, trying to invoke other methods on the
+ * resulting StringTokenizer may result in a
+ * NullPointerException.
+ *
+ * @param {string} str a string to be parsed.
+ * @param {string} delim the delimiters.
+ * @param {boolean} returnDelims flag indicating whether to return the delimiters
+ * as tokens.
+ * @exception NullPointerException if str is
+ * Note: Any changes to this class should put into account the assumption that
+ * was made in rest of the JRE emulation.
+ * @class
+ */
+ var Locale = /** @class */ (function () {
+ function Locale() {
+ }
+ Locale.ROOT_$LI$ = function () { if (Locale.ROOT == null) {
+ Locale.ROOT = new Locale.RootLocale();
+ } return Locale.ROOT; };
+ ;
+ Locale.ENGLISH_$LI$ = function () { if (Locale.ENGLISH == null) {
+ Locale.ENGLISH = new Locale.EnglishLocale();
+ } return Locale.ENGLISH; };
+ ;
+ Locale.US_$LI$ = function () { if (Locale.US == null) {
+ Locale.US = new Locale.USLocale();
+ } return Locale.US; };
+ ;
+ Locale.FRANCE_$LI$ = function () { if (Locale.FRANCE == null) {
+ Locale.FRANCE = new Locale.FrenchLocale();
+ } return Locale.FRANCE; };
+ ;
+ Locale.UK_$LI$ = function () { if (Locale.UK == null) {
+ Locale.UK = new Locale.UKLocale();
+ } return Locale.UK; };
+ ;
+ Locale.defaultLocale_$LI$ = function () { if (Locale.defaultLocale == null) {
+ Locale.defaultLocale = new Locale.DefaultLocale();
+ } return Locale.defaultLocale; };
+ ;
+ /**
+ * Returns an instance that represents the browser's default locale (not
+ * necessarily the one defined by 'gwt.locale').
+ * @return {java.util.Locale}
+ */
+ Locale.getDefault = function () {
+ return Locale.defaultLocale_$LI$();
+ };
+ return Locale;
+ }());
+ util.Locale = Locale;
+ Locale["__class"] = "java.util.Locale";
+ (function (Locale) {
+ var RootLocale = /** @class */ (function (_super) {
+ __extends(RootLocale, _super);
+ function RootLocale() {
+ return _super.call(this) || this;
+ }
+ /**
+ *
+ * @return {string}
+ */
+ RootLocale.prototype.toString = function () {
+ return "";
+ };
+ return RootLocale;
+ }(java.util.Locale));
+ Locale.RootLocale = RootLocale;
+ RootLocale["__class"] = "java.util.Locale.RootLocale";
+ var EnglishLocale = /** @class */ (function (_super) {
+ __extends(EnglishLocale, _super);
+ function EnglishLocale() {
+ return _super.call(this) || this;
+ }
+ /**
+ *
+ * @return {string}
+ */
+ EnglishLocale.prototype.toString = function () {
+ return "en";
+ };
+ return EnglishLocale;
+ }(java.util.Locale));
+ Locale.EnglishLocale = EnglishLocale;
+ EnglishLocale["__class"] = "java.util.Locale.EnglishLocale";
+ var FrenchLocale = /** @class */ (function (_super) {
+ __extends(FrenchLocale, _super);
+ function FrenchLocale() {
+ return _super.call(this) || this;
+ }
+ /**
+ *
+ * @return {string}
+ */
+ FrenchLocale.prototype.toString = function () {
+ return "fr";
+ };
+ return FrenchLocale;
+ }(java.util.Locale));
+ Locale.FrenchLocale = FrenchLocale;
+ FrenchLocale["__class"] = "java.util.Locale.FrenchLocale";
+ var USLocale = /** @class */ (function (_super) {
+ __extends(USLocale, _super);
+ function USLocale() {
+ return _super.call(this) || this;
+ }
+ /**
+ *
+ * @return {string}
+ */
+ USLocale.prototype.toString = function () {
+ return "en_US";
+ };
+ return USLocale;
+ }(java.util.Locale));
+ Locale.USLocale = USLocale;
+ USLocale["__class"] = "java.util.Locale.USLocale";
+ var UKLocale = /** @class */ (function (_super) {
+ __extends(UKLocale, _super);
+ function UKLocale() {
+ return _super.call(this) || this;
+ }
+ /**
+ *
+ * @return {string}
+ */
+ UKLocale.prototype.toString = function () {
+ return "en-gb";
+ };
+ return UKLocale;
+ }(java.util.Locale));
+ Locale.UKLocale = UKLocale;
+ UKLocale["__class"] = "java.util.Locale.UKLocale";
+ var DefaultLocale = /** @class */ (function (_super) {
+ __extends(DefaultLocale, _super);
+ function DefaultLocale() {
+ return _super.call(this) || this;
+ }
+ /**
+ *
+ * @return {string}
+ */
+ DefaultLocale.prototype.toString = function () {
+ return "fr";
+ };
+ return DefaultLocale;
+ }(java.util.Locale));
+ Locale.DefaultLocale = DefaultLocale;
+ DefaultLocale["__class"] = "java.util.Locale.DefaultLocale";
+ })(Locale = util.Locale || (util.Locale = {}));
+ })(util = java.util || (java.util = {}));
+})(java || (java = {}));
+(function (java) {
+ var util;
+ (function (util) {
+ var Comparators = /** @class */ (function () {
+ function Comparators() {
+ }
+ Comparators.NATURAL_$LI$ = function () { if (Comparators.NATURAL == null) {
+ Comparators.NATURAL = function (a, b) { return new Comparators.NaturalComparator().compare(a, b); };
+ } return Comparators.NATURAL; };
+ ;
+ /**
+ * Returns the natural Comparator.
+ *
+ * Example:
+ *
+ * Note that this method provides such a weak guarantee that it is not very useful in
+ * practice.
+ *
+ * Firstly, the guarantee is "without blocking for more input" rather than "without
+ * blocking": a read may still block waiting for I/O to complete — the guarantee is
+ * merely that it won't have to wait indefinitely for data to be written. The result of this
+ * method should not be used as a license to do I/O on a thread that shouldn't be blocked.
+ *
+ * Secondly, the result is a
+ * conservative estimate and may be significantly smaller than the actual number of bytes
+ * available. In particular, an implementation that always returns 0 would be correct.
+ * In general, callers should only use this method if they'd be satisfied with
+ * treating the result as a boolean yes or no answer to the question "is there definitely
+ * data ready?".
+ *
+ * Thirdly, the fact that a given number of bytes is "available" does not guarantee that a
+ * read or skip will actually read or skip that many bytes: they may read or skip fewer.
+ *
+ * It is particularly important to realize that you must not use this method to
+ * size a container and assume that you can read the entirety of the stream without needing
+ * to resize the container. Such callers should probably write everything they read to a
+ * {@link ByteArrayOutputStream} and convert that to a byte array. Alternatively, if you're
+ * reading from a file, {@link File#length} returns the current length of the file (though
+ * assuming the file's length can't change may be incorrect, reading a file is inherently
+ * racy).
+ *
+ * The default implementation of this method in {@code InputStream} always returns 0.
+ * Subclasses should override this method if they are able to indicate the number of bytes
+ * available.
+ *
+ * @return {number} the estimated number of bytes available
+ * @throws IOException if this stream is closed or an error occurs
+ */
+ InputStream.prototype.available = function () {
+ return 0;
+ };
+ /**
+ * Closes this stream. Concrete implementations of this class should free
+ * any resources during close. This implementation does nothing.
+ *
+ * @throws IOException
+ * if an error occurs while closing this stream.
+ */
+ InputStream.prototype.close = function () {
+ };
+ /**
+ * Sets a mark position in this InputStream. The parameter {@code readlimit}
+ * indicates how many bytes can be read before the mark is invalidated.
+ * Sending {@code reset()} will reposition the stream back to the marked
+ * position provided {@code readLimit} has not been surpassed.
+ *
+ * This default implementation does nothing and concrete subclasses must
+ * provide their own implementation.
+ *
+ * @param {number} readlimit
+ * the number of bytes that can be read from this stream before
+ * the mark is invalidated.
+ * @see #markSupported()
+ * @see #reset()
+ */
+ InputStream.prototype.mark = function (readlimit) {
+ };
+ /**
+ * Indicates whether this stream supports the {@code mark()} and
+ * {@code reset()} methods. The default implementation returns {@code false}.
+ *
+ * @return {boolean} always {@code false}.
+ * @see #mark(int)
+ * @see #reset()
+ */
+ InputStream.prototype.markSupported = function () {
+ return false;
+ };
+ InputStream.prototype.read$ = function () { throw new Error('cannot invoke abstract overloaded method... check your argument(s) type(s)'); };
+ InputStream.prototype.read$byte_A = function (buffer) {
+ javaemul.internal.InternalPreconditions.checkNotNull(buffer);
+ return this.read$byte_A$int$int(buffer, 0, buffer.length);
+ };
+ InputStream.prototype.read$byte_A$int$int = function (buffer, byteOffset, byteCount) {
+ java.io.IOUtils.checkOffsetAndCount$byte_A$int$int(buffer, byteOffset, byteCount);
+ for (var i = 0; i < byteCount; ++i) {
+ {
+ var c = void 0;
+ try {
+ if ((c = this.read$()) === -1) {
+ return i === 0 ? -1 : i;
+ }
+ }
+ catch (e) {
+ if (i !== 0) {
+ return i;
+ }
+ throw e;
+ }
+ ;
+ buffer[byteOffset + i] = (c | 0);
+ }
+ ;
+ }
+ return byteCount;
+ };
+ /**
+ * Reads up to {@code byteCount} bytes from this stream and stores them in
+ * the byte array {@code buffer} starting at {@code byteOffset}.
+ * Returns the number of bytes actually read or -1 if the end of the stream
+ * has been reached.
+ *
+ * @throws IndexOutOfBoundsException
+ * if {@code byteOffset < 0 || byteCount < 0 || byteOffset + byteCount > buffer.length}.
+ * @throws IOException
+ * if the stream is closed or another IOException occurs.
+ * @param {Array} buffer
+ * @param {number} byteOffset
+ * @param {number} byteCount
+ * @return {number}
+ */
+ InputStream.prototype.read = function (buffer, byteOffset, byteCount) {
+ if (((buffer != null && buffer instanceof Array && (buffer.length == 0 || buffer[0] == null || (typeof buffer[0] === 'number'))) || buffer === null) && ((typeof byteOffset === 'number') || byteOffset === null) && ((typeof byteCount === 'number') || byteCount === null)) {
+ return this.read$byte_A$int$int(buffer, byteOffset, byteCount);
+ }
+ else if (((buffer != null && buffer instanceof Array && (buffer.length == 0 || buffer[0] == null || (typeof buffer[0] === 'number'))) || buffer === null) && byteOffset === undefined && byteCount === undefined) {
+ return this.read$byte_A(buffer);
+ }
+ else if (buffer === undefined && byteOffset === undefined && byteCount === undefined) {
+ return this.read$();
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ /**
+ * Resets this stream to the last marked location. Throws an
+ * {@code IOException} if the number of bytes read since the mark has been
+ * set is greater than the limit provided to {@code mark}, or if no mark
+ * has been set.
+ *
+ * This implementation always throws an {@code IOException} and concrete
+ * subclasses should provide the proper implementation.
+ *
+ * @throws IOException
+ * if this stream is closed or another IOException occurs.
+ */
+ InputStream.prototype.reset = function () {
+ throw new java.io.IOException();
+ };
+ /**
+ * Skips at most {@code byteCount} bytes in this stream. The number of actual
+ * bytes skipped may be anywhere between 0 and {@code byteCount}. If
+ * {@code byteCount} is negative, this method does nothing and returns 0, but
+ * some subclasses may throw.
+ *
+ * Note the "at most" in the description of this method: this method may
+ * choose to skip fewer bytes than requested. Callers should always
+ * check the return value.
+ *
+ * This default implementation reads bytes into a temporary buffer. Concrete
+ * subclasses should provide their own implementation.
+ *
+ * @return {number} the number of bytes actually skipped.
+ * @throws IOException if this stream is closed or another IOException
+ * occurs.
+ * @param {number} byteCount
+ */
+ InputStream.prototype.skip = function (byteCount) {
+ if (byteCount <= 0) {
+ return 0;
+ }
+ var bSize = (Math.min(InputStream.MAX_SKIP_BUFFER_SIZE, byteCount) | 0);
+ var b = (function (s) { var a = []; while (s-- > 0)
+ a.push(0); return a; })(bSize);
+ var skipped = 0;
+ while ((skipped < byteCount)) {
+ {
+ var toRead = (Math.min(byteCount - skipped, b.length) | 0);
+ var readCount = this.read$byte_A$int$int(b, 0, toRead);
+ if (readCount === -1) {
+ break;
+ }
+ skipped += readCount;
+ if (readCount < toRead) {
+ break;
+ }
+ }
+ }
+ ;
+ return skipped;
+ };
+ /**
+ * Size of the temporary buffer used when skipping bytes with {@link skip(long)}.
+ */
+ InputStream.MAX_SKIP_BUFFER_SIZE = 4096;
+ return InputStream;
+ }());
+ io.InputStream = InputStream;
+ InputStream["__class"] = "java.io.InputStream";
+ InputStream["__interfaces"] = ["java.io.Closeable", "java.lang.AutoCloseable"];
+ })(io = java.io || (java.io = {}));
+})(java || (java = {}));
+(function (java) {
+ var io;
+ (function (io) {
+ /**
+ * JSweet implementation.
+ * @class
+ */
+ var Reader = /** @class */ (function () {
+ function Reader(lock) {
+ if (((lock != null) || lock === null)) {
+ var __args = arguments;
+ if (this.lock === undefined) {
+ this.lock = null;
+ }
+ this.skipBuffer = null;
+ if (lock == null) {
+ throw new java.lang.NullPointerException();
+ }
+ this.lock = lock;
+ }
+ else if (lock === undefined) {
+ var __args = arguments;
+ if (this.lock === undefined) {
+ this.lock = null;
+ }
+ this.skipBuffer = null;
+ this.lock = this;
+ }
+ else
+ throw new Error('invalid overload');
+ }
+ Reader.prototype.read$ = function () {
+ var cb = [null];
+ if (this.read$char_A$int$int(cb, 0, 1) === -1)
+ return -1;
+ else
+ return (cb[0]).charCodeAt(0);
+ };
+ Reader.prototype.read$char_A = function (cbuf) {
+ return this.read$char_A$int$int(cbuf, 0, cbuf.length);
+ };
+ Reader.prototype.read$char_A$int$int = function (cbuf, off, len) { throw new Error('cannot invoke abstract overloaded method... check your argument(s) type(s)'); };
+ Reader.prototype.read = function (cbuf, off, len) {
+ if (((cbuf != null && cbuf instanceof Array && (cbuf.length == 0 || cbuf[0] == null || (typeof cbuf[0] === 'string'))) || cbuf === null) && ((typeof off === 'number') || off === null) && ((typeof len === 'number') || len === null)) {
+ return this.read$char_A$int$int(cbuf, off, len);
+ }
+ else if (((cbuf != null && cbuf instanceof Array && (cbuf.length == 0 || cbuf[0] == null || (typeof cbuf[0] === 'string'))) || cbuf === null) && off === undefined && len === undefined) {
+ return this.read$char_A(cbuf);
+ }
+ else if (cbuf === undefined && off === undefined && len === undefined) {
+ return this.read$();
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ Reader.prototype.skip = function (n) {
+ if (n < 0)
+ throw new java.lang.IllegalArgumentException("skip value is negative");
+ var nn = (Math.min(n, Reader.maxSkipBufferSize) | 0);
+ if ((this.skipBuffer == null) || (this.skipBuffer.length < nn))
+ this.skipBuffer = (function (s) { var a = []; while (s-- > 0)
+ a.push(null); return a; })(nn);
+ var r = n;
+ while ((r > 0)) {
+ {
+ var nc = this.read$char_A$int$int(this.skipBuffer, 0, (Math.min(r, nn) | 0));
+ if (nc === -1)
+ break;
+ r -= nc;
+ }
+ }
+ ;
+ return n - r;
+ };
+ Reader.prototype.ready = function () {
+ return false;
+ };
+ Reader.prototype.markSupported = function () {
+ return false;
+ };
+ Reader.prototype.mark = function (readAheadLimit) {
+ throw new java.io.IOException("mark() not supported");
+ };
+ Reader.prototype.reset = function () {
+ throw new java.io.IOException("reset() not supported");
+ };
+ /**
+ * Maximum skip-buffer size
+ */
+ Reader.maxSkipBufferSize = 8192;
+ return Reader;
+ }());
+ io.Reader = Reader;
+ Reader["__class"] = "java.io.Reader";
+ Reader["__interfaces"] = ["java.io.Closeable", "java.lang.AutoCloseable"];
+ })(io = java.io || (java.io = {}));
+})(java || (java = {}));
+(function (java) {
+ var io;
+ (function (io) {
+ /**
+ * Default constructor.
+ * @class
+ */
+ var OutputStream = /** @class */ (function () {
+ function OutputStream() {
+ }
+ /**
+ * Closes this stream. Implementations of this method should free any
+ * resources used by the stream. This implementation does nothing.
+ *
+ * @throws IOException
+ * if an error occurs while closing this stream.
+ */
+ OutputStream.prototype.close = function () {
+ };
+ /**
+ * Flushes this stream. Implementations of this method should ensure that
+ * any buffered data is written out. This implementation does nothing.
+ *
+ * @throws IOException
+ * if an error occurs while flushing this stream.
+ */
+ OutputStream.prototype.flush = function () {
+ };
+ OutputStream.prototype.write$byte_A = function (buffer) {
+ javaemul.internal.InternalPreconditions.checkNotNull(buffer);
+ this.write$byte_A$int$int(buffer, 0, buffer.length);
+ };
+ OutputStream.prototype.write$byte_A$int$int = function (buffer, offset, count) {
+ java.io.IOUtils.checkOffsetAndCount$byte_A$int$int(buffer, offset, count);
+ for (var i = offset; i < offset + count; i++) {
+ {
+ this.write$int(buffer[i]);
+ }
+ ;
+ }
+ };
+ /**
+ * Writes {@code count} bytes from the byte array {@code buffer} starting at
+ * position {@code offset} to this stream.
+ *
+ * @param {Array} buffer
+ * the buffer to be written.
+ * @param {number} offset
+ * the start position in {@code buffer} from where to get bytes.
+ * @param {number} count
+ * the number of bytes from {@code buffer} to write to this
+ * stream.
+ * @throws IOException
+ * if an error occurs while writing to this stream.
+ * @throws IndexOutOfBoundsException
+ * if {@code offset < 0} or {@code count < 0}, or if
+ * {@code offset + count} is bigger than the length of
+ * {@code buffer}.
+ */
+ OutputStream.prototype.write = function (buffer, offset, count) {
+ if (((buffer != null && buffer instanceof Array && (buffer.length == 0 || buffer[0] == null || (typeof buffer[0] === 'number'))) || buffer === null) && ((typeof offset === 'number') || offset === null) && ((typeof count === 'number') || count === null)) {
+ return this.write$byte_A$int$int(buffer, offset, count);
+ }
+ else if (((buffer != null && buffer instanceof Array && (buffer.length == 0 || buffer[0] == null || (typeof buffer[0] === 'number'))) || buffer === null) && offset === undefined && count === undefined) {
+ return this.write$byte_A(buffer);
+ }
+ else if (((typeof buffer === 'number') || buffer === null) && offset === undefined && count === undefined) {
+ return this.write$int(buffer);
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ OutputStream.prototype.write$int = function (oneByte) { throw new Error('cannot invoke abstract overloaded method... check your argument(s) type(s)'); };
+ return OutputStream;
+ }());
+ io.OutputStream = OutputStream;
+ OutputStream["__class"] = "java.io.OutputStream";
+ OutputStream["__interfaces"] = ["java.io.Closeable", "java.lang.AutoCloseable", "java.io.Flushable"];
+ })(io = java.io || (java.io = {}));
+})(java || (java = {}));
+(function (java) {
+ var lang;
+ (function (lang) {
+ var ref;
+ (function (ref) {
+ /**
+ * This implements the reference API in a minimal way. In JavaScript, there is
+ * no control over the reference and the GC. So this implementation's only
+ * purpose is for compilation.
+ * @class
+ */
+ var Reference = /** @class */ (function () {
+ function Reference(referent) {
+ if (this.referent === undefined) {
+ this.referent = null;
+ }
+ this.referent = referent;
+ }
+ Reference.prototype.get = function () {
+ return this.referent;
+ };
+ Reference.prototype.clear = function () {
+ this.referent = null;
+ };
+ return Reference;
+ }());
+ ref.Reference = Reference;
+ Reference["__class"] = "java.lang.ref.Reference";
+ })(ref = lang.ref || (lang.ref = {}));
+ })(lang = java.lang || (java.lang = {}));
+})(java || (java = {}));
+(function (java) {
+ var lang;
+ (function (lang) {
+ /**
+ * Represents an error caused by an assertion failure.
+ * @param {string} message
+ * @param {java.lang.Throwable} cause
+ * @class
+ * @extends java.lang.Error
+ */
+ var AssertionError = /** @class */ (function (_super) {
+ __extends(AssertionError, _super);
+ function AssertionError(message, cause) {
+ var _this = this;
+ if (((typeof message === 'string') || message === null) && ((cause != null && cause instanceof Error) || cause === null)) {
+ var __args = arguments;
+ _this = _super.call(this, message) || this;
+ _this.message = message;
+ }
+ else if (((typeof message === 'string') || message === null) && cause === undefined) {
+ var __args = arguments;
+ _this = _super.call(this, message) || this;
+ _this.message = message;
+ }
+ else if (((typeof message === 'boolean') || message === null) && cause === undefined) {
+ var __args = arguments;
+ {
+ var __args_10 = arguments;
+ var message_1 = new String(__args_10[0]).toString();
+ _this = _super.call(this, message_1) || this;
+ _this.message = message_1;
+ }
+ }
+ else if (((typeof message === 'string') || message === null) && cause === undefined) {
+ var __args = arguments;
+ {
+ var __args_11 = arguments;
+ var message_2 = new String(__args_11[0]).toString();
+ _this = _super.call(this, message_2) || this;
+ _this.message = message_2;
+ }
+ }
+ else if (((typeof message === 'number') || message === null) && cause === undefined) {
+ var __args = arguments;
+ {
+ var __args_12 = arguments;
+ var message_3 = new String(__args_12[0]).toString();
+ _this = _super.call(this, message_3) || this;
+ _this.message = message_3;
+ }
+ }
+ else if (((typeof message === 'number') || message === null) && cause === undefined) {
+ var __args = arguments;
+ {
+ var __args_13 = arguments;
+ var message_4 = new String(__args_13[0]).toString();
+ _this = _super.call(this, message_4) || this;
+ _this.message = message_4;
+ }
+ }
+ else if (((typeof message === 'number') || message === null) && cause === undefined) {
+ var __args = arguments;
+ {
+ var __args_14 = arguments;
+ var message_5 = new String(__args_14[0]).toString();
+ _this = _super.call(this, message_5) || this;
+ _this.message = message_5;
+ }
+ }
+ else if (((typeof message === 'number') || message === null) && cause === undefined) {
+ var __args = arguments;
+ {
+ var __args_15 = arguments;
+ var message_6 = new String(__args_15[0]).toString();
+ _this = _super.call(this, message_6) || this;
+ _this.message = message_6;
+ }
+ }
+ else if (((message != null) || message === null) && cause === undefined) {
+ var __args = arguments;
+ _this = _super.call(this, /* valueOf */ new String(message).toString()) || this;
+ _this.message = /* valueOf */ new String(message).toString();
+ }
+ else if (message === undefined && cause === undefined) {
+ var __args = arguments;
+ _this = _super.call(this) || this;
+ }
+ else
+ throw new Error('invalid overload');
+ return _this;
+ }
+ return AssertionError;
+ }(Error));
+ lang.AssertionError = AssertionError;
+ AssertionError["__class"] = "java.lang.AssertionError";
+ AssertionError["__interfaces"] = ["java.io.Serializable"];
+ })(lang = java.lang || (java.lang = {}));
+})(java || (java = {}));
+(function (java) {
+ var lang;
+ (function (lang) {
+ /**
+ * Included for hosted mode source compatibility. Partially implemented
+ *
+ * @skip
+ * @param {string} className
+ * @param {string} methodName
+ * @param {string} fileName
+ * @param {number} lineNumber
+ * @class
+ */
+ var StackTraceElement = /** @class */ (function () {
+ function StackTraceElement(className, methodName, fileName, lineNumber) {
+ if (((typeof className === 'string') || className === null) && ((typeof methodName === 'string') || methodName === null) && ((typeof fileName === 'string') || fileName === null) && ((typeof lineNumber === 'number') || lineNumber === null)) {
+ var __args = arguments;
+ if (this.className === undefined) {
+ this.className = null;
+ }
+ if (this.fileName === undefined) {
+ this.fileName = null;
+ }
+ if (this.lineNumber === undefined) {
+ this.lineNumber = 0;
+ }
+ if (this.methodName === undefined) {
+ this.methodName = null;
+ }
+ this.className = className;
+ this.methodName = methodName;
+ this.fileName = fileName;
+ this.lineNumber = lineNumber;
+ }
+ else if (className === undefined && methodName === undefined && fileName === undefined && lineNumber === undefined) {
+ var __args = arguments;
+ if (this.className === undefined) {
+ this.className = null;
+ }
+ if (this.fileName === undefined) {
+ this.fileName = null;
+ }
+ if (this.lineNumber === undefined) {
+ this.lineNumber = 0;
+ }
+ if (this.methodName === undefined) {
+ this.methodName = null;
+ }
+ }
+ else
+ throw new Error('invalid overload');
+ }
+ StackTraceElement.prototype.getClassName = function () {
+ return this.className;
+ };
+ StackTraceElement.prototype.getFileName = function () {
+ return this.fileName;
+ };
+ StackTraceElement.prototype.getLineNumber = function () {
+ return this.lineNumber;
+ };
+ StackTraceElement.prototype.getMethodName = function () {
+ return this.methodName;
+ };
+ /**
+ *
+ * @param {*} other
+ * @return {boolean}
+ */
+ StackTraceElement.prototype.equals = function (other) {
+ if (other != null && other instanceof java.lang.StackTraceElement) {
+ var st = other;
+ return this.lineNumber === st.lineNumber && java.util.Objects.equals(this.methodName, st.methodName) && java.util.Objects.equals(this.className, st.className) && java.util.Objects.equals(this.fileName, st.fileName);
+ }
+ return false;
+ };
+ /**
+ *
+ * @return {number}
+ */
+ StackTraceElement.prototype.hashCode = function () {
+ return java.util.Objects.hash(this.lineNumber, this.className, this.methodName, this.fileName);
+ };
+ /**
+ *
+ * @return {string}
+ */
+ StackTraceElement.prototype.toString = function () {
+ return this.className + "." + this.methodName + "(" + (this.fileName != null ? this.fileName : "Unknown Source") + (this.lineNumber >= 0 ? ":" + this.lineNumber : "") + ")";
+ };
+ return StackTraceElement;
+ }());
+ lang.StackTraceElement = StackTraceElement;
+ StackTraceElement["__class"] = "java.lang.StackTraceElement";
+ StackTraceElement["__interfaces"] = ["java.io.Serializable"];
+ })(lang = java.lang || (java.lang = {}));
+})(java || (java = {}));
+(function (java) {
+ var lang;
+ (function (lang) {
+ /**
+ * Constructs a {@code VirtualMachineError} with the specified
+ * detail message and cause. Note that the detail message
+ * associated with {@code cause} is not automatically
+ * incorporated in this error's detail message.
+ *
+ * @param {string} message the detail message (which is saved for later retrieval
+ * by the {@link #getMessage()} method).
+ * @param {java.lang.Throwable} cause the cause (which is saved for later retrieval by the
+ * {@link #getCause()} method). (A {@code null} value is
+ * permitted, and indicates that the cause is nonexistent or
+ * unknown.)
+ * @since 1.8
+ * @class
+ * @extends java.lang.Error
+ * @author Frank Yellin
+ */
+ var VirtualMachineError = /** @class */ (function (_super) {
+ __extends(VirtualMachineError, _super);
+ function VirtualMachineError(message, cause) {
+ var _this = this;
+ if (((typeof message === 'string') || message === null) && ((cause != null && cause instanceof Error) || cause === null)) {
+ var __args = arguments;
+ _this = _super.call(this, message) || this;
+ _this.message = message;
+ }
+ else if (((typeof message === 'string') || message === null) && cause === undefined) {
+ var __args = arguments;
+ _this = _super.call(this, message) || this;
+ _this.message = message;
+ }
+ else if (((message != null && message instanceof Error) || message === null) && cause === undefined) {
+ var __args = arguments;
+ var cause_1 = __args[0];
+ _this = _super.call(this, cause_1) || this;
+ _this.message = cause_1;
+ }
+ else if (message === undefined && cause === undefined) {
+ var __args = arguments;
+ _this = _super.call(this) || this;
+ }
+ else
+ throw new Error('invalid overload');
+ return _this;
+ }
+ VirtualMachineError.serialVersionUID = 4161983926571568670;
+ return VirtualMachineError;
+ }(Error));
+ lang.VirtualMachineError = VirtualMachineError;
+ VirtualMachineError["__class"] = "java.lang.VirtualMachineError";
+ VirtualMachineError["__interfaces"] = ["java.io.Serializable"];
+ })(lang = java.lang || (java.lang = {}));
+})(java || (java = {}));
+(function (java) {
+ var lang;
+ (function (lang) {
+ /**
+ * See the
+ * official Java API doc for details.
+ * @param {string} message
+ * @param {java.lang.Throwable} cause
+ * @class
+ * @extends java.lang.Throwable
+ */
+ var Exception = /** @class */ (function (_super) {
+ __extends(Exception, _super);
+ function Exception(message, cause, enableSuppression, writableStackTrace) {
+ var _this = this;
+ if (((typeof message === 'string') || message === null) && ((cause != null && cause instanceof Error) || cause === null) && ((typeof enableSuppression === 'boolean') || enableSuppression === null) && ((typeof writableStackTrace === 'boolean') || writableStackTrace === null)) {
+ var __args = arguments;
+ _this = _super.call(this, message) || this;
+ _this.message = message;
+ }
+ else if (((typeof message === 'string') || message === null) && ((cause != null && cause instanceof Error) || cause === null) && enableSuppression === undefined && writableStackTrace === undefined) {
+ var __args = arguments;
+ _this = _super.call(this, message) || this;
+ _this.message = message;
+ }
+ else if (((typeof message === 'string') || message === null) && cause === undefined && enableSuppression === undefined && writableStackTrace === undefined) {
+ var __args = arguments;
+ _this = _super.call(this, message) || this;
+ _this.message = message;
+ }
+ else if (((message != null && message instanceof Error) || message === null) && cause === undefined && enableSuppression === undefined && writableStackTrace === undefined) {
+ var __args = arguments;
+ var cause_2 = __args[0];
+ _this = _super.call(this, cause_2) || this;
+ _this.message = cause_2;
+ }
+ else if (message === undefined && cause === undefined && enableSuppression === undefined && writableStackTrace === undefined) {
+ var __args = arguments;
+ _this = _super.call(this) || this;
+ }
+ else
+ throw new Error('invalid overload');
+ return _this;
+ }
+ return Exception;
+ }(Error));
+ lang.Exception = Exception;
+ Exception["__class"] = "java.lang.Exception";
+ Exception["__interfaces"] = ["java.io.Serializable"];
+ })(lang = java.lang || (java.lang = {}));
+})(java || (java = {}));
+(function (java) {
+ var lang;
+ (function (lang) {
+ /**
+ * For JRE compatibility.
+ * @class
+ */
+ var Void = /** @class */ (function () {
+ function Void() {
+ }
+ return Void;
+ }());
+ lang.Void = Void;
+ Void["__class"] = "java.lang.Void";
+ })(lang = java.lang || (java.lang = {}));
+})(java || (java = {}));
+(function (java) {
+ var lang;
+ (function (lang) {
+ var IllegalAccessError = /** @class */ (function (_super) {
+ __extends(IllegalAccessError, _super);
+ function IllegalAccessError(message, cause) {
+ var _this = this;
+ if (((typeof message === 'string') || message === null) && ((cause != null && cause instanceof Error) || cause === null)) {
+ var __args = arguments;
+ _this = _super.call(this, message) || this;
+ _this.message = message;
+ }
+ else if (((typeof message === 'string') || message === null) && cause === undefined) {
+ var __args = arguments;
+ _this = _super.call(this, message) || this;
+ _this.message = message;
+ }
+ else if (((message != null && message instanceof Error) || message === null) && cause === undefined) {
+ var __args = arguments;
+ var cause_3 = __args[0];
+ _this = _super.call(this, cause_3) || this;
+ _this.message = cause_3;
+ }
+ else if (message === undefined && cause === undefined) {
+ var __args = arguments;
+ _this = _super.call(this) || this;
+ }
+ else
+ throw new Error('invalid overload');
+ return _this;
+ }
+ return IllegalAccessError;
+ }(Error));
+ lang.IllegalAccessError = IllegalAccessError;
+ IllegalAccessError["__class"] = "java.lang.IllegalAccessError";
+ IllegalAccessError["__interfaces"] = ["java.io.Serializable"];
+ })(lang = java.lang || (java.lang = {}));
+})(java || (java = {}));
+(function (java) {
+ var lang;
+ (function (lang) {
+ var reflect;
+ (function (reflect) {
+ var Array = /** @class */ (function () {
+ function Array() {
+ }
+ Array.newInstance = function (componentType, length) {
+ var array = [];
+ array.length = length;
+ return array;
+ };
+ return Array;
+ }());
+ reflect.Array = Array;
+ Array["__class"] = "java.lang.reflect.Array";
+ })(reflect = lang.reflect || (lang.reflect = {}));
+ })(lang = java.lang || (java.lang = {}));
+})(java || (java = {}));
+(function (java) {
+ var lang;
+ (function (lang) {
+ var NoSuchMethodError = /** @class */ (function (_super) {
+ __extends(NoSuchMethodError, _super);
+ function NoSuchMethodError(message, cause) {
+ var _this = this;
+ if (((typeof message === 'string') || message === null) && ((cause != null && cause instanceof Error) || cause === null)) {
+ var __args = arguments;
+ _this = _super.call(this, message) || this;
+ _this.message = message;
+ }
+ else if (((typeof message === 'string') || message === null) && cause === undefined) {
+ var __args = arguments;
+ _this = _super.call(this, message) || this;
+ _this.message = message;
+ }
+ else if (((message != null && message instanceof Error) || message === null) && cause === undefined) {
+ var __args = arguments;
+ var cause_4 = __args[0];
+ _this = _super.call(this, cause_4) || this;
+ _this.message = cause_4;
+ }
+ else if (message === undefined && cause === undefined) {
+ var __args = arguments;
+ _this = _super.call(this) || this;
+ }
+ else
+ throw new Error('invalid overload');
+ return _this;
+ }
+ return NoSuchMethodError;
+ }(Error));
+ lang.NoSuchMethodError = NoSuchMethodError;
+ NoSuchMethodError["__class"] = "java.lang.NoSuchMethodError";
+ NoSuchMethodError["__interfaces"] = ["java.io.Serializable"];
+ })(lang = java.lang || (java.lang = {}));
+})(java || (java = {}));
+(function (java) {
+ var lang;
+ (function (lang) {
+ var annotation;
+ (function (annotation) {
+ /**
+ * Enumerates types of declared elements in a Java program [Sun
+ * docs].
+ * @enum
+ * @property {java.lang.annotation.ElementType} ANNOTATION_TYPE
+ * @property {java.lang.annotation.ElementType} CONSTRUCTOR
+ * @property {java.lang.annotation.ElementType} FIELD
+ * @property {java.lang.annotation.ElementType} LOCAL_VARIABLE
+ * @property {java.lang.annotation.ElementType} METHOD
+ * @property {java.lang.annotation.ElementType} PACKAGE
+ * @property {java.lang.annotation.ElementType} PARAMETER
+ * @property {java.lang.annotation.ElementType} TYPE
+ * @class
+ */
+ var ElementType;
+ (function (ElementType) {
+ ElementType[ElementType["ANNOTATION_TYPE"] = 0] = "ANNOTATION_TYPE";
+ ElementType[ElementType["CONSTRUCTOR"] = 1] = "CONSTRUCTOR";
+ ElementType[ElementType["FIELD"] = 2] = "FIELD";
+ ElementType[ElementType["LOCAL_VARIABLE"] = 3] = "LOCAL_VARIABLE";
+ ElementType[ElementType["METHOD"] = 4] = "METHOD";
+ ElementType[ElementType["PACKAGE"] = 5] = "PACKAGE";
+ ElementType[ElementType["PARAMETER"] = 6] = "PARAMETER";
+ ElementType[ElementType["TYPE"] = 7] = "TYPE";
+ })(ElementType = annotation.ElementType || (annotation.ElementType = {}));
+ })(annotation = lang.annotation || (lang.annotation = {}));
+ })(lang = java.lang || (java.lang = {}));
+})(java || (java = {}));
+(function (java) {
+ var lang;
+ (function (lang) {
+ var annotation;
+ (function (annotation) {
+ /**
+ * Enumerates annotation retention policies [Sun
+ * docs].
+ * @enum
+ * @property {java.lang.annotation.RetentionPolicy} CLASS
+ * @property {java.lang.annotation.RetentionPolicy} RUNTIME
+ * @property {java.lang.annotation.RetentionPolicy} SOURCE
+ * @class
+ */
+ var RetentionPolicy;
+ (function (RetentionPolicy) {
+ RetentionPolicy[RetentionPolicy["CLASS"] = 0] = "CLASS";
+ RetentionPolicy[RetentionPolicy["RUNTIME"] = 1] = "RUNTIME";
+ RetentionPolicy[RetentionPolicy["SOURCE"] = 2] = "SOURCE";
+ })(RetentionPolicy = annotation.RetentionPolicy || (annotation.RetentionPolicy = {}));
+ })(annotation = lang.annotation || (lang.annotation = {}));
+ })(lang = java.lang || (java.lang = {}));
+})(java || (java = {}));
+(function (java) {
+ var lang;
+ (function (lang) {
+ var annotation;
+ (function (annotation) {
+ /**
+ * Indicates the annotation parser determined the annotation was malformed when
+ * reading from the class file [Sun
+ * docs].
+ * @class
+ * @extends java.lang.Error
+ */
+ var AnnotationFormatError = /** @class */ (function (_super) {
+ __extends(AnnotationFormatError, _super);
+ function AnnotationFormatError() {
+ var _this = _super.call(this) || this;
+ Object.setPrototypeOf(_this, AnnotationFormatError.prototype);
+ return _this;
+ }
+ return AnnotationFormatError;
+ }(Error));
+ annotation.AnnotationFormatError = AnnotationFormatError;
+ AnnotationFormatError["__class"] = "java.lang.annotation.AnnotationFormatError";
+ AnnotationFormatError["__interfaces"] = ["java.io.Serializable"];
+ })(annotation = lang.annotation || (lang.annotation = {}));
+ })(lang = java.lang || (java.lang = {}));
+})(java || (java = {}));
+(function (java) {
+ var lang;
+ (function (lang) {
+ /**
+ * Generally unsupported. This class is provided so that the GWT compiler can
+ * choke down class literal references.
+ *
+ * NOTE: The code in this class is very sensitive and should keep its
+ * dependencies upon other classes to a minimum.
+ *
+ * @param
+ *
+ * Arrays are not registered in the prototype table and get the class
+ * literal explicitly at construction.
+ *
+ * @param {java.lang.Class} leafClass
+ * @param {number} dimensions
+ * @return {java.lang.Class}
+ * @private
+ */
+ /*private*/ Class.getClassLiteralForArray = function (leafClass, dimensions) {
+ var arrayLiterals = leafClass.arrayLiterals = leafClass.arrayLiterals == null ? [] : leafClass.arrayLiterals;
+ return arrayLiterals[dimensions] != null ? arrayLiterals[dimensions] : (arrayLiterals[dimensions] = leafClass.createClassLiteralForArray(dimensions));
+ };
+ /*private*/ Class.prototype.createClassLiteralForArray = function (dimensions) {
+ var clazz = (new java.lang.Class());
+ clazz.modifiers = Class.ARRAY;
+ clazz.superclass = Object;
+ if (dimensions > 1) {
+ clazz.componentType = Class.getClassLiteralForArray(this, dimensions - 1);
+ }
+ else {
+ clazz.componentType = this;
+ }
+ return clazz;
+ };
+ /**
+ * Create a Class object for a class.
+ *
+ * @skip
+ * @param {string} packageName
+ * @param {string} compoundClassName
+ * @param {string} typeId
+ * @param {java.lang.Class} superclass
+ * @return {java.lang.Class}
+ */
+ Class.createForClass = function (packageName, compoundClassName, typeId, superclass) {
+ var clazz = Class.createClassObject(packageName, compoundClassName, typeId);
+ clazz.superclass = superclass;
+ return clazz;
+ };
+ /**
+ * Create a Class object for an enum.
+ *
+ * @skip
+ * @param {string} packageName
+ * @param {string} compoundClassName
+ * @param {string} typeId
+ * @param {java.lang.Class} superclass
+ * @param {Function} enumConstantsFunc
+ * @param {Function} enumValueOfFunc
+ * @return {java.lang.Class}
+ */
+ Class.createForEnum = function (packageName, compoundClassName, typeId, superclass, enumConstantsFunc, enumValueOfFunc) {
+ var clazz = Class.createClassObject(packageName, compoundClassName, typeId);
+ clazz.modifiers = (enumConstantsFunc != null) ? Class.ENUM : 0;
+ clazz.superclass = clazz.enumSuperclass = superclass;
+ clazz.enumConstantsFunc = enumConstantsFunc;
+ clazz.enumValueOfFunc = enumValueOfFunc;
+ return clazz;
+ };
+ /**
+ * Create a Class object for an interface.
+ *
+ * @skip
+ * @param {string} packageName
+ * @param {string} compoundClassName
+ * @return {java.lang.Class}
+ */
+ Class.createForInterface = function (packageName, compoundClassName) {
+ var clazz = Class.createClassObject(packageName, compoundClassName, null);
+ clazz.modifiers = Class.INTERFACE;
+ return clazz;
+ };
+ /**
+ * Create a Class object for a primitive.
+ *
+ * @skip
+ * @param {string} className
+ * @param {string} primitiveTypeId
+ * @return {java.lang.Class}
+ */
+ Class.createForPrimitive = function (className, primitiveTypeId) {
+ var clazz = Class.createClassObject("", className, primitiveTypeId);
+ clazz.modifiers = Class.PRIMITIVE;
+ return clazz;
+ };
+ /**
+ * Used by {@link WebModePayloadSink} to create uninitialized instances.
+ * @param {java.lang.Class} clazz
+ * @return {*}
+ */
+ Class.getPrototypeForClass = function (clazz) {
+ if (clazz.isPrimitive()) {
+ return null;
+ }
+ return Class.getConstructorForClass(clazz).prototype;
+ };
+ /**
+ * Creates the class object for a type and initiliazes its fields.
+ * @param {string} packageName
+ * @param {string} compoundClassName
+ * @param {string} typeId
+ * @return {java.lang.Class}
+ * @private
+ */
+ /*private*/ Class.createClassObject = function (packageName, compoundClassName, typeId) {
+ var clazz = (new java.lang.Class());
+ clazz.packageName = packageName;
+ clazz.compoundName = compoundClassName;
+ return clazz;
+ };
+ /**
+ * Initiliazes {@code clazz} names from metadata.
+ *
+ * Written in JSNI to minimize dependencies (on String.+).
+ * @param {java.lang.Class} clazz
+ * @private
+ */
+ /*private*/ Class.initializeNames = function (clazz) {
+ if (clazz.isArray()) {
+ var componentType = clazz.componentType;
+ if (componentType.isPrimitive()) {
+ clazz.typeName = "[" + componentType.typeId;
+ }
+ else if (!componentType.isArray()) {
+ clazz.typeName = "[L" + /* getName */ (function (c) { return c["__class"] ? c["__class"] : c["name"]; })(componentType) + ";";
+ }
+ else {
+ clazz.typeName = "[" + /* getName */ (function (c) { return c["__class"] ? c["__class"] : c["name"]; })(componentType);
+ }
+ clazz.canonicalName = componentType.getCanonicalName() + "[]";
+ clazz.simpleName = /* getSimpleName */ (function (c) { return c["__class"] ? c["__class"].substring(c["__class"].lastIndexOf('.') + 1) : c["name"].substring(c["name"].lastIndexOf('.') + 1); })(componentType) + "[]";
+ return;
+ }
+ var packageName = clazz.packageName;
+ var compoundName = clazz.compoundName.split("/");
+ clazz.typeName = [packageName, (compoundName).join("$")].join(".");
+ clazz.canonicalName = [packageName, (compoundName).join(".")].join(".");
+ clazz.simpleName = compoundName[compoundName.length - 1];
+ };
+ /**
+ * Sets the class object for primitives.
+ *
+ * Written in JSNI to minimize dependencies (on (String)+).
+ * @param {java.lang.Class} clazz
+ * @param {Object} primitiveTypeId
+ */
+ Class.synthesizePrimitiveNamesFromTypeId = function (clazz, primitiveTypeId) {
+ clazz.typeName = "Class$" + primitiveTypeId;
+ clazz.canonicalName = clazz.typeName;
+ clazz.simpleName = clazz.typeName;
+ };
+ Class.prototype.desiredAssertionStatus = function () {
+ return false;
+ };
+ /*private*/ Class.prototype.ensureNamesAreInitialized = function () {
+ if (this.typeName != null) {
+ return;
+ }
+ Class.initializeNames(this);
+ };
+ Class.prototype.getCanonicalName = function () {
+ this.ensureNamesAreInitialized();
+ return this.canonicalName;
+ };
+ Class.prototype.getComponentType = function () {
+ return this.componentType;
+ };
+ Class.prototype.getEnumConstants = function () {
+ return (this.enumConstantsFunc && (this.enumConstantsFunc)());
+ };
+ Class.prototype.getName = function () {
+ this.ensureNamesAreInitialized();
+ return this.typeName;
+ };
+ Class.prototype.getSimpleName = function () {
+ this.ensureNamesAreInitialized();
+ return this.simpleName;
+ };
+ Class.prototype.getSuperclass = function () {
+ return this.superclass;
+ };
+ Class.prototype.isArray = function () {
+ return (this.modifiers & Class.ARRAY) !== 0;
+ };
+ Class.prototype.isEnum = function () {
+ return (this.modifiers & Class.ENUM) !== 0;
+ };
+ Class.prototype.isInterface = function () {
+ return (this.modifiers & Class.INTERFACE) !== 0;
+ };
+ Class.prototype.isPrimitive = function () {
+ return (this.modifiers & Class.PRIMITIVE) !== 0;
+ };
+ /**
+ *
+ * @return {string}
+ */
+ Class.prototype.toString = function () {
+ return (this.isInterface() ? "interface " : (this.isPrimitive() ? "" : "class ")) + /* getName */ (function (c) { return c["__class"] ? c["__class"] : c["name"]; })(this);
+ };
+ /**
+ * Used by Enum to allow getSuperclass() to be pruned.
+ * @return {java.lang.Class}
+ */
+ Class.prototype.getEnumSuperclass = function () {
+ return this.enumSuperclass;
+ };
+ Class.PRIMITIVE = 1;
+ Class.INTERFACE = 2;
+ Class.ARRAY = 4;
+ Class.ENUM = 8;
+ Class.nextSequentialId = 1;
+ return Class;
+ }());
+ lang.Class = Class;
+ Class["__class"] = "java.lang.Class";
+ Class["__interfaces"] = ["java.lang.reflect.Type"];
+ })(lang = java.lang || (java.lang = {}));
+})(java || (java = {}));
+(function (java) {
+ var lang;
+ (function (lang) {
+ var ThreadLocal = /** @class */ (function () {
+ function ThreadLocal() {
+ if (this.value === undefined) {
+ this.value = null;
+ }
+ }
+ ThreadLocal.prototype.initialValue = function () {
+ return null;
+ };
+ ThreadLocal.prototype.get = function () {
+ return this.value;
+ };
+ ThreadLocal.prototype.set = function (value) {
+ this.value = value;
+ };
+ ThreadLocal.prototype.remove = function () {
+ };
+ ThreadLocal.prototype.childValue = function (parentValue) {
+ throw new java.lang.UnsupportedOperationException();
+ };
+ return ThreadLocal;
+ }());
+ lang.ThreadLocal = ThreadLocal;
+ ThreadLocal["__class"] = "java.lang.ThreadLocal";
+ })(lang = java.lang || (java.lang = {}));
+})(java || (java = {}));
+(function (java) {
+ var lang;
+ (function (lang) {
+ /**
+ * A base class to share implementation between {@link StringBuffer} and {@link StringBuilder}.
+ *
+ * Most methods will give expected performance results. Exception is {@link #setCharAt(int, char)},
+ * which is O(n), and thus should not be used many times on the same
+ * This implementation sets a mark in the filtered stream.
+ *
+ * @param {number} readlimit
+ * the number of bytes that can be read from this stream before
+ * the mark is invalidated.
+ * @see #markSupported()
+ * @see #reset()
+ */
+ FilterInputStream.prototype.mark = function (readlimit) {
+ this["in"].mark(readlimit);
+ };
+ /**
+ * Indicates whether this stream supports {@code mark()} and {@code reset()}.
+ * This implementation returns whether or not the filtered stream supports
+ * marking.
+ *
+ * @return {boolean} {@code true} if {@code mark()} and {@code reset()} are supported,
+ * {@code false} otherwise.
+ * @see #mark(int)
+ * @see #reset()
+ * @see #skip(long)
+ */
+ FilterInputStream.prototype.markSupported = function () {
+ return this["in"].markSupported();
+ };
+ FilterInputStream.prototype.read = function (buffer, byteOffset, byteCount) {
+ if (((buffer != null && buffer instanceof Array && (buffer.length == 0 || buffer[0] == null || (typeof buffer[0] === 'number'))) || buffer === null) && ((typeof byteOffset === 'number') || byteOffset === null) && ((typeof byteCount === 'number') || byteCount === null)) {
+ return _super.prototype.read.call(this, buffer, byteOffset, byteCount);
+ }
+ else if (((buffer != null && buffer instanceof Array && (buffer.length == 0 || buffer[0] == null || (typeof buffer[0] === 'number'))) || buffer === null) && byteOffset === undefined && byteCount === undefined) {
+ return this.read$byte_A(buffer);
+ }
+ else if (buffer === undefined && byteOffset === undefined && byteCount === undefined) {
+ return this.read$();
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ FilterInputStream.prototype.read$ = function () {
+ return this["in"].read$();
+ };
+ /**
+ * Resets this stream to the last marked location. This implementation
+ * resets the target stream.
+ *
+ * @throws IOException
+ * if this stream is already closed, no mark has been set or the
+ * mark is no longer valid because more than {@code readlimit}
+ * bytes have been read since setting the mark.
+ * @see #mark(int)
+ * @see #markSupported()
+ */
+ FilterInputStream.prototype.reset = function () {
+ this["in"].reset();
+ };
+ /**
+ * Skips {@code byteCount} bytes in this stream. Subsequent
+ * calls to {@code read} will not return these bytes unless {@code reset} is
+ * used. This implementation skips {@code byteCount} bytes in the
+ * filtered stream.
+ *
+ * @return {number} the number of bytes actually skipped.
+ * @throws IOException
+ * if this stream is closed or another IOException occurs.
+ * @see #mark(int)
+ * @see #reset()
+ * @param {number} byteCount
+ */
+ FilterInputStream.prototype.skip = function (byteCount) {
+ return this["in"].skip(byteCount);
+ };
+ return FilterInputStream;
+ }(java.io.InputStream));
+ io.FilterInputStream = FilterInputStream;
+ FilterInputStream["__class"] = "java.io.FilterInputStream";
+ FilterInputStream["__interfaces"] = ["java.io.Closeable", "java.lang.AutoCloseable"];
+ })(io = java.io || (java.io = {}));
+})(java || (java = {}));
+(function (java) {
+ var io;
+ (function (io) {
+ /**
+ * Constructs a new {@code ByteArrayInputStream} on the byte array
+ * {@code buf} with the initial position set to {@code offset} and the
+ * number of bytes available set to {@code offset} + {@code length}.
+ *
+ * @param {Array} buf
+ * the byte array to stream over.
+ * @param {number} offset
+ * the initial position in {@code buf} to start streaming from.
+ * @param {number} length
+ * the number of bytes available for streaming.
+ * @class
+ * @extends java.io.InputStream
+ */
+ var ByteArrayInputStream = /** @class */ (function (_super) {
+ __extends(ByteArrayInputStream, _super);
+ function ByteArrayInputStream(buf, offset, length) {
+ var _this = this;
+ if (((buf != null && buf instanceof Array && (buf.length == 0 || buf[0] == null || (typeof buf[0] === 'number'))) || buf === null) && ((typeof offset === 'number') || offset === null) && ((typeof length === 'number') || length === null)) {
+ var __args = arguments;
+ _this = _super.call(this) || this;
+ if (_this.buf === undefined) {
+ _this.buf = null;
+ }
+ if (_this.pos === undefined) {
+ _this.pos = 0;
+ }
+ if (_this._mark === undefined) {
+ _this._mark = 0;
+ }
+ if (_this.count === undefined) {
+ _this.count = 0;
+ }
+ if (length === -1) {
+ length = buf.length;
+ }
+ _this.buf = buf;
+ _this.pos = offset;
+ _this._mark = offset;
+ _this.count = offset + length > buf.length ? buf.length : offset + length;
+ }
+ else if (((buf != null && buf instanceof Array && (buf.length == 0 || buf[0] == null || (typeof buf[0] === 'number'))) || buf === null) && offset === undefined && length === undefined) {
+ var __args = arguments;
+ {
+ var __args_22 = arguments;
+ var offset_1 = 0;
+ var length_1 = -1;
+ _this = _super.call(this) || this;
+ if (_this.buf === undefined) {
+ _this.buf = null;
+ }
+ if (_this.pos === undefined) {
+ _this.pos = 0;
+ }
+ if (_this._mark === undefined) {
+ _this._mark = 0;
+ }
+ if (_this.count === undefined) {
+ _this.count = 0;
+ }
+ if (length_1 === -1) {
+ length_1 = buf.length;
+ }
+ _this.buf = buf;
+ _this.pos = offset_1;
+ _this._mark = offset_1;
+ _this.count = offset_1 + length_1 > buf.length ? buf.length : offset_1 + length_1;
+ }
+ if (_this.buf === undefined) {
+ _this.buf = null;
+ }
+ if (_this.pos === undefined) {
+ _this.pos = 0;
+ }
+ if (_this._mark === undefined) {
+ _this._mark = 0;
+ }
+ if (_this.count === undefined) {
+ _this.count = 0;
+ }
+ }
+ else
+ throw new Error('invalid overload');
+ return _this;
+ }
+ /**
+ * Returns the number of remaining bytes.
+ *
+ * @return {number} {@code count - pos}
+ */
+ ByteArrayInputStream.prototype.available = function () {
+ return this.count - this.pos;
+ };
+ /**
+ * Closes this stream and frees resources associated with this stream.
+ *
+ * @throws IOException
+ * if an I/O error occurs while closing this stream.
+ */
+ ByteArrayInputStream.prototype.close = function () {
+ };
+ /**
+ * Sets a mark position in this ByteArrayInputStream. The parameter
+ * {@code readlimit} is ignored. Sending {@code reset()} will reposition the
+ * stream back to the marked position.
+ *
+ * @param {number} readlimit
+ * ignored.
+ * @see #markSupported()
+ * @see #reset()
+ */
+ ByteArrayInputStream.prototype.mark = function (readlimit) {
+ this._mark = this.pos;
+ };
+ /**
+ * Indicates whether this stream supports the {@code mark()} and
+ * {@code reset()} methods. Returns {@code true} since this class supports
+ * these methods.
+ *
+ * @return {boolean} always {@code true}.
+ * @see #mark(int)
+ * @see #reset()
+ */
+ ByteArrayInputStream.prototype.markSupported = function () {
+ return true;
+ };
+ ByteArrayInputStream.prototype.read$ = function () {
+ return this.read$byte_A$int$int(null, 0, 0);
+ };
+ ByteArrayInputStream.prototype.read$byte_A$int$int = function (buffer, byteOffset, byteCount) {
+ if (buffer == null) {
+ return this.pos < this.count ? this.buf[this.pos++] & 255 : -1;
+ }
+ java.io.IOUtils.checkOffsetAndCount$byte_A$int$int(buffer, byteOffset, byteCount);
+ if (this.pos >= this.count) {
+ return -1;
+ }
+ if (byteCount === 0) {
+ return 0;
+ }
+ var copylen = this.count - this.pos < byteCount ? this.count - this.pos : byteCount;
+ java.lang.System.arraycopy(this.buf, this.pos, buffer, byteOffset, copylen);
+ this.pos += copylen;
+ return copylen;
+ };
+ /**
+ *
+ * @param {Array} buffer
+ * @param {number} byteOffset
+ * @param {number} byteCount
+ * @return {number}
+ */
+ ByteArrayInputStream.prototype.read = function (buffer, byteOffset, byteCount) {
+ if (((buffer != null && buffer instanceof Array && (buffer.length == 0 || buffer[0] == null || (typeof buffer[0] === 'number'))) || buffer === null) && ((typeof byteOffset === 'number') || byteOffset === null) && ((typeof byteCount === 'number') || byteCount === null)) {
+ return this.read$byte_A$int$int(buffer, byteOffset, byteCount);
+ }
+ else if (((buffer != null && buffer instanceof Array && (buffer.length == 0 || buffer[0] == null || (typeof buffer[0] === 'number'))) || buffer === null) && byteOffset === undefined && byteCount === undefined) {
+ return this.read$byte_A(buffer);
+ }
+ else if (buffer === undefined && byteOffset === undefined && byteCount === undefined) {
+ return this.read$();
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ /**
+ * Resets this stream to the last marked location. This implementation
+ * resets the position to either the marked position, the start position
+ * supplied in the constructor or 0 if neither has been provided.
+ *
+ * @see #mark(int)
+ */
+ ByteArrayInputStream.prototype.reset = function () {
+ this.pos = this._mark;
+ };
+ /**
+ * Skips {@code byteCount} bytes in this InputStream. Subsequent calls to
+ * {@code read} will not return these bytes unless {@code reset} is used.
+ * This implementation skips {@code byteCount} number of bytes in the target
+ * stream. It does nothing and returns 0 if {@code byteCount} is negative.
+ *
+ * @return {number} the number of bytes actually skipped.
+ * @param {number} byteCount
+ */
+ ByteArrayInputStream.prototype.skip = function (byteCount) {
+ if (byteCount <= 0) {
+ return 0;
+ }
+ var temp = this.pos;
+ this.pos = this.count - this.pos < byteCount ? this.count : ((this.pos + byteCount) | 0);
+ return this.pos - temp;
+ };
+ return ByteArrayInputStream;
+ }(java.io.InputStream));
+ io.ByteArrayInputStream = ByteArrayInputStream;
+ ByteArrayInputStream["__class"] = "java.io.ByteArrayInputStream";
+ ByteArrayInputStream["__interfaces"] = ["java.io.Closeable", "java.lang.AutoCloseable"];
+ })(io = java.io || (java.io = {}));
+})(java || (java = {}));
+(function (java) {
+ var io;
+ (function (io) {
+ /**
+ * JSweet implementation.
+ * @param {java.io.Reader} in
+ * @param {number} sz
+ * @class
+ * @extends java.io.Reader
+ */
+ var BufferedReader = /** @class */ (function (_super) {
+ __extends(BufferedReader, _super);
+ function BufferedReader(__in, sz) {
+ var _this = this;
+ if (((__in != null && __in instanceof java.io.Reader) || __in === null) && ((typeof sz === 'number') || sz === null)) {
+ var __args = arguments;
+ _this = _super.call(this, __in) || this;
+ if (_this["in"] === undefined) {
+ _this["in"] = null;
+ }
+ if (_this.cb === undefined) {
+ _this.cb = null;
+ }
+ if (_this.nChars === undefined) {
+ _this.nChars = 0;
+ }
+ if (_this.nextChar === undefined) {
+ _this.nextChar = 0;
+ }
+ if (_this.markedChar === undefined) {
+ _this.markedChar = 0;
+ }
+ if (_this.readAheadLimit === undefined) {
+ _this.readAheadLimit = 0;
+ }
+ if (_this.skipLF === undefined) {
+ _this.skipLF = false;
+ }
+ if (_this.markedSkipLF === undefined) {
+ _this.markedSkipLF = false;
+ }
+ _this.markedChar = BufferedReader.UNMARKED;
+ _this.readAheadLimit = 0;
+ _this.skipLF = false;
+ _this.markedSkipLF = false;
+ if (sz <= 0)
+ throw new java.lang.IllegalArgumentException("Buffer size <= 0");
+ _this["in"] = __in;
+ _this.cb = (function (s) { var a = []; while (s-- > 0)
+ a.push(null); return a; })(sz);
+ _this.nextChar = _this.nChars = 0;
+ }
+ else if (((__in != null && __in instanceof java.io.Reader) || __in === null) && sz === undefined) {
+ var __args = arguments;
+ {
+ var __args_23 = arguments;
+ var sz_1 = BufferedReader.defaultCharBufferSize;
+ _this = _super.call(this, __in) || this;
+ if (_this["in"] === undefined) {
+ _this["in"] = null;
+ }
+ if (_this.cb === undefined) {
+ _this.cb = null;
+ }
+ if (_this.nChars === undefined) {
+ _this.nChars = 0;
+ }
+ if (_this.nextChar === undefined) {
+ _this.nextChar = 0;
+ }
+ if (_this.markedChar === undefined) {
+ _this.markedChar = 0;
+ }
+ if (_this.readAheadLimit === undefined) {
+ _this.readAheadLimit = 0;
+ }
+ if (_this.skipLF === undefined) {
+ _this.skipLF = false;
+ }
+ if (_this.markedSkipLF === undefined) {
+ _this.markedSkipLF = false;
+ }
+ _this.markedChar = BufferedReader.UNMARKED;
+ _this.readAheadLimit = 0;
+ _this.skipLF = false;
+ _this.markedSkipLF = false;
+ if (sz_1 <= 0)
+ throw new java.lang.IllegalArgumentException("Buffer size <= 0");
+ _this["in"] = __in;
+ _this.cb = (function (s) { var a = []; while (s-- > 0)
+ a.push(null); return a; })(sz_1);
+ _this.nextChar = _this.nChars = 0;
+ }
+ if (_this["in"] === undefined) {
+ _this["in"] = null;
+ }
+ if (_this.cb === undefined) {
+ _this.cb = null;
+ }
+ if (_this.nChars === undefined) {
+ _this.nChars = 0;
+ }
+ if (_this.nextChar === undefined) {
+ _this.nextChar = 0;
+ }
+ if (_this.markedChar === undefined) {
+ _this.markedChar = 0;
+ }
+ if (_this.readAheadLimit === undefined) {
+ _this.readAheadLimit = 0;
+ }
+ if (_this.skipLF === undefined) {
+ _this.skipLF = false;
+ }
+ if (_this.markedSkipLF === undefined) {
+ _this.markedSkipLF = false;
+ }
+ }
+ else
+ throw new Error('invalid overload');
+ return _this;
+ }
+ /*private*/ BufferedReader.prototype.ensureOpen = function () {
+ if (this["in"] == null)
+ throw new java.io.IOException("Stream closed");
+ };
+ /*private*/ BufferedReader.prototype.fill = function () {
+ var dst;
+ if (this.markedChar <= BufferedReader.UNMARKED) {
+ dst = 0;
+ }
+ else {
+ var delta = this.nextChar - this.markedChar;
+ if (delta >= this.readAheadLimit) {
+ this.markedChar = BufferedReader.INVALIDATED;
+ this.readAheadLimit = 0;
+ dst = 0;
+ }
+ else {
+ if (this.readAheadLimit <= this.cb.length) {
+ java.lang.System.arraycopy(this.cb, this.markedChar, this.cb, 0, delta);
+ this.markedChar = 0;
+ dst = delta;
+ }
+ else {
+ var ncb = (function (s) { var a = []; while (s-- > 0)
+ a.push(null); return a; })(this.readAheadLimit);
+ java.lang.System.arraycopy(this.cb, this.markedChar, ncb, 0, delta);
+ this.cb = ncb;
+ this.markedChar = 0;
+ dst = delta;
+ }
+ this.nextChar = this.nChars = delta;
+ }
+ }
+ var n;
+ do {
+ {
+ n = this["in"].read$char_A$int$int(this.cb, dst, this.cb.length - dst);
+ }
+ } while ((n === 0));
+ if (n > 0) {
+ this.nChars = dst + n;
+ this.nextChar = dst;
+ }
+ };
+ BufferedReader.prototype.read$ = function () {
+ {
+ this.ensureOpen();
+ for (;;) {
+ {
+ if (this.nextChar >= this.nChars) {
+ this.fill();
+ if (this.nextChar >= this.nChars)
+ return -1;
+ }
+ if (this.skipLF) {
+ this.skipLF = false;
+ if ((function (c) { return c.charCodeAt == null ? c : c.charCodeAt(0); })(this.cb[this.nextChar]) == '\n'.charCodeAt(0)) {
+ this.nextChar++;
+ continue;
+ }
+ }
+ return (this.cb[this.nextChar++]).charCodeAt(0);
+ }
+ ;
+ }
+ }
+ ;
+ };
+ /*private*/ BufferedReader.prototype.read1 = function (cbuf, off, len) {
+ if (this.nextChar >= this.nChars) {
+ if (len >= this.cb.length && this.markedChar <= BufferedReader.UNMARKED && !this.skipLF) {
+ return this["in"].read$char_A$int$int(cbuf, off, len);
+ }
+ this.fill();
+ }
+ if (this.nextChar >= this.nChars)
+ return -1;
+ if (this.skipLF) {
+ this.skipLF = false;
+ if ((function (c) { return c.charCodeAt == null ? c : c.charCodeAt(0); })(this.cb[this.nextChar]) == '\n'.charCodeAt(0)) {
+ this.nextChar++;
+ if (this.nextChar >= this.nChars)
+ this.fill();
+ if (this.nextChar >= this.nChars)
+ return -1;
+ }
+ }
+ var n = Math.min(len, this.nChars - this.nextChar);
+ java.lang.System.arraycopy(this.cb, this.nextChar, cbuf, off, n);
+ this.nextChar += n;
+ return n;
+ };
+ BufferedReader.prototype.read$char_A$int$int = function (cbuf, off, len) {
+ {
+ this.ensureOpen();
+ if ((off < 0) || (off > cbuf.length) || (len < 0) || ((off + len) > cbuf.length) || ((off + len) < 0)) {
+ throw new java.lang.IndexOutOfBoundsException();
+ }
+ else if (len === 0) {
+ return 0;
+ }
+ var n = this.read1(cbuf, off, len);
+ if (n <= 0)
+ return n;
+ while (((n < len) && this["in"].ready())) {
+ {
+ var n1 = this.read1(cbuf, off + n, len - n);
+ if (n1 <= 0)
+ break;
+ n += n1;
+ }
+ }
+ ;
+ return n;
+ }
+ ;
+ };
+ BufferedReader.prototype.read = function (cbuf, off, len) {
+ if (((cbuf != null && cbuf instanceof Array && (cbuf.length == 0 || cbuf[0] == null || (typeof cbuf[0] === 'string'))) || cbuf === null) && ((typeof off === 'number') || off === null) && ((typeof len === 'number') || len === null)) {
+ return this.read$char_A$int$int(cbuf, off, len);
+ }
+ else if (((cbuf != null && cbuf instanceof Array && (cbuf.length == 0 || cbuf[0] == null || (typeof cbuf[0] === 'string'))) || cbuf === null) && off === undefined && len === undefined) {
+ return this.read$char_A(cbuf);
+ }
+ else if (cbuf === undefined && off === undefined && len === undefined) {
+ return this.read$();
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ BufferedReader.prototype.readLine$boolean = function (ignoreLF) {
+ var s = null;
+ var startChar;
+ {
+ this.ensureOpen();
+ var omitLF = ignoreLF || this.skipLF;
+ for (;;) {
+ {
+ if (this.nextChar >= this.nChars)
+ this.fill();
+ if (this.nextChar >= this.nChars) {
+ if (s != null && s.length() > 0)
+ return s.toString();
+ else
+ return null;
+ }
+ var eol = false;
+ var c = String.fromCharCode(0);
+ var i = void 0;
+ if (omitLF && ((function (c) { return c.charCodeAt == null ? c : c.charCodeAt(0); })(this.cb[this.nextChar]) == '\n'.charCodeAt(0)))
+ this.nextChar++;
+ this.skipLF = false;
+ omitLF = false;
+ charLoop: for (i = this.nextChar; i < this.nChars; i++) {
+ {
+ c = this.cb[i];
+ if (((function (c) { return c.charCodeAt == null ? c : c.charCodeAt(0); })(c) == '\n'.charCodeAt(0)) || ((function (c) { return c.charCodeAt == null ? c : c.charCodeAt(0); })(c) == '\r'.charCodeAt(0))) {
+ eol = true;
+ break charLoop;
+ }
+ }
+ ;
+ }
+ startChar = this.nextChar;
+ this.nextChar = i;
+ if (eol) {
+ var str = void 0;
+ if (s == null) {
+ str = (function (str, index, len) { return str.substring(index, index + len); })((this.cb).join(''), startChar, i - startChar);
+ }
+ else {
+ s.append$char_A$int$int(this.cb, startChar, i - startChar);
+ str = s.toString();
+ }
+ this.nextChar++;
+ if ((function (c) { return c.charCodeAt == null ? c : c.charCodeAt(0); })(c) == '\r'.charCodeAt(0)) {
+ this.skipLF = true;
+ }
+ return str;
+ }
+ if (s == null)
+ s = new java.lang.StringBuffer(BufferedReader.defaultExpectedLineLength);
+ s.append$char_A$int$int(this.cb, startChar, i - startChar);
+ }
+ ;
+ }
+ }
+ ;
+ };
+ BufferedReader.prototype.readLine = function (ignoreLF) {
+ if (((typeof ignoreLF === 'boolean') || ignoreLF === null)) {
+ return this.readLine$boolean(ignoreLF);
+ }
+ else if (ignoreLF === undefined) {
+ return this.readLine$();
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ BufferedReader.prototype.readLine$ = function () {
+ return this.readLine$boolean(false);
+ };
+ BufferedReader.prototype.skip = function (n) {
+ if (n < 0) {
+ throw new java.lang.IllegalArgumentException("skip value is negative");
+ }
+ {
+ this.ensureOpen();
+ var r = n;
+ while ((r > 0)) {
+ {
+ if (this.nextChar >= this.nChars)
+ this.fill();
+ if (this.nextChar >= this.nChars)
+ break;
+ if (this.skipLF) {
+ this.skipLF = false;
+ if ((function (c) { return c.charCodeAt == null ? c : c.charCodeAt(0); })(this.cb[this.nextChar]) == '\n'.charCodeAt(0)) {
+ this.nextChar++;
+ }
+ }
+ var d = this.nChars - this.nextChar;
+ if (r <= d) {
+ this.nextChar += r;
+ r = 0;
+ break;
+ }
+ else {
+ r -= d;
+ this.nextChar = this.nChars;
+ }
+ }
+ }
+ ;
+ return n - r;
+ }
+ ;
+ };
+ BufferedReader.prototype.ready = function () {
+ this.ensureOpen();
+ if (this.skipLF) {
+ if (this.nextChar >= this.nChars && this["in"].ready()) {
+ this.fill();
+ }
+ if (this.nextChar < this.nChars) {
+ if ((function (c) { return c.charCodeAt == null ? c : c.charCodeAt(0); })(this.cb[this.nextChar]) == '\n'.charCodeAt(0))
+ this.nextChar++;
+ this.skipLF = false;
+ }
+ }
+ return (this.nextChar < this.nChars) || this["in"].ready();
+ };
+ BufferedReader.prototype.markSupported = function () {
+ return true;
+ };
+ BufferedReader.prototype.mark = function (readAheadLimit) {
+ if (readAheadLimit < 0) {
+ throw new java.lang.IllegalArgumentException("Read-ahead limit < 0");
+ }
+ this.ensureOpen();
+ this.readAheadLimit = readAheadLimit;
+ this.markedChar = this.nextChar;
+ this.markedSkipLF = this.skipLF;
+ };
+ BufferedReader.prototype.reset = function () {
+ this.ensureOpen();
+ if (this.markedChar < 0)
+ throw new java.io.IOException((this.markedChar === BufferedReader.INVALIDATED) ? "Mark invalid" : "Stream not marked");
+ this.nextChar = this.markedChar;
+ this.skipLF = this.markedSkipLF;
+ };
+ BufferedReader.prototype.close = function () {
+ if (this["in"] == null)
+ return;
+ try {
+ this["in"].close();
+ }
+ finally {
+ this["in"] = null;
+ this.cb = null;
+ }
+ ;
+ };
+ BufferedReader.INVALIDATED = -2;
+ BufferedReader.UNMARKED = -1;
+ BufferedReader.defaultCharBufferSize = 8192;
+ BufferedReader.defaultExpectedLineLength = 80;
+ return BufferedReader;
+ }(java.io.Reader));
+ io.BufferedReader = BufferedReader;
+ BufferedReader["__class"] = "java.io.BufferedReader";
+ BufferedReader["__interfaces"] = ["java.io.Closeable", "java.lang.AutoCloseable"];
+ })(io = java.io || (java.io = {}));
+})(java || (java = {}));
+(function (java) {
+ var io;
+ (function (io) {
+ /**
+ * JSweet implementation.
+ * @param {java.io.InputStream} in
+ * @param {string} charsetName
+ * @class
+ * @extends java.io.Reader
+ */
+ var InputStreamReader = /** @class */ (function (_super) {
+ __extends(InputStreamReader, _super);
+ function InputStreamReader(__in, charsetName) {
+ var _this = this;
+ if (((__in != null && __in instanceof java.io.InputStream) || __in === null) && ((typeof charsetName === 'string') || charsetName === null)) {
+ var __args = arguments;
+ _this = _super.call(this, __in) || this;
+ if (_this["in"] === undefined) {
+ _this["in"] = null;
+ }
+ _this["in"] = __in;
+ }
+ else if (((__in != null && __in instanceof java.io.InputStream) || __in === null) && ((charsetName != null && charsetName instanceof java.nio.charset.Charset) || charsetName === null)) {
+ var __args = arguments;
+ var cs = __args[1];
+ _this = _super.call(this, __in) || this;
+ if (_this["in"] === undefined) {
+ _this["in"] = null;
+ }
+ _this["in"] = __in;
+ if (cs == null)
+ throw new java.lang.NullPointerException("charset");
+ }
+ else if (((__in != null && __in instanceof java.io.InputStream) || __in === null) && charsetName === undefined) {
+ var __args = arguments;
+ _this = _super.call(this, __in) || this;
+ if (_this["in"] === undefined) {
+ _this["in"] = null;
+ }
+ _this["in"] = __in;
+ }
+ else
+ throw new Error('invalid overload');
+ return _this;
+ }
+ InputStreamReader.prototype.read$char_A$int$int = function (cbuf, offset, length) {
+ var buf = (function (s) { var a = []; while (s-- > 0)
+ a.push(0); return a; })(length - offset);
+ var success = this["in"].read$byte_A$int$int(buf, 0, length);
+ if (success > 0) {
+ for (var i = 0; i < success; ++i) {
+ {
+ cbuf[i + offset] = (String.fromCharCode(buf[i])).charAt(0);
+ }
+ ;
+ }
+ }
+ return success;
+ };
+ InputStreamReader.prototype.read = function (cbuf, offset, length) {
+ if (((cbuf != null && cbuf instanceof Array && (cbuf.length == 0 || cbuf[0] == null || (typeof cbuf[0] === 'string'))) || cbuf === null) && ((typeof offset === 'number') || offset === null) && ((typeof length === 'number') || length === null)) {
+ return this.read$char_A$int$int(cbuf, offset, length);
+ }
+ else if (((cbuf != null && cbuf instanceof Array && (cbuf.length == 0 || cbuf[0] == null || (typeof cbuf[0] === 'string'))) || cbuf === null) && offset === undefined && length === undefined) {
+ return this.read$char_A(cbuf);
+ }
+ else if (cbuf === undefined && offset === undefined && length === undefined) {
+ return this.read$();
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ InputStreamReader.prototype.ready = function () {
+ return this["in"].available() > 0;
+ };
+ InputStreamReader.prototype.close = function () {
+ this["in"].close();
+ };
+ return InputStreamReader;
+ }(java.io.Reader));
+ io.InputStreamReader = InputStreamReader;
+ InputStreamReader["__class"] = "java.io.InputStreamReader";
+ InputStreamReader["__interfaces"] = ["java.io.Closeable", "java.lang.AutoCloseable"];
+ })(io = java.io || (java.io = {}));
+})(java || (java = {}));
+(function (java) {
+ var io;
+ (function (io) {
+ var StringReader = /** @class */ (function (_super) {
+ __extends(StringReader, _super);
+ function StringReader(start) {
+ var _this = _super.call(this) || this;
+ if (_this.charArray === undefined) {
+ _this.charArray = null;
+ }
+ if (_this.where === undefined) {
+ _this.where = 0;
+ }
+ _this.marked = -1;
+ if (_this.markedLen === undefined) {
+ _this.markedLen = 0;
+ }
+ _this.charArray = /* toCharArray */ (start).split('');
+ return _this;
+ }
+ StringReader.prototype.read$char_A$int$int = function (cbuf, off, len) {
+ if ((off < 0) || (off > cbuf.length) || (len < 0) || ((off + len) > cbuf.length) || ((off + len) < 0)) {
+ throw new java.lang.IndexOutOfBoundsException();
+ }
+ else if (len === 0) {
+ return 0;
+ }
+ if (this.where === this.charArray.length)
+ return -1;
+ var size = Math.min(this.charArray.length - this.where, len);
+ java.lang.System.arraycopy(this.charArray, this.where, cbuf, off, size);
+ this.where += size;
+ return size;
+ };
+ /**
+ *
+ * @param {Array} cbuf
+ * @param {number} off
+ * @param {number} len
+ * @return {number}
+ */
+ StringReader.prototype.read = function (cbuf, off, len) {
+ if (((cbuf != null && cbuf instanceof Array && (cbuf.length == 0 || cbuf[0] == null || (typeof cbuf[0] === 'string'))) || cbuf === null) && ((typeof off === 'number') || off === null) && ((typeof len === 'number') || len === null)) {
+ return this.read$char_A$int$int(cbuf, off, len);
+ }
+ else if (((cbuf != null && cbuf instanceof Array && (cbuf.length == 0 || cbuf[0] == null || (typeof cbuf[0] === 'string'))) || cbuf === null) && off === undefined && len === undefined) {
+ return this.read$char_A(cbuf);
+ }
+ else if (cbuf === undefined && off === undefined && len === undefined) {
+ return this.read$();
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ /**
+ *
+ */
+ StringReader.prototype.close = function () {
+ this.where = this.charArray.length;
+ };
+ /**
+ *
+ * @return {boolean}
+ */
+ StringReader.prototype.ready = function () {
+ return this.where < this.charArray.length;
+ };
+ /**
+ *
+ * @return {boolean}
+ */
+ StringReader.prototype.markSupported = function () {
+ return true;
+ };
+ /**
+ *
+ * @param {number} readAheadLimit
+ */
+ StringReader.prototype.mark = function (readAheadLimit) {
+ this.marked = this.where;
+ this.markedLen = readAheadLimit;
+ };
+ /**
+ *
+ */
+ StringReader.prototype.reset = function () {
+ if (this.marked === -1 || this.where > this.marked + this.markedLen) {
+ throw new java.io.IOException("The stream not been marked or mark has been invalidated");
+ }
+ this.where = this.marked;
+ };
+ return StringReader;
+ }(java.io.Reader));
+ io.StringReader = StringReader;
+ StringReader["__class"] = "java.io.StringReader";
+ StringReader["__interfaces"] = ["java.io.Closeable", "java.lang.AutoCloseable"];
+ })(io = java.io || (java.io = {}));
+})(java || (java = {}));
+(function (java) {
+ var io;
+ (function (io) {
+ /**
+ * Constructs a new {@code FilterOutputStream} with {@code out} as its
+ * target stream.
+ *
+ * @param {java.io.OutputStream} out
+ * the target stream that this stream writes to.
+ * @class
+ * @extends java.io.OutputStream
+ */
+ var FilterOutputStream = /** @class */ (function (_super) {
+ __extends(FilterOutputStream, _super);
+ function FilterOutputStream(out) {
+ var _this = _super.call(this) || this;
+ if (_this.out === undefined) {
+ _this.out = null;
+ }
+ _this.out = out;
+ return _this;
+ }
+ /**
+ * Closes this stream. This implementation closes the target stream.
+ *
+ * @throws IOException
+ * if an error occurs attempting to close this stream.
+ */
+ FilterOutputStream.prototype.close = function () {
+ var thrown = null;
+ try {
+ this.flush();
+ }
+ catch (e) {
+ thrown = e;
+ }
+ ;
+ try {
+ this.out.close();
+ }
+ catch (e) {
+ if (thrown == null) {
+ thrown = e;
+ }
+ }
+ ;
+ if (thrown != null) {
+ throw new java.io.IOException(thrown);
+ }
+ };
+ /**
+ * Ensures that all pending data is sent out to the target stream. This
+ * implementation flushes the target stream.
+ *
+ * @throws IOException
+ * if an error occurs attempting to flush this stream.
+ */
+ FilterOutputStream.prototype.flush = function () {
+ this.out.flush();
+ };
+ FilterOutputStream.prototype.write = function (buffer, offset, count) {
+ if (((buffer != null && buffer instanceof Array && (buffer.length == 0 || buffer[0] == null || (typeof buffer[0] === 'number'))) || buffer === null) && ((typeof offset === 'number') || offset === null) && ((typeof count === 'number') || count === null)) {
+ _super.prototype.write.call(this, buffer, offset, count);
+ }
+ else if (((buffer != null && buffer instanceof Array && (buffer.length == 0 || buffer[0] == null || (typeof buffer[0] === 'number'))) || buffer === null) && offset === undefined && count === undefined) {
+ return this.write$byte_A(buffer);
+ }
+ else if (((typeof buffer === 'number') || buffer === null) && offset === undefined && count === undefined) {
+ return this.write$int(buffer);
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ FilterOutputStream.prototype.write$int = function (oneByte) {
+ this.out.write$int(oneByte);
+ };
+ return FilterOutputStream;
+ }(java.io.OutputStream));
+ io.FilterOutputStream = FilterOutputStream;
+ FilterOutputStream["__class"] = "java.io.FilterOutputStream";
+ FilterOutputStream["__interfaces"] = ["java.io.Closeable", "java.lang.AutoCloseable", "java.io.Flushable"];
+ })(io = java.io || (java.io = {}));
+})(java || (java = {}));
+(function (java) {
+ var io;
+ (function (io) {
+ /**
+ * Constructs a new {@code ByteArrayOutputStream} with a default size of
+ * {@code size} bytes. If more than {@code size} bytes are written to this
+ * instance, the underlying byte array will expand.
+ *
+ * @param {number} size
+ * initial size for the underlying byte array, must be
+ * non-negative.
+ * @throws IllegalArgumentException
+ * if {@code size} < 0.
+ * @class
+ * @extends java.io.OutputStream
+ */
+ var ByteArrayOutputStream = /** @class */ (function (_super) {
+ __extends(ByteArrayOutputStream, _super);
+ function ByteArrayOutputStream(size) {
+ var _this = this;
+ if (((typeof size === 'number') || size === null)) {
+ var __args = arguments;
+ _this = _super.call(this) || this;
+ if (_this.buf === undefined) {
+ _this.buf = null;
+ }
+ if (_this.count === undefined) {
+ _this.count = 0;
+ }
+ if (size >= 0) {
+ _this.buf = (function (s) { var a = []; while (s-- > 0)
+ a.push(0); return a; })(size);
+ }
+ else {
+ throw new java.lang.IllegalArgumentException("size < 0");
+ }
+ }
+ else if (size === undefined) {
+ var __args = arguments;
+ _this = _super.call(this) || this;
+ if (_this.buf === undefined) {
+ _this.buf = null;
+ }
+ if (_this.count === undefined) {
+ _this.count = 0;
+ }
+ _this.buf = (function (s) { var a = []; while (s-- > 0)
+ a.push(0); return a; })(32);
+ }
+ else
+ throw new Error('invalid overload');
+ return _this;
+ }
+ /**
+ * Closes this stream. This releases system resources used for this stream.
+ *
+ * @throws IOException
+ * if an error occurs while attempting to close this stream.
+ */
+ ByteArrayOutputStream.prototype.close = function () {
+ _super.prototype.close.call(this);
+ };
+ /*private*/ ByteArrayOutputStream.prototype.expand = function (i) {
+ if (this.count + i <= this.buf.length) {
+ return;
+ }
+ var newbuf = (function (s) { var a = []; while (s-- > 0)
+ a.push(0); return a; })((this.count + i) * 2);
+ java.lang.System.arraycopy(this.buf, 0, newbuf, 0, this.count);
+ this.buf = newbuf;
+ };
+ /**
+ * Resets this stream to the beginning of the underlying byte array. All
+ * subsequent writes will overwrite any bytes previously stored in this
+ * stream.
+ */
+ ByteArrayOutputStream.prototype.reset = function () {
+ this.count = 0;
+ };
+ /**
+ * Returns the total number of bytes written to this stream so far.
+ *
+ * @return {number} the number of bytes written to this stream.
+ */
+ ByteArrayOutputStream.prototype.size = function () {
+ return this.count;
+ };
+ /**
+ * Returns the contents of this ByteArrayOutputStream as a byte array. Any
+ * changes made to the receiver after returning will not be reflected in the
+ * byte array returned to the caller.
+ *
+ * @return {Array} this stream's current contents as a byte array.
+ */
+ ByteArrayOutputStream.prototype.toByteArray = function () {
+ var newArray = (function (s) { var a = []; while (s-- > 0)
+ a.push(0); return a; })(this.count);
+ java.lang.System.arraycopy(this.buf, 0, newArray, 0, this.count);
+ return newArray;
+ };
+ ByteArrayOutputStream.prototype.toString$ = function () {
+ return (function (str, index, len) { return str.substring(index, index + len); })((this.buf).map(function (s) { return String.fromCharCode(s); }).join(''), 0, this.count);
+ };
+ ByteArrayOutputStream.prototype.toString$int = function (hibyte) {
+ var newBuf = (function (s) { var a = []; while (s-- > 0)
+ a.push(null); return a; })(this.size());
+ for (var i = 0; i < newBuf.length; i++) {
+ {
+ newBuf[i] = String.fromCharCode((((hibyte & 255) << 8) | (this.buf[i] & 255)));
+ }
+ ;
+ }
+ return new String(newBuf);
+ };
+ ByteArrayOutputStream.prototype.toString$java_lang_String = function (charsetName) {
+ return (function (str, index, len) { return str.substring(index, index + len); })((this.buf).map(function (s) { return String.fromCharCode(s); }).join(''), 0, this.count);
+ };
+ /**
+ * Returns the contents of this ByteArrayOutputStream as a string converted
+ * according to the encoding declared in {@code charsetName}.
+ *
+ * @param {string} charsetName
+ * a string representing the encoding to use when translating
+ * this stream to a string.
+ * @return {string} this stream's current contents as an encoded string.
+ * @throws UnsupportedEncodingException
+ * if the provided encoding is not supported.
+ */
+ ByteArrayOutputStream.prototype.toString = function (charsetName) {
+ if (((typeof charsetName === 'string') || charsetName === null)) {
+ return this.toString$java_lang_String(charsetName);
+ }
+ else if (((typeof charsetName === 'number') || charsetName === null)) {
+ return this.toString$int(charsetName);
+ }
+ else if (charsetName === undefined) {
+ return this.toString$();
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ ByteArrayOutputStream.prototype.write$byte_A$int$int = function (buffer, offset, len) {
+ java.io.IOUtils.checkOffsetAndCount$byte_A$int$int(buffer, offset, len);
+ if (len === 0) {
+ return;
+ }
+ this.expand(len);
+ java.lang.System.arraycopy(buffer, offset, this.buf, this.count, len);
+ this.count += len;
+ };
+ /**
+ * Writes {@code count} bytes from the byte array {@code buffer} starting at
+ * offset {@code index} to this stream.
+ *
+ * @param {Array} buffer
+ * the buffer to be written.
+ * @param {number} offset
+ * the initial position in {@code buffer} to retrieve bytes.
+ * @param {number} len
+ * the number of bytes of {@code buffer} to write.
+ * @throws NullPointerException
+ * if {@code buffer} is {@code null}.
+ * @throws IndexOutOfBoundsException
+ * if {@code offset < 0} or {@code len < 0}, or if
+ * {@code offset + len} is greater than the length of
+ * {@code buffer}.
+ */
+ ByteArrayOutputStream.prototype.write = function (buffer, offset, len) {
+ if (((buffer != null && buffer instanceof Array && (buffer.length == 0 || buffer[0] == null || (typeof buffer[0] === 'number'))) || buffer === null) && ((typeof offset === 'number') || offset === null) && ((typeof len === 'number') || len === null)) {
+ return this.write$byte_A$int$int(buffer, offset, len);
+ }
+ else if (((buffer != null && buffer instanceof Array && (buffer.length == 0 || buffer[0] == null || (typeof buffer[0] === 'number'))) || buffer === null) && offset === undefined && len === undefined) {
+ return this.write$byte_A(buffer);
+ }
+ else if (((typeof buffer === 'number') || buffer === null) && offset === undefined && len === undefined) {
+ return this.write$int(buffer);
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ ByteArrayOutputStream.prototype.write$int = function (oneByte) {
+ if (this.count === this.buf.length) {
+ this.expand(1);
+ }
+ this.buf[this.count++] = (oneByte | 0);
+ };
+ /**
+ * Takes the contents of this stream and writes it to the output stream
+ * {@code out}.
+ *
+ * @param {java.io.OutputStream} out
+ * an OutputStream on which to write the contents of this stream.
+ * @throws IOException
+ * if an error occurs while writing to {@code out}.
+ */
+ ByteArrayOutputStream.prototype.writeTo = function (out) {
+ out.write$byte_A$int$int(this.buf, 0, this.count);
+ };
+ return ByteArrayOutputStream;
+ }(java.io.OutputStream));
+ io.ByteArrayOutputStream = ByteArrayOutputStream;
+ ByteArrayOutputStream["__class"] = "java.io.ByteArrayOutputStream";
+ ByteArrayOutputStream["__interfaces"] = ["java.io.Closeable", "java.lang.AutoCloseable", "java.io.Flushable"];
+ })(io = java.io || (java.io = {}));
+})(java || (java = {}));
+(function (java) {
+ var lang;
+ (function (lang) {
+ var ref;
+ (function (ref) {
+ /**
+ * This implements the reference API in a minimal way. In JavaScript, there is
+ * no control over the reference and the GC. So this implementation's only
+ * purpose is for compilation.
+ * @param {*} referent
+ * @class
+ * @extends java.lang.ref.Reference
+ */
+ var WeakReference = /** @class */ (function (_super) {
+ __extends(WeakReference, _super);
+ function WeakReference(referent) {
+ return _super.call(this, referent) || this;
+ }
+ return WeakReference;
+ }(java.lang.ref.Reference));
+ ref.WeakReference = WeakReference;
+ WeakReference["__class"] = "java.lang.ref.WeakReference";
+ })(ref = lang.ref || (lang.ref = {}));
+ })(lang = java.lang || (java.lang = {}));
+})(java || (java = {}));
+(function (java) {
+ var lang;
+ (function (lang) {
+ /**
+ * Constructs an {@code InternalError} with the specified detail
+ * message and cause. Note that the detail message associated
+ * with {@code cause} is not automatically incorporated in
+ * this error's detail message.
+ *
+ * @param {string} message the detail message (which is saved for later retrieval
+ * by the {@link #getMessage()} method).
+ * @param {java.lang.Throwable} cause the cause (which is saved for later retrieval by the
+ * {@link #getCause()} method). (A {@code null} value is
+ * permitted, and indicates that the cause is nonexistent or
+ * unknown.)
+ * @since 1.8
+ * @class
+ * @extends java.lang.VirtualMachineError
+ * @author unascribed
+ */
+ var InternalError = /** @class */ (function (_super) {
+ __extends(InternalError, _super);
+ function InternalError(message, cause) {
+ var _this = this;
+ if (((typeof message === 'string') || message === null) && ((cause != null && cause instanceof Error) || cause === null)) {
+ var __args = arguments;
+ _this = _super.call(this, message, cause) || this;
+ }
+ else if (((typeof message === 'string') || message === null) && cause === undefined) {
+ var __args = arguments;
+ _this = _super.call(this, message) || this;
+ }
+ else if (((message != null && message instanceof Error) || message === null) && cause === undefined) {
+ var __args = arguments;
+ var cause_5 = __args[0];
+ _this = _super.call(this, cause_5) || this;
+ }
+ else if (message === undefined && cause === undefined) {
+ var __args = arguments;
+ _this = _super.call(this) || this;
+ }
+ else
+ throw new Error('invalid overload');
+ return _this;
+ }
+ InternalError.__java_lang_InternalError_serialVersionUID = -9062593416125562365;
+ return InternalError;
+ }(java.lang.VirtualMachineError));
+ lang.InternalError = InternalError;
+ InternalError["__class"] = "java.lang.InternalError";
+ InternalError["__interfaces"] = ["java.io.Serializable"];
+ })(lang = java.lang || (java.lang = {}));
+})(java || (java = {}));
+(function (java) {
+ var util;
+ (function (util) {
+ /**
+ * Thrown when the subject of an observer cannot support additional observers.
+ *
+ * @param {string} message
+ * @class
+ * @extends java.lang.Exception
+ */
+ var TooManyListenersException = /** @class */ (function (_super) {
+ __extends(TooManyListenersException, _super);
+ function TooManyListenersException(message) {
+ var _this = this;
+ if (((typeof message === 'string') || message === null)) {
+ var __args = arguments;
+ _this = _super.call(this, message) || this;
+ _this.message = message;
+ }
+ else if (message === undefined) {
+ var __args = arguments;
+ _this = _super.call(this) || this;
+ }
+ else
+ throw new Error('invalid overload');
+ return _this;
+ }
+ return TooManyListenersException;
+ }(Error));
+ util.TooManyListenersException = TooManyListenersException;
+ TooManyListenersException["__class"] = "java.util.TooManyListenersException";
+ TooManyListenersException["__interfaces"] = ["java.io.Serializable"];
+ })(util = java.util || (java.util = {}));
+})(java || (java = {}));
+(function (java) {
+ var security;
+ (function (security) {
+ /**
+ * A generic security exception type - [Sun's
+ * docs].
+ * @param {string} msg
+ * @class
+ * @extends java.lang.Exception
+ */
+ var GeneralSecurityException = /** @class */ (function (_super) {
+ __extends(GeneralSecurityException, _super);
+ function GeneralSecurityException(msg) {
+ var _this = this;
+ if (((typeof msg === 'string') || msg === null)) {
+ var __args = arguments;
+ _this = _super.call(this, msg) || this;
+ _this.message = msg;
+ }
+ else if (msg === undefined) {
+ var __args = arguments;
+ _this = _super.call(this) || this;
+ }
+ else
+ throw new Error('invalid overload');
+ return _this;
+ }
+ return GeneralSecurityException;
+ }(Error));
+ security.GeneralSecurityException = GeneralSecurityException;
+ GeneralSecurityException["__class"] = "java.security.GeneralSecurityException";
+ GeneralSecurityException["__interfaces"] = ["java.io.Serializable"];
+ })(security = java.security || (java.security = {}));
+})(java || (java = {}));
+(function (java) {
+ var io;
+ (function (io) {
+ /**
+ * See the
+ * official Java API doc for details.
+ * @param {string} message
+ * @param {java.lang.Throwable} throwable
+ * @class
+ * @extends java.lang.Exception
+ */
+ var IOException = /** @class */ (function (_super) {
+ __extends(IOException, _super);
+ function IOException(message, throwable) {
+ var _this = this;
+ if (((typeof message === 'string') || message === null) && ((throwable != null && throwable instanceof Error) || throwable === null)) {
+ var __args = arguments;
+ _this = _super.call(this, message) || this;
+ _this.message = message;
+ }
+ else if (((typeof message === 'string') || message === null) && throwable === undefined) {
+ var __args = arguments;
+ _this = _super.call(this, message) || this;
+ _this.message = message;
+ }
+ else if (((message != null && message instanceof Error) || message === null) && throwable === undefined) {
+ var __args = arguments;
+ var throwable_1 = __args[0];
+ _this = _super.call(this, throwable_1) || this;
+ _this.message = throwable_1;
+ }
+ else if (message === undefined && throwable === undefined) {
+ var __args = arguments;
+ _this = _super.call(this) || this;
+ }
+ else
+ throw new Error('invalid overload');
+ return _this;
+ }
+ return IOException;
+ }(Error));
+ io.IOException = IOException;
+ IOException["__class"] = "java.io.IOException";
+ IOException["__interfaces"] = ["java.io.Serializable"];
+ })(io = java.io || (java.io = {}));
+})(java || (java = {}));
+(function (java) {
+ var lang;
+ (function (lang) {
+ /**
+ * See the
+ * official Java API doc for details.
+ * @param {string} message
+ * @param {java.lang.Throwable} cause
+ * @class
+ * @extends java.lang.Exception
+ */
+ var RuntimeException = /** @class */ (function (_super) {
+ __extends(RuntimeException, _super);
+ function RuntimeException(message, cause, enableSuppression, writableStackTrace) {
+ var _this = this;
+ if (((typeof message === 'string') || message === null) && ((cause != null && cause instanceof Error) || cause === null) && ((typeof enableSuppression === 'boolean') || enableSuppression === null) && ((typeof writableStackTrace === 'boolean') || writableStackTrace === null)) {
+ var __args = arguments;
+ _this = _super.call(this, message) || this;
+ _this.message = message;
+ }
+ else if (((typeof message === 'string') || message === null) && ((cause != null && cause instanceof Error) || cause === null) && enableSuppression === undefined && writableStackTrace === undefined) {
+ var __args = arguments;
+ _this = _super.call(this, message) || this;
+ _this.message = message;
+ }
+ else if (((typeof message === 'string') || message === null) && cause === undefined && enableSuppression === undefined && writableStackTrace === undefined) {
+ var __args = arguments;
+ _this = _super.call(this, message) || this;
+ _this.message = message;
+ }
+ else if (((message != null && message instanceof Error) || message === null) && cause === undefined && enableSuppression === undefined && writableStackTrace === undefined) {
+ var __args = arguments;
+ var cause_6 = __args[0];
+ _this = _super.call(this, cause_6) || this;
+ _this.message = cause_6;
+ }
+ else if (message === undefined && cause === undefined && enableSuppression === undefined && writableStackTrace === undefined) {
+ var __args = arguments;
+ _this = _super.call(this) || this;
+ }
+ else
+ throw new Error('invalid overload');
+ return _this;
+ }
+ return RuntimeException;
+ }(Error));
+ lang.RuntimeException = RuntimeException;
+ RuntimeException["__class"] = "java.lang.RuntimeException";
+ RuntimeException["__interfaces"] = ["java.io.Serializable"];
+ })(lang = java.lang || (java.lang = {}));
+})(java || (java = {}));
+(function (java) {
+ var lang;
+ (function (lang) {
+ /**
+ * See
+ * the official Java API doc for details.
+ * @param {string} msg
+ * @class
+ * @extends java.lang.Exception
+ */
+ var CloneNotSupportedException = /** @class */ (function (_super) {
+ __extends(CloneNotSupportedException, _super);
+ function CloneNotSupportedException(msg) {
+ var _this = this;
+ if (((typeof msg === 'string') || msg === null)) {
+ var __args = arguments;
+ _this = _super.call(this, msg) || this;
+ _this.message = msg;
+ }
+ else if (msg === undefined) {
+ var __args = arguments;
+ _this = _super.call(this) || this;
+ }
+ else
+ throw new Error('invalid overload');
+ return _this;
+ }
+ return CloneNotSupportedException;
+ }(Error));
+ lang.CloneNotSupportedException = CloneNotSupportedException;
+ CloneNotSupportedException["__class"] = "java.lang.CloneNotSupportedException";
+ CloneNotSupportedException["__interfaces"] = ["java.io.Serializable"];
+ })(lang = java.lang || (java.lang = {}));
+})(java || (java = {}));
+(function (java) {
+ var lang;
+ (function (lang) {
+ /**
+ * Constructs an
+ * This implementation differs from JDK 1.5
+ * See the
+ * official Java API doc for details.
+ * @param {string} explanation
+ * @class
+ * @extends java.lang.RuntimeException
+ */
+ var ArithmeticException = /** @class */ (function (_super) {
+ __extends(ArithmeticException, _super);
+ function ArithmeticException(explanation) {
+ var _this = this;
+ if (((typeof explanation === 'string') || explanation === null)) {
+ var __args = arguments;
+ _this = _super.call(this, explanation) || this;
+ }
+ else if (explanation === undefined) {
+ var __args = arguments;
+ _this = _super.call(this) || this;
+ }
+ else
+ throw new Error('invalid overload');
+ return _this;
+ }
+ return ArithmeticException;
+ }(java.lang.RuntimeException));
+ lang.ArithmeticException = ArithmeticException;
+ ArithmeticException["__class"] = "java.lang.ArithmeticException";
+ ArithmeticException["__interfaces"] = ["java.io.Serializable"];
+ })(lang = java.lang || (java.lang = {}));
+})(java || (java = {}));
+(function (java) {
+ var lang;
+ (function (lang) {
+ /**
+ * See the
+ * official Java API doc for details.
+ * @param {string} message
+ * @param {java.lang.Throwable} cause
+ * @class
+ * @extends java.lang.RuntimeException
+ */
+ var UnsupportedOperationException = /** @class */ (function (_super) {
+ __extends(UnsupportedOperationException, _super);
+ function UnsupportedOperationException(message, cause) {
+ var _this = this;
+ if (((typeof message === 'string') || message === null) && ((cause != null && cause instanceof Error) || cause === null)) {
+ var __args = arguments;
+ _this = _super.call(this, message, cause) || this;
+ }
+ else if (((typeof message === 'string') || message === null) && cause === undefined) {
+ var __args = arguments;
+ _this = _super.call(this, message) || this;
+ }
+ else if (((message != null && message instanceof Error) || message === null) && cause === undefined) {
+ var __args = arguments;
+ var cause_11 = __args[0];
+ _this = _super.call(this, cause_11) || this;
+ }
+ else if (message === undefined && cause === undefined) {
+ var __args = arguments;
+ _this = _super.call(this) || this;
+ }
+ else
+ throw new Error('invalid overload');
+ return _this;
+ }
+ return UnsupportedOperationException;
+ }(java.lang.RuntimeException));
+ lang.UnsupportedOperationException = UnsupportedOperationException;
+ UnsupportedOperationException["__class"] = "java.lang.UnsupportedOperationException";
+ UnsupportedOperationException["__interfaces"] = ["java.io.Serializable"];
+ })(lang = java.lang || (java.lang = {}));
+})(java || (java = {}));
+(function (java) {
+ var lang;
+ (function (lang) {
+ /**
+ * See the
+ * official Java API doc for details.
+ * @param {string} message
+ * @class
+ * @extends java.lang.RuntimeException
+ */
+ var IndexOutOfBoundsException = /** @class */ (function (_super) {
+ __extends(IndexOutOfBoundsException, _super);
+ function IndexOutOfBoundsException(message) {
+ var _this = this;
+ if (((typeof message === 'string') || message === null)) {
+ var __args = arguments;
+ _this = _super.call(this, message) || this;
+ }
+ else if (message === undefined) {
+ var __args = arguments;
+ _this = _super.call(this) || this;
+ }
+ else
+ throw new Error('invalid overload');
+ return _this;
+ }
+ return IndexOutOfBoundsException;
+ }(java.lang.RuntimeException));
+ lang.IndexOutOfBoundsException = IndexOutOfBoundsException;
+ IndexOutOfBoundsException["__class"] = "java.lang.IndexOutOfBoundsException";
+ IndexOutOfBoundsException["__interfaces"] = ["java.io.Serializable"];
+ })(lang = java.lang || (java.lang = {}));
+})(java || (java = {}));
+(function (java) {
+ var nio;
+ (function (nio) {
+ var BufferUnderflowException = /** @class */ (function (_super) {
+ __extends(BufferUnderflowException, _super);
+ function BufferUnderflowException() {
+ var _this = _super.call(this) || this;
+ Object.setPrototypeOf(_this, BufferUnderflowException.prototype);
+ return _this;
+ }
+ return BufferUnderflowException;
+ }(java.lang.RuntimeException));
+ nio.BufferUnderflowException = BufferUnderflowException;
+ BufferUnderflowException["__class"] = "java.nio.BufferUnderflowException";
+ BufferUnderflowException["__interfaces"] = ["java.io.Serializable"];
+ })(nio = java.nio || (java.nio = {}));
+})(java || (java = {}));
+(function (java) {
+ var nio;
+ (function (nio) {
+ var BufferOverflowException = /** @class */ (function (_super) {
+ __extends(BufferOverflowException, _super);
+ function BufferOverflowException() {
+ var _this = _super.call(this) || this;
+ Object.setPrototypeOf(_this, BufferOverflowException.prototype);
+ return _this;
+ }
+ return BufferOverflowException;
+ }(java.lang.RuntimeException));
+ nio.BufferOverflowException = BufferOverflowException;
+ BufferOverflowException["__class"] = "java.nio.BufferOverflowException";
+ BufferOverflowException["__interfaces"] = ["java.io.Serializable"];
+ })(nio = java.nio || (java.nio = {}));
+})(java || (java = {}));
+(function (java) {
+ var lang;
+ (function (lang) {
+ var InstantiationException = /** @class */ (function (_super) {
+ __extends(InstantiationException, _super);
+ function InstantiationException(s) {
+ var _this = this;
+ if (((typeof s === 'string') || s === null)) {
+ var __args = arguments;
+ _this = _super.call(this, s) || this;
+ }
+ else if (s === undefined) {
+ var __args = arguments;
+ _this = _super.call(this) || this;
+ }
+ else
+ throw new Error('invalid overload');
+ return _this;
+ }
+ return InstantiationException;
+ }(java.lang.ReflectiveOperationException));
+ lang.InstantiationException = InstantiationException;
+ InstantiationException["__class"] = "java.lang.InstantiationException";
+ InstantiationException["__interfaces"] = ["java.io.Serializable"];
+ })(lang = java.lang || (java.lang = {}));
+})(java || (java = {}));
+(function (java) {
+ var nio;
+ (function (nio) {
+ var charset;
+ (function (charset) {
+ /**
+ * Constant definitions for the standard Charsets.
+ * @class
+ */
+ var StandardCharsets = /** @class */ (function () {
+ function StandardCharsets() {
+ }
+ StandardCharsets.ISO_8859_1_$LI$ = function () { if (StandardCharsets.ISO_8859_1 == null) {
+ StandardCharsets.ISO_8859_1 = javaemul.internal.EmulatedCharset.ISO_8859_1_$LI$();
+ } return StandardCharsets.ISO_8859_1; };
+ ;
+ StandardCharsets.UTF_8_$LI$ = function () { if (StandardCharsets.UTF_8 == null) {
+ StandardCharsets.UTF_8 = javaemul.internal.EmulatedCharset.UTF_8_$LI$();
+ } return StandardCharsets.UTF_8; };
+ ;
+ return StandardCharsets;
+ }());
+ charset.StandardCharsets = StandardCharsets;
+ StandardCharsets["__class"] = "java.nio.charset.StandardCharsets";
+ })(charset = nio.charset || (nio.charset = {}));
+ })(nio = java.nio || (java.nio = {}));
+})(java || (java = {}));
+(function (java) {
+ var util;
+ (function (util) {
+ /**
+ * Implementation of Map interface based on a hash table.
+ * [Sun
+ * docs]
+ *
+ * @param
+ * Note: The GWT implementation differs from the JDK implementation in that it
+ * does not do an iterator-based binary search for Lists that do not implement
+ * RandomAccess.
+ *
+ * e.g. for a given list with elements [1, 2, 3, 4, 5, 6, 7, 8, 9, 0], calling
+ * rotate(list, 3) or rotate(list, -7) would modify the list to look like this:
+ * [8, 9, 0, 1, 2, 3, 4, 5, 6, 7]
+ *
+ * @param {*} lst
+ * the list whose elements are to be rotated.
+ * @param {number} dist
+ * is the distance the list is rotated. This can be any valid
+ * integer. Negative values rotate the list backwards.
+ */
+ Collections.rotate = function (lst, dist) {
+ javaemul.internal.InternalPreconditions.checkNotNull(lst);
+ var size = lst.size();
+ if (size === 0) {
+ return;
+ }
+ var normdist = dist % size;
+ if (normdist === 0) {
+ return;
+ }
+ if (normdist < 0) {
+ normdist += size;
+ }
+ if (lst != null && (lst["__interfaces"] != null && lst["__interfaces"].indexOf("java.util.RandomAccess") >= 0 || lst.constructor != null && lst.constructor["__interfaces"] != null && lst.constructor["__interfaces"].indexOf("java.util.RandomAccess") >= 0)) {
+ var list = lst;
+ var temp = list.get(0);
+ var index = 0;
+ var beginIndex = 0;
+ for (var i = 0; i < size; i++) {
+ {
+ index = (index + normdist) % size;
+ temp = list.set(index, temp);
+ if (index === beginIndex) {
+ index = ++beginIndex;
+ temp = list.get(beginIndex);
+ }
+ }
+ ;
+ }
+ }
+ else {
+ var divideIndex = size - normdist;
+ var sublist1 = lst.subList(0, divideIndex);
+ var sublist2 = lst.subList(divideIndex, size);
+ Collections.reverse(sublist1);
+ Collections.reverse(sublist2);
+ Collections.reverse(lst);
+ }
+ };
+ Collections.shuffle = function (list, rnd) {
+ if (rnd === void 0) { rnd = Collections.RandomHolder.rnd_$LI$(); }
+ if (list != null && (list["__interfaces"] != null && list["__interfaces"].indexOf("java.util.RandomAccess") >= 0 || list.constructor != null && list.constructor["__interfaces"] != null && list.constructor["__interfaces"].indexOf("java.util.RandomAccess") >= 0)) {
+ for (var i = list.size() - 1; i >= 1; i--) {
+ {
+ Collections.swapImpl$java_util_List$int$int(list, i, rnd.nextInt$int(i + 1));
+ }
+ ;
+ }
+ }
+ else {
+ var arr = list['toArray$']();
+ for (var i = arr.length - 1; i >= 1; i--) {
+ {
+ Collections.swapImpl$java_lang_Object_A$int$int(arr, i, rnd.nextInt$int(i + 1));
+ }
+ ;
+ }
+ var it = list['listIterator$']();
+ for (var index181 = 0; index181 < arr.length; index181++) {
+ var e = arr[index181];
+ {
+ it.next();
+ it.set(e);
+ }
+ }
+ }
+ };
+ Collections.singleton = function (o) {
+ var set = (new java.util.HashSet(1));
+ set.add(o);
+ return Collections.unmodifiableSet(set);
+ };
+ Collections.singletonList = function (o) {
+ return (new Collections.SingletonList(o));
+ };
+ Collections.singletonMap = function (key, value) {
+ var map = (new java.util.HashMap(1));
+ map.put(key, value);
+ return Collections.unmodifiableMap(map);
+ };
+ Collections.sort$java_util_List = function (target) {
+ Collections.sort$java_util_List$java_util_Comparator(target, (null));
+ };
+ Collections.sort$java_util_List$java_util_Comparator = function (target, c) {
+ var x = target['toArray$']();
+ java.util.Arrays.sort$java_lang_Object_A$java_util_Comparator(x, (c));
+ Collections.replaceContents(target, x);
+ };
+ Collections.sort = function (target, c) {
+ if (((target != null && (target["__interfaces"] != null && target["__interfaces"].indexOf("java.util.List") >= 0 || target.constructor != null && target.constructor["__interfaces"] != null && target.constructor["__interfaces"].indexOf("java.util.List") >= 0)) || target === null) && ((typeof c === 'function' && c.length === 2) || c === null)) {
+ return java.util.Collections.sort$java_util_List$java_util_Comparator(target, c);
+ }
+ else if (((target != null && (target["__interfaces"] != null && target["__interfaces"].indexOf("java.util.List") >= 0 || target.constructor != null && target.constructor["__interfaces"] != null && target.constructor["__interfaces"].indexOf("java.util.List") >= 0)) || target === null) && c === undefined) {
+ return java.util.Collections.sort$java_util_List(target);
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ Collections.swap = function (list, i, j) {
+ Collections.swapImpl$java_util_List$int$int(list, i, j);
+ };
+ Collections.unmodifiableCollection = function (coll) {
+ return (new Collections.UnmodifiableCollection(coll));
+ };
+ Collections.unmodifiableList = function (list) {
+ return (list != null && (list["__interfaces"] != null && list["__interfaces"].indexOf("java.util.RandomAccess") >= 0 || list.constructor != null && list.constructor["__interfaces"] != null && list.constructor["__interfaces"].indexOf("java.util.RandomAccess") >= 0)) ? (new Collections.UnmodifiableRandomAccessList(list)) : (new Collections.UnmodifiableList(list));
+ };
+ Collections.unmodifiableMap = function (map) {
+ return (new Collections.UnmodifiableMap(map));
+ };
+ Collections.unmodifiableSet = function (set) {
+ return (new Collections.UnmodifiableSet(set));
+ };
+ Collections.unmodifiableSortedMap = function (map) {
+ return (new Collections.UnmodifiableSortedMap(map));
+ };
+ Collections.unmodifiableSortedSet = function (set) {
+ return (new Collections.UnmodifiableSortedSet(set));
+ };
+ Collections.hashCode$java_lang_Iterable = function (collection) {
+ var hashCode = 0;
+ for (var index182 = collection.iterator(); index182.hasNext();) {
+ var e = index182.next();
+ {
+ hashCode = hashCode + java.util.Objects.hashCode(e);
+ hashCode = javaemul.internal.Coercions.ensureInt(hashCode);
+ }
+ }
+ return hashCode;
+ };
+ Collections.hashCode$java_util_List = function (list) {
+ var hashCode = 1;
+ for (var index183 = list.iterator(); index183.hasNext();) {
+ var e = index183.next();
+ {
+ hashCode = 31 * hashCode + java.util.Objects.hashCode(e);
+ hashCode = javaemul.internal.Coercions.ensureInt(hashCode);
+ }
+ }
+ return hashCode;
+ };
+ /**
+ * Computes hash code preserving collection order (e.g. ArrayList).
+ * @param {*} list
+ * @return {number}
+ */
+ Collections.hashCode = function (list) {
+ if (((list != null && (list["__interfaces"] != null && list["__interfaces"].indexOf("java.util.List") >= 0 || list.constructor != null && list.constructor["__interfaces"] != null && list.constructor["__interfaces"].indexOf("java.util.List") >= 0)) || list === null)) {
+ return java.util.Collections.hashCode$java_util_List(list);
+ }
+ else if (((list != null && (list["__interfaces"] != null && list["__interfaces"].indexOf("java.lang.Iterable") >= 0 || list.constructor != null && list.constructor["__interfaces"] != null && list.constructor["__interfaces"].indexOf("java.lang.Iterable") >= 0)) || list === null)) {
+ return java.util.Collections.hashCode$java_lang_Iterable(list);
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ /**
+ * Replace contents of a list from an array.
+ *
+ * @param
+ * For cases where failing fast is pretty important and not failing early could cause bugs that
+ * are much harder to debug.
+ * @param {boolean} expression
+ * @param {*} errorMessage
+ */
+ InternalPreconditions.checkCriticalElement = function (expression, errorMessage) {
+ if (((typeof expression === 'boolean') || expression === null) && ((errorMessage != null) || errorMessage === null)) {
+ return javaemul.internal.InternalPreconditions.checkCriticalElement$boolean$java_lang_Object(expression, errorMessage);
+ }
+ else if (((typeof expression === 'boolean') || expression === null) && errorMessage === undefined) {
+ return javaemul.internal.InternalPreconditions.checkCriticalElement$boolean(expression);
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ InternalPreconditions.checkArgument$boolean = function (expression) {
+ if (InternalPreconditions.API_CHECK_$LI$()) {
+ InternalPreconditions.checkCriticalArgument$boolean(expression);
+ }
+ else if (InternalPreconditions.CHECKED_MODE_$LI$()) {
+ try {
+ InternalPreconditions.checkCriticalArgument$boolean(expression);
+ }
+ catch (e) {
+ throw new java.lang.AssertionError(e);
+ }
+ ;
+ }
+ };
+ InternalPreconditions.checkCriticalArgument$boolean = function (expression) {
+ if (!expression) {
+ throw new java.lang.IllegalArgumentException();
+ }
+ };
+ InternalPreconditions.checkArgument$boolean$java_lang_Object = function (expression, errorMessage) {
+ if (InternalPreconditions.API_CHECK_$LI$()) {
+ InternalPreconditions.checkCriticalArgument$boolean$java_lang_Object(expression, errorMessage);
+ }
+ else if (InternalPreconditions.CHECKED_MODE_$LI$()) {
+ try {
+ InternalPreconditions.checkCriticalArgument$boolean$java_lang_Object(expression, errorMessage);
+ }
+ catch (e) {
+ throw new java.lang.AssertionError(e);
+ }
+ ;
+ }
+ };
+ InternalPreconditions.checkCriticalArgument$boolean$java_lang_Object = function (expression, errorMessage) {
+ if (!expression) {
+ throw new java.lang.IllegalArgumentException(/* valueOf */ new String(errorMessage).toString());
+ }
+ };
+ InternalPreconditions.checkArgument$boolean$java_lang_String$java_lang_Object_A = function (expression, errorMessageTemplate) {
+ var errorMessageArgs = [];
+ for (var _i = 2; _i < arguments.length; _i++) {
+ errorMessageArgs[_i - 2] = arguments[_i];
+ }
+ if (InternalPreconditions.API_CHECK_$LI$()) {
+ InternalPreconditions.checkCriticalArgument$boolean$java_lang_String$java_lang_Object_A.apply(this, [expression, errorMessageTemplate].concat(errorMessageArgs));
+ }
+ else if (InternalPreconditions.CHECKED_MODE_$LI$()) {
+ try {
+ InternalPreconditions.checkCriticalArgument$boolean$java_lang_String$java_lang_Object_A.apply(this, [expression, errorMessageTemplate].concat(errorMessageArgs));
+ }
+ catch (e) {
+ throw new java.lang.AssertionError(e);
+ }
+ ;
+ }
+ };
+ /**
+ * Ensures the truth of an expression involving one or more parameters to the calling method.
+ * @param {boolean} expression
+ * @param {string} errorMessageTemplate
+ * @param {Array} errorMessageArgs
+ */
+ InternalPreconditions.checkArgument = function (expression, errorMessageTemplate) {
+ var errorMessageArgs = [];
+ for (var _i = 2; _i < arguments.length; _i++) {
+ errorMessageArgs[_i - 2] = arguments[_i];
+ }
+ if (((typeof expression === 'boolean') || expression === null) && ((typeof errorMessageTemplate === 'string') || errorMessageTemplate === null) && ((errorMessageArgs != null && errorMessageArgs instanceof Array && (errorMessageArgs.length == 0 || errorMessageArgs[0] == null || (errorMessageArgs[0] != null))) || errorMessageArgs === null)) {
+ return javaemul.internal.InternalPreconditions.checkArgument$boolean$java_lang_String$java_lang_Object_A(expression, errorMessageTemplate, errorMessageArgs);
+ }
+ else if (((typeof expression === 'boolean') || expression === null) && ((errorMessageTemplate != null) || errorMessageTemplate === null) && errorMessageArgs === undefined) {
+ return javaemul.internal.InternalPreconditions.checkArgument$boolean$java_lang_Object(expression, errorMessageTemplate);
+ }
+ else if (((typeof expression === 'boolean') || expression === null) && errorMessageTemplate === undefined && errorMessageArgs === undefined) {
+ return javaemul.internal.InternalPreconditions.checkArgument$boolean(expression);
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ InternalPreconditions.checkCriticalArgument$boolean$java_lang_String$java_lang_Object_A = function (expression, errorMessageTemplate) {
+ var errorMessageArgs = [];
+ for (var _i = 2; _i < arguments.length; _i++) {
+ errorMessageArgs[_i - 2] = arguments[_i];
+ }
+ if (!expression) {
+ throw new java.lang.IllegalArgumentException(InternalPreconditions.format.apply(this, [errorMessageTemplate].concat(errorMessageArgs)));
+ }
+ };
+ /**
+ * Ensures the truth of an expression involving one or more parameters to the calling method.
+ *
+ * For cases where failing fast is pretty important and not failing early could cause bugs that
+ * are much harder to debug.
+ * @param {boolean} expression
+ * @param {string} errorMessageTemplate
+ * @param {Array} errorMessageArgs
+ */
+ InternalPreconditions.checkCriticalArgument = function (expression, errorMessageTemplate) {
+ var errorMessageArgs = [];
+ for (var _i = 2; _i < arguments.length; _i++) {
+ errorMessageArgs[_i - 2] = arguments[_i];
+ }
+ if (((typeof expression === 'boolean') || expression === null) && ((typeof errorMessageTemplate === 'string') || errorMessageTemplate === null) && ((errorMessageArgs != null && errorMessageArgs instanceof Array && (errorMessageArgs.length == 0 || errorMessageArgs[0] == null || (errorMessageArgs[0] != null))) || errorMessageArgs === null)) {
+ return javaemul.internal.InternalPreconditions.checkCriticalArgument$boolean$java_lang_String$java_lang_Object_A(expression, errorMessageTemplate, errorMessageArgs);
+ }
+ else if (((typeof expression === 'boolean') || expression === null) && ((errorMessageTemplate != null) || errorMessageTemplate === null) && errorMessageArgs === undefined) {
+ return javaemul.internal.InternalPreconditions.checkCriticalArgument$boolean$java_lang_Object(expression, errorMessageTemplate);
+ }
+ else if (((typeof expression === 'boolean') || expression === null) && errorMessageTemplate === undefined && errorMessageArgs === undefined) {
+ return javaemul.internal.InternalPreconditions.checkCriticalArgument$boolean(expression);
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ InternalPreconditions.checkState$boolean = function (expression) {
+ if (InternalPreconditions.API_CHECK_$LI$()) {
+ InternalPreconditions.checkCritcalState(expression);
+ }
+ else if (InternalPreconditions.CHECKED_MODE_$LI$()) {
+ try {
+ InternalPreconditions.checkCritcalState(expression);
+ }
+ catch (e) {
+ throw new java.lang.AssertionError(e);
+ }
+ ;
+ }
+ };
+ /**
+ * Ensures the truth of an expression involving the state of the calling instance, but not
+ * involving any parameters to the calling method.
+ *
+ * For cases where failing fast is pretty important and not failing early could cause bugs that
+ * are much harder to debug.
+ * @param {boolean} expression
+ */
+ InternalPreconditions.checkCritcalState = function (expression) {
+ if (!expression) {
+ throw new java.lang.IllegalStateException();
+ }
+ };
+ InternalPreconditions.checkState$boolean$java_lang_Object = function (expression, errorMessage) {
+ if (InternalPreconditions.API_CHECK_$LI$()) {
+ InternalPreconditions.checkCriticalState(expression, errorMessage);
+ }
+ else if (InternalPreconditions.CHECKED_MODE_$LI$()) {
+ try {
+ InternalPreconditions.checkCriticalState(expression, errorMessage);
+ }
+ catch (e) {
+ throw new java.lang.AssertionError(e);
+ }
+ ;
+ }
+ };
+ /**
+ * Ensures the truth of an expression involving the state of the calling instance, but not
+ * involving any parameters to the calling method.
+ * @param {boolean} expression
+ * @param {*} errorMessage
+ */
+ InternalPreconditions.checkState = function (expression, errorMessage) {
+ if (((typeof expression === 'boolean') || expression === null) && ((errorMessage != null) || errorMessage === null)) {
+ return javaemul.internal.InternalPreconditions.checkState$boolean$java_lang_Object(expression, errorMessage);
+ }
+ else if (((typeof expression === 'boolean') || expression === null) && errorMessage === undefined) {
+ return javaemul.internal.InternalPreconditions.checkState$boolean(expression);
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ /**
+ * Ensures the truth of an expression involving the state of the calling instance, but not
+ * involving any parameters to the calling method.
+ * @param {boolean} expression
+ * @param {*} errorMessage
+ */
+ InternalPreconditions.checkCriticalState = function (expression, errorMessage) {
+ if (!expression) {
+ throw new java.lang.IllegalStateException(/* valueOf */ new String(errorMessage).toString());
+ }
+ };
+ InternalPreconditions.checkNotNull$java_lang_Object = function (reference) {
+ if (InternalPreconditions.API_CHECK_$LI$()) {
+ InternalPreconditions.checkCriticalNotNull(reference);
+ }
+ else if (InternalPreconditions.CHECKED_MODE_$LI$()) {
+ try {
+ InternalPreconditions.checkCriticalNotNull(reference);
+ }
+ catch (e) {
+ throw new java.lang.AssertionError(e);
+ }
+ ;
+ }
+ return reference;
+ };
+ InternalPreconditions.checkCriticalNotNull$java_lang_Object = function (reference) {
+ if (reference == null) {
+ throw new java.lang.NullPointerException();
+ }
+ return reference;
+ };
+ InternalPreconditions.checkNotNull$java_lang_Object$java_lang_Object = function (reference, errorMessage) {
+ if (InternalPreconditions.API_CHECK_$LI$()) {
+ InternalPreconditions.checkCriticalNotNull$java_lang_Object$java_lang_Object(reference, errorMessage);
+ }
+ else if (InternalPreconditions.CHECKED_MODE_$LI$()) {
+ try {
+ InternalPreconditions.checkCriticalNotNull$java_lang_Object$java_lang_Object(reference, errorMessage);
+ }
+ catch (e) {
+ throw new java.lang.AssertionError(e);
+ }
+ ;
+ }
+ };
+ /**
+ * Ensures that an object reference passed as a parameter to the calling method is not null.
+ * @param {*} reference
+ * @param {*} errorMessage
+ */
+ InternalPreconditions.checkNotNull = function (reference, errorMessage) {
+ if (((reference != null) || reference === null) && ((errorMessage != null) || errorMessage === null)) {
+ return javaemul.internal.InternalPreconditions.checkNotNull$java_lang_Object$java_lang_Object(reference, errorMessage);
+ }
+ else if (((reference != null) || reference === null) && errorMessage === undefined) {
+ return javaemul.internal.InternalPreconditions.checkNotNull$java_lang_Object(reference);
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ InternalPreconditions.checkCriticalNotNull$java_lang_Object$java_lang_Object = function (reference, errorMessage) {
+ if (reference == null) {
+ throw new java.lang.NullPointerException(/* valueOf */ new String(errorMessage).toString());
+ }
+ };
+ InternalPreconditions.checkCriticalNotNull = function (reference, errorMessage) {
+ if (((reference != null) || reference === null) && ((errorMessage != null) || errorMessage === null)) {
+ return javaemul.internal.InternalPreconditions.checkCriticalNotNull$java_lang_Object$java_lang_Object(reference, errorMessage);
+ }
+ else if (((reference != null) || reference === null) && errorMessage === undefined) {
+ return javaemul.internal.InternalPreconditions.checkCriticalNotNull$java_lang_Object(reference);
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ /**
+ * Ensures that {@code size} specifies a valid array size (i.e. non-negative).
+ * @param {number} size
+ */
+ InternalPreconditions.checkArraySize = function (size) {
+ if (InternalPreconditions.API_CHECK_$LI$()) {
+ InternalPreconditions.checkCriticalArraySize(size);
+ }
+ else if (InternalPreconditions.CHECKED_MODE_$LI$()) {
+ try {
+ InternalPreconditions.checkCriticalArraySize(size);
+ }
+ catch (e) {
+ throw new java.lang.AssertionError(e);
+ }
+ ;
+ }
+ };
+ InternalPreconditions.checkCriticalArraySize = function (size) {
+ if (size < 0) {
+ throw new java.lang.NegativeArraySizeException("Negative array size: " + size);
+ }
+ };
+ /**
+ * Ensures that {@code index} specifies a valid element in an array, list or string of size
+ * {@code size}. An element index may range from zero, inclusive, to {@code size}, exclusive.
+ * @param {number} index
+ * @param {number} size
+ */
+ InternalPreconditions.checkElementIndex = function (index, size) {
+ if (InternalPreconditions.BOUND_CHECK_$LI$()) {
+ InternalPreconditions.checkCriticalElementIndex(index, size);
+ }
+ else if (InternalPreconditions.CHECKED_MODE_$LI$()) {
+ try {
+ InternalPreconditions.checkCriticalElementIndex(index, size);
+ }
+ catch (e) {
+ throw new java.lang.AssertionError(e);
+ }
+ ;
+ }
+ };
+ InternalPreconditions.checkCriticalElementIndex = function (index, size) {
+ if (index < 0 || index >= size) {
+ throw new java.lang.IndexOutOfBoundsException("Index: " + index + ", Size: " + size);
+ }
+ };
+ /**
+ * Ensures that {@code index} specifies a valid position in an array, list or string of
+ * size {@code size}. A position index may range from zero to {@code size}, inclusive.
+ * @param {number} index
+ * @param {number} size
+ */
+ InternalPreconditions.checkPositionIndex = function (index, size) {
+ if (InternalPreconditions.BOUND_CHECK_$LI$()) {
+ InternalPreconditions.checkCriticalPositionIndex(index, size);
+ }
+ else if (InternalPreconditions.CHECKED_MODE_$LI$()) {
+ try {
+ InternalPreconditions.checkCriticalPositionIndex(index, size);
+ }
+ catch (e) {
+ throw new java.lang.AssertionError(e);
+ }
+ ;
+ }
+ };
+ InternalPreconditions.checkCriticalPositionIndex = function (index, size) {
+ if (index < 0 || index > size) {
+ throw new java.lang.IndexOutOfBoundsException("Index: " + index + ", Size: " + size);
+ }
+ };
+ /**
+ * Ensures that {@code start} and {@code end} specify a valid positions in an array, list
+ * or string of size {@code size}, and are in order. A position index may range from zero to
+ * {@code size}, inclusive.
+ * @param {number} start
+ * @param {number} end
+ * @param {number} size
+ */
+ InternalPreconditions.checkPositionIndexes = function (start, end, size) {
+ if (InternalPreconditions.BOUND_CHECK_$LI$()) {
+ InternalPreconditions.checkCriticalPositionIndexes(start, end, size);
+ }
+ else if (InternalPreconditions.CHECKED_MODE_$LI$()) {
+ try {
+ InternalPreconditions.checkCriticalPositionIndexes(start, end, size);
+ }
+ catch (e) {
+ throw new java.lang.AssertionError(e);
+ }
+ ;
+ }
+ };
+ /**
+ * Ensures that {@code start} and {@code end} specify a valid positions in an array, list
+ * or string of size {@code size}, and are in order. A position index may range from zero to
+ * {@code size}, inclusive.
+ * @param {number} start
+ * @param {number} end
+ * @param {number} size
+ */
+ InternalPreconditions.checkCriticalPositionIndexes = function (start, end, size) {
+ if (start < 0) {
+ throw new java.lang.IndexOutOfBoundsException("fromIndex: " + start + " < 0");
+ }
+ if (end > size) {
+ throw new java.lang.IndexOutOfBoundsException("toIndex: " + end + " > size " + size);
+ }
+ if (start > end) {
+ throw new java.lang.IllegalArgumentException("fromIndex: " + start + " > toIndex: " + end);
+ }
+ };
+ /**
+ * Checks that bounds are correct.
+ *
+ * @throw StringIndexOutOfBoundsException if the range is not legal
+ * @param {number} start
+ * @param {number} end
+ * @param {number} size
+ */
+ InternalPreconditions.checkStringBounds = function (start, end, size) {
+ if (start < 0) {
+ throw new java.lang.StringIndexOutOfBoundsException("fromIndex: " + start + " < 0");
+ }
+ if (end > size) {
+ throw new java.lang.StringIndexOutOfBoundsException("toIndex: " + end + " > size " + size);
+ }
+ if (end < start) {
+ throw new java.lang.StringIndexOutOfBoundsException("fromIndex: " + start + " > toIndex: " + end);
+ }
+ };
+ /**
+ * Substitutes each {@code %s} in {@code template} with an argument. These are matched by
+ * position: the first {@code %s} gets {@code args[0]}, etc. If there are more arguments than
+ * placeholders, the unmatched arguments will be appended to the end of the formatted message in
+ * square braces.
+ * @param {string} template
+ * @param {Array} args
+ * @return {string}
+ * @private
+ */
+ /*private*/ InternalPreconditions.format = function (template) {
+ var args = [];
+ for (var _i = 1; _i < arguments.length; _i++) {
+ args[_i - 1] = arguments[_i];
+ }
+ template = /* valueOf */ new String(template).toString();
+ var builder = new java.lang.StringBuilder(template.length + 16 * args.length);
+ var templateStart = 0;
+ var i = 0;
+ while ((i < args.length)) {
+ {
+ var placeholderStart = template.indexOf("%s", templateStart);
+ if (placeholderStart === -1) {
+ break;
+ }
+ builder.append$java_lang_String(template.substring(templateStart, placeholderStart));
+ builder.append$java_lang_Object(args[i++]);
+ templateStart = placeholderStart + 2;
+ }
+ }
+ ;
+ builder.append$java_lang_String(template.substring(templateStart));
+ if (i < args.length) {
+ builder.append$java_lang_String(" [");
+ builder.append$java_lang_Object(args[i++]);
+ while ((i < args.length)) {
+ {
+ builder.append$java_lang_String(", ");
+ builder.append$java_lang_Object(args[i++]);
+ }
+ }
+ ;
+ builder.append$char(']');
+ }
+ return builder.toString();
+ };
+ return InternalPreconditions;
+ }());
+ internal.InternalPreconditions = InternalPreconditions;
+ InternalPreconditions["__class"] = "javaemul.internal.InternalPreconditions";
+ })(internal = javaemul.internal || (javaemul.internal = {}));
+})(javaemul || (javaemul = {}));
+(function (java) {
+ var util;
+ (function (util) {
+ /**
+ * A helper to detect concurrent modifications to collections. This is implemented as a helper
+ * utility so that we could remove the checks easily by a flag.
+ * @class
+ */
+ var ConcurrentModificationDetector = /** @class */ (function () {
+ function ConcurrentModificationDetector() {
+ }
+ ConcurrentModificationDetector.API_CHECK_$LI$ = function () { if (ConcurrentModificationDetector.API_CHECK == null) {
+ ConcurrentModificationDetector.API_CHECK = java.lang.System.getProperty("jre.checks.api", "ENABLED") === ("ENABLED");
+ } return ConcurrentModificationDetector.API_CHECK; };
+ ;
+ ConcurrentModificationDetector.structureChanged = function (map) {
+ if (!ConcurrentModificationDetector.API_CHECK_$LI$()) {
+ return;
+ }
+ var modCount = javaemul.internal.JsUtils.getIntProperty(map, ConcurrentModificationDetector.MOD_COUNT_PROPERTY) | 0;
+ javaemul.internal.JsUtils.setIntProperty(map, ConcurrentModificationDetector.MOD_COUNT_PROPERTY, modCount + 1);
+ };
+ ConcurrentModificationDetector.recordLastKnownStructure = function (host, iterator) {
+ if (!ConcurrentModificationDetector.API_CHECK_$LI$()) {
+ return;
+ }
+ var modCount = javaemul.internal.JsUtils.getIntProperty(host, ConcurrentModificationDetector.MOD_COUNT_PROPERTY);
+ javaemul.internal.JsUtils.setIntProperty(iterator, ConcurrentModificationDetector.MOD_COUNT_PROPERTY, modCount);
+ };
+ ConcurrentModificationDetector.checkStructuralChange = function (host, iterator) {
+ if (!ConcurrentModificationDetector.API_CHECK_$LI$()) {
+ return;
+ }
+ if (javaemul.internal.JsUtils.getIntProperty(iterator, ConcurrentModificationDetector.MOD_COUNT_PROPERTY) !== javaemul.internal.JsUtils.getIntProperty(host, ConcurrentModificationDetector.MOD_COUNT_PROPERTY)) {
+ throw new java.util.ConcurrentModificationException();
+ }
+ };
+ ConcurrentModificationDetector.MOD_COUNT_PROPERTY = "_gwt_modCount";
+ return ConcurrentModificationDetector;
+ }());
+ util.ConcurrentModificationDetector = ConcurrentModificationDetector;
+ ConcurrentModificationDetector["__class"] = "java.util.ConcurrentModificationDetector";
+ })(util = java.util || (java.util = {}));
+})(java || (java = {}));
+(function (java) {
+ var util;
+ (function (util) {
+ var logging;
+ (function (logging) {
+ /**
+ * An emulation of the java.util.logging.Logger class. See
+ *
+ * The Java API doc for details
+ * @class
+ */
+ var Logger = /** @class */ (function () {
+ function Logger(name, resourceName) {
+ if (this.handlers === undefined) {
+ this.handlers = null;
+ }
+ this.level = null;
+ if (this.name === undefined) {
+ this.name = null;
+ }
+ if (this.parent === undefined) {
+ this.parent = null;
+ }
+ if (this.useParentHandlers === undefined) {
+ this.useParentHandlers = false;
+ }
+ if (Logger.LOGGING_FALSE_$LI$()) {
+ return;
+ }
+ this.name = name;
+ this.useParentHandlers = true;
+ this.handlers = (new java.util.ArrayList());
+ }
+ Logger.__static_initialize = function () { if (!Logger.__static_initialized) {
+ Logger.__static_initialized = true;
+ Logger.__static_initializer_0();
+ } };
+ Logger.LOGGING_ENABLED_$LI$ = function () { Logger.__static_initialize(); if (Logger.LOGGING_ENABLED == null) {
+ Logger.LOGGING_ENABLED = java.lang.System.getProperty("gwt.logging.enabled", "TRUE");
+ } return Logger.LOGGING_ENABLED; };
+ ;
+ Logger.LOGGING_WARNING_$LI$ = function () { Logger.__static_initialize(); if (Logger.LOGGING_WARNING == null) {
+ Logger.LOGGING_WARNING = Logger.LOGGING_ENABLED_$LI$() === ("WARNING");
+ } return Logger.LOGGING_WARNING; };
+ ;
+ Logger.LOGGING_SEVERE_$LI$ = function () { Logger.__static_initialize(); if (Logger.LOGGING_SEVERE == null) {
+ Logger.LOGGING_SEVERE = Logger.LOGGING_ENABLED_$LI$() === ("SEVERE");
+ } return Logger.LOGGING_SEVERE; };
+ ;
+ Logger.LOGGING_FALSE_$LI$ = function () { Logger.__static_initialize(); if (Logger.LOGGING_FALSE == null) {
+ Logger.LOGGING_FALSE = Logger.LOGGING_ENABLED_$LI$() === ("FALSE");
+ } return Logger.LOGGING_FALSE; };
+ ;
+ Logger.__static_initializer_0 = function () {
+ Logger.assertLoggingValues();
+ };
+ Logger.getGlobal = function () {
+ return Logger.getLogger(Logger.GLOBAL_LOGGER_NAME);
+ };
+ Logger.getLogger = function (name) {
+ if (Logger.LOGGING_FALSE_$LI$()) {
+ return new Logger(name, null);
+ }
+ return java.util.logging.LogManager.getLogManager().ensureLogger(name);
+ };
+ Logger.assertLoggingValues = function () {
+ if ((Logger.LOGGING_ENABLED_$LI$() === ("FALSE")) || (Logger.LOGGING_ENABLED_$LI$() === ("TRUE")) || (Logger.LOGGING_ENABLED_$LI$() === ("SEVERE")) || (Logger.LOGGING_ENABLED_$LI$() === ("WARNING"))) {
+ return;
+ }
+ throw new java.lang.RuntimeException("Undefined value for gwt.logging.enabled: \'" + Logger.LOGGING_ENABLED_$LI$() + "\'. Allowed values are TRUE, FALSE, SEVERE, WARNING");
+ };
+ Logger.prototype.addHandler = function (handler) {
+ if (Logger.LOGGING_FALSE_$LI$()) {
+ return;
+ }
+ this.handlers.add(handler);
+ };
+ Logger.prototype.config = function (msg) {
+ if (Logger.LOGGING_FALSE_$LI$() || Logger.LOGGING_SEVERE_$LI$() || Logger.LOGGING_WARNING_$LI$()) {
+ return;
+ }
+ this.log$java_util_logging_Level$java_lang_String(java.util.logging.Level.CONFIG_$LI$(), msg);
+ };
+ Logger.prototype.fine = function (msg) {
+ if (Logger.LOGGING_FALSE_$LI$() || Logger.LOGGING_SEVERE_$LI$() || Logger.LOGGING_WARNING_$LI$()) {
+ return;
+ }
+ this.log$java_util_logging_Level$java_lang_String(java.util.logging.Level.FINE_$LI$(), msg);
+ };
+ Logger.prototype.finer = function (msg) {
+ if (Logger.LOGGING_FALSE_$LI$() || Logger.LOGGING_SEVERE_$LI$() || Logger.LOGGING_WARNING_$LI$()) {
+ return;
+ }
+ this.log$java_util_logging_Level$java_lang_String(java.util.logging.Level.FINER_$LI$(), msg);
+ };
+ Logger.prototype.finest = function (msg) {
+ if (Logger.LOGGING_FALSE_$LI$() || Logger.LOGGING_SEVERE_$LI$() || Logger.LOGGING_WARNING_$LI$()) {
+ return;
+ }
+ this.log$java_util_logging_Level$java_lang_String(java.util.logging.Level.FINEST_$LI$(), msg);
+ };
+ Logger.prototype.info = function (msg) {
+ if (Logger.LOGGING_FALSE_$LI$() || Logger.LOGGING_SEVERE_$LI$() || Logger.LOGGING_WARNING_$LI$()) {
+ return;
+ }
+ this.log$java_util_logging_Level$java_lang_String(java.util.logging.Level.INFO_$LI$(), msg);
+ };
+ Logger.prototype.warning = function (msg) {
+ if (Logger.LOGGING_FALSE_$LI$() || Logger.LOGGING_SEVERE_$LI$()) {
+ return;
+ }
+ this.log$java_util_logging_Level$java_lang_String(java.util.logging.Level.WARNING_$LI$(), msg);
+ };
+ Logger.prototype.severe = function (msg) {
+ if (Logger.LOGGING_FALSE_$LI$()) {
+ return;
+ }
+ this.log$java_util_logging_Level$java_lang_String(java.util.logging.Level.SEVERE_$LI$(), msg);
+ };
+ Logger.prototype.getHandlers = function () {
+ if (Logger.LOGGING_FALSE_$LI$()) {
+ return [];
+ }
+ return this.handlers['toArray$java_lang_Object_A']((function (s) { var a = []; while (s-- > 0)
+ a.push(null); return a; })(this.handlers.size()));
+ };
+ Logger.prototype.getLevel = function () {
+ return Logger.LOGGING_FALSE_$LI$() ? null : this.level;
+ };
+ Logger.prototype.getName = function () {
+ return Logger.LOGGING_FALSE_$LI$() ? null : this.name;
+ };
+ Logger.prototype.getParent = function () {
+ return Logger.LOGGING_FALSE_$LI$() ? null : this.parent;
+ };
+ Logger.prototype.getUseParentHandlers = function () {
+ return Logger.LOGGING_FALSE_$LI$() ? false : this.useParentHandlers;
+ };
+ Logger.prototype.isLoggable = function (messageLevel) {
+ return Logger.LOGGING_FALSE_$LI$() ? false : this.getEffectiveLevel().intValue() <= messageLevel.intValue();
+ };
+ Logger.prototype.log$java_util_logging_Level$java_lang_String = function (level, msg) {
+ this.log$java_util_logging_Level$java_lang_String$java_lang_Throwable(level, msg, null);
+ };
+ Logger.prototype.log$java_util_logging_Level$java_lang_String$java_lang_Throwable = function (level, msg, thrown) {
+ if (Logger.LOGGING_FALSE_$LI$()) {
+ return;
+ }
+ if (Logger.LOGGING_SEVERE_$LI$()) {
+ if (level.intValue() >= 1000) {
+ this.actuallyLog$java_util_logging_Level$java_lang_String$java_lang_Throwable(level, msg, thrown);
+ }
+ }
+ else if (Logger.LOGGING_WARNING_$LI$()) {
+ if (level.intValue() >= java.util.logging.Level.WARNING_$LI$().intValue()) {
+ this.actuallyLog$java_util_logging_Level$java_lang_String$java_lang_Throwable(level, msg, thrown);
+ }
+ }
+ else {
+ this.actuallyLog$java_util_logging_Level$java_lang_String$java_lang_Throwable(level, msg, thrown);
+ }
+ };
+ Logger.prototype.log = function (level, msg, thrown) {
+ if (((level != null && level instanceof java.util.logging.Level) || level === null) && ((typeof msg === 'string') || msg === null) && ((thrown != null && thrown instanceof Error) || thrown === null)) {
+ return this.log$java_util_logging_Level$java_lang_String$java_lang_Throwable(level, msg, thrown);
+ }
+ else if (((level != null && level instanceof java.util.logging.Level) || level === null) && ((typeof msg === 'string') || msg === null) && thrown === undefined) {
+ return this.log$java_util_logging_Level$java_lang_String(level, msg);
+ }
+ else if (((level != null && level instanceof java.util.logging.LogRecord) || level === null) && msg === undefined && thrown === undefined) {
+ return this.log$java_util_logging_LogRecord(level);
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ Logger.prototype.log$java_util_logging_LogRecord = function (record) {
+ if (Logger.LOGGING_FALSE_$LI$()) {
+ return;
+ }
+ if (Logger.LOGGING_SEVERE_$LI$()) {
+ if (record.getLevel().intValue() >= 1000) {
+ this.actuallyLog$java_util_logging_LogRecord(record);
+ }
+ }
+ else if (Logger.LOGGING_WARNING_$LI$()) {
+ if (record.getLevel().intValue() >= java.util.logging.Level.WARNING_$LI$().intValue()) {
+ this.actuallyLog$java_util_logging_LogRecord(record);
+ }
+ }
+ else {
+ this.actuallyLog$java_util_logging_LogRecord(record);
+ }
+ };
+ Logger.prototype.removeHandler = function (handler) {
+ if (Logger.LOGGING_FALSE_$LI$()) {
+ return;
+ }
+ this.handlers['remove$java_lang_Object'](handler);
+ };
+ Logger.prototype.setLevel = function (newLevel) {
+ if (Logger.LOGGING_FALSE_$LI$()) {
+ return;
+ }
+ this.level = newLevel;
+ };
+ Logger.prototype.setParent = function (newParent) {
+ if (Logger.LOGGING_FALSE_$LI$()) {
+ return;
+ }
+ if (newParent != null) {
+ this.parent = newParent;
+ }
+ };
+ Logger.prototype.setUseParentHandlers = function (newUseParentHandlers) {
+ if (Logger.LOGGING_FALSE_$LI$()) {
+ return;
+ }
+ this.useParentHandlers = newUseParentHandlers;
+ };
+ /*private*/ Logger.prototype.getEffectiveLevel = function () {
+ if (this.level != null) {
+ return this.level;
+ }
+ var logger = this.getParent();
+ while ((logger != null)) {
+ {
+ var effectiveLevel = logger.getLevel();
+ if (effectiveLevel != null) {
+ return effectiveLevel;
+ }
+ logger = logger.getParent();
+ }
+ }
+ ;
+ return java.util.logging.Level.INFO_$LI$();
+ };
+ Logger.prototype.actuallyLog$java_util_logging_Level$java_lang_String$java_lang_Throwable = function (level, msg, thrown) {
+ if (this.isLoggable(level)) {
+ var record = new java.util.logging.LogRecord(level, msg);
+ record.setThrown(thrown);
+ record.setLoggerName(this.getName());
+ this.actuallyLog$java_util_logging_LogRecord(record);
+ }
+ };
+ Logger.prototype.actuallyLog = function (level, msg, thrown) {
+ if (((level != null && level instanceof java.util.logging.Level) || level === null) && ((typeof msg === 'string') || msg === null) && ((thrown != null && thrown instanceof Error) || thrown === null)) {
+ return this.actuallyLog$java_util_logging_Level$java_lang_String$java_lang_Throwable(level, msg, thrown);
+ }
+ else if (((level != null && level instanceof java.util.logging.LogRecord) || level === null) && msg === undefined && thrown === undefined) {
+ return this.actuallyLog$java_util_logging_LogRecord(level);
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ /*private*/ Logger.prototype.actuallyLog$java_util_logging_LogRecord = function (record) {
+ if (this.isLoggable(record.getLevel())) {
+ {
+ var array200 = this.getHandlers();
+ for (var index199 = 0; index199 < array200.length; index199++) {
+ var handler = array200[index199];
+ {
+ handler.publish(record);
+ }
+ }
+ }
+ var logger = this.getUseParentHandlers() ? this.getParent() : null;
+ while ((logger != null)) {
+ {
+ {
+ var array202 = logger.getHandlers();
+ for (var index201 = 0; index201 < array202.length; index201++) {
+ var handler = array202[index201];
+ {
+ handler.publish(record);
+ }
+ }
+ }
+ logger = logger.getUseParentHandlers() ? logger.getParent() : null;
+ }
+ }
+ ;
+ }
+ };
+ Logger.__static_initialized = false;
+ Logger.GLOBAL_LOGGER_NAME = "global";
+ return Logger;
+ }());
+ logging.Logger = Logger;
+ Logger["__class"] = "java.util.logging.Logger";
+ })(logging = util.logging || (util.logging = {}));
+ })(util = java.util || (java.util = {}));
+})(java || (java = {}));
+(function (java) {
+ var nio;
+ (function (nio) {
+ var file;
+ (function (file) {
+ var Path = /** @class */ (function () {
+ function Path(fullPath) {
+ if (this.fullPath === undefined) {
+ this.fullPath = null;
+ }
+ this.fullPath = fullPath;
+ }
+ /* Default method injected from java.lang.Iterable */
+ Path.prototype.forEach = function (action) {
+ javaemul.internal.InternalPreconditions.checkNotNull((action));
+ var _loop_39 = function (index203) {
+ var t = index203.next();
+ {
+ (function (target) { return (typeof target === 'function') ? target(t) : target.accept(t); })(action);
+ }
+ };
+ for (var index203 = this.iterator(); index203.hasNext();) {
+ _loop_39(index203);
+ }
+ };
+ Path.PATH_SEPARATOR_$LI$ = function () { if (Path.PATH_SEPARATOR == null) {
+ Path.PATH_SEPARATOR = java.lang.System.getProperty("file.separator");
+ } return Path.PATH_SEPARATOR; };
+ ;
+ Path.prototype.compareTo$java_nio_file_Path = function (path) {
+ return /* compareTo */ this.toString().localeCompare(path.toString());
+ };
+ /**
+ *
+ * @param {java.nio.file.Path} path
+ * @return {number}
+ */
+ Path.prototype.compareTo = function (path) {
+ if (((path != null && path instanceof java.nio.file.Path) || path === null)) {
+ return this.compareTo$java_nio_file_Path(path);
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ Path.prototype.isAbsolute = function () {
+ return java.util.Objects.equals(Path.PATH_SEPARATOR_$LI$(), "/") ? this.fullPath.length > 0 && java.util.Objects.equals(this.fullPath.substring(0, 1), Path.PATH_SEPARATOR_$LI$()) : this.fullPath.length >= 3 && java.util.Objects.equals(this.fullPath.substring(1, 3), ":\\");
+ };
+ Path.prototype.getFileName = function () {
+ return new Path(this.fullPath.substring(this.fullPath.lastIndexOf(Path.PATH_SEPARATOR_$LI$()) + Path.PATH_SEPARATOR_$LI$().length));
+ };
+ Path.prototype.getParent = function () {
+ return new Path(this.fullPath.substring(0, this.fullPath.lastIndexOf(Path.PATH_SEPARATOR_$LI$())));
+ };
+ Path.prototype.resolve$java_nio_file_Path = function (other) {
+ if (other.isAbsolute())
+ return other;
+ return new Path(this.fullPath + "/" + other.fullPath);
+ };
+ Path.prototype.resolve = function (other) {
+ if (((other != null && other instanceof java.nio.file.Path) || other === null)) {
+ return this.resolve$java_nio_file_Path(other);
+ }
+ else if (((typeof other === 'string') || other === null)) {
+ return this.resolve$java_lang_String(other);
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ Path.prototype.resolve$java_lang_String = function (other) {
+ return this.resolve$java_nio_file_Path(java.nio.file.Paths.get(other));
+ };
+ Path.prototype.toAbsolutePath = function () {
+ return java.nio.file.Paths.get(java.lang.System.getProperty$java_lang_String("user.dir")).resolve$java_nio_file_Path(this);
+ };
+ /**
+ *
+ * @return {*}
+ */
+ Path.prototype.iterator = function () {
+ var _this = this;
+ return java.util.Arrays.asList(((this.fullPath).split(Path.PATH_SEPARATOR_$LI$()).map(function (str, i, arr) { return _this.isAbsolute() && i === 0 ? new Path(str + Path.PATH_SEPARATOR_$LI$()) : new Path(str); }))).iterator();
+ };
+ /**
+ *
+ * @return {string}
+ */
+ Path.prototype.toString = function () {
+ return this.fullPath;
+ };
+ return Path;
+ }());
+ file.Path = Path;
+ Path["__class"] = "java.nio.file.Path";
+ Path["__interfaces"] = ["java.lang.Comparable", "java.lang.Iterable"];
+ })(file = nio.file || (nio.file = {}));
+ })(nio = java.nio || (java.nio = {}));
+})(java || (java = {}));
+java.nio.file.Path.PATH_SEPARATOR_$LI$();
+java.util.logging.Logger.LOGGING_FALSE_$LI$();
+java.util.logging.Logger.LOGGING_SEVERE_$LI$();
+java.util.logging.Logger.LOGGING_WARNING_$LI$();
+java.util.logging.Logger.LOGGING_ENABLED_$LI$();
+java.util.logging.Logger.__static_initialize();
+java.util.ConcurrentModificationDetector.API_CHECK_$LI$();
+javaemul.internal.InternalPreconditions.BOUND_CHECK_$LI$();
+javaemul.internal.InternalPreconditions.API_CHECK_$LI$();
+javaemul.internal.InternalPreconditions.TYPE_CHECK_$LI$();
+javaemul.internal.InternalPreconditions.CHECKED_MODE_$LI$();
+java.lang.System.in_$LI$();
+java.lang.System.out_$LI$();
+java.lang.System.err_$LI$();
+java.lang.System.propertyMap_$LI$();
+java.lang.System.ENVIRONMENT_IS_SHELL_$LI$();
+java.lang.System.ENVIRONMENT_IS_NODE_$LI$();
+java.lang.System.ENVIRONMENT_IS_WORKER_$LI$();
+java.lang.System.ENVIRONMENT_IS_WEB_$LI$();
+java.lang.System.__static_initialize();
+java.util.stream.Collectors.CH_NOID_$LI$();
+java.util.stream.Collectors.CH_ID_$LI$();
+java.util.TreeMap.SubMapType_Tail_$LI$();
+java.util.TreeMap.SubMapType_Range_$LI$();
+java.util.TreeMap.SubMapType_Head_$LI$();
+java.util.TreeMap.SubMapType_All_$LI$();
+java.util.Collections.RandomHolder.rnd_$LI$();
+java.util.Collections.ReverseComparator.INSTANCE_$LI$();
+java.util.Collections.EmptyListIterator.INSTANCE_$LI$();
+java.util.Collections.EMPTY_SET_$LI$();
+java.util.Collections.EMPTY_MAP_$LI$();
+java.util.Collections.EMPTY_LIST_$LI$();
+java.nio.charset.StandardCharsets.UTF_8_$LI$();
+java.nio.charset.StandardCharsets.ISO_8859_1_$LI$();
+javaemul.internal.EmulatedCharset.ISO_8859_1_$LI$();
+javaemul.internal.EmulatedCharset.ISO_LATIN_1_$LI$();
+javaemul.internal.EmulatedCharset.UTF_8_$LI$();
+java.security.MessageDigest.Md5Digest.padding_$LI$();
+javaemul.internal.StringHelper.CASE_INSENSITIVE_ORDER_$LI$();
+java.util.Scanner.whiteSpacePattern_$LI$();
+java.util.Scanner.endLinePattern_$LI$();
+java.util.Scanner.floatPattern_$LI$();
+java.util.Scanner.integerPattern_$LI$();
+java.util.Scanner.booleanPattern_$LI$();
+java.util.Scanner.signedNonNumber_$LI$();
+java.util.Scanner.decimal_$LI$();
+java.util.Scanner.exponent_$LI$();
+java.util.Scanner.decimalNumeral_$LI$();
+java.util.Scanner.numeral_$LI$();
+javaemul.internal.LongHelper.BoxedValues.boxedValues_$LI$();
+javaemul.internal.IntegerHelper.ReverseNibbles.reverseNibbles_$LI$();
+javaemul.internal.IntegerHelper.BoxedValues.boxedValues_$LI$();
+javaemul.internal.ByteHelper.BoxedValues.boxedValues_$LI$();
+javaemul.internal.ByteHelper.TYPE_$LI$();
+javaemul.internal.ByteHelper.MAX_VALUE_$LI$();
+javaemul.internal.ByteHelper.MIN_VALUE_$LI$();
+javaemul.internal.ShortHelper.BoxedValues.boxedValues_$LI$();
+javaemul.internal.ShortHelper.TYPE_$LI$();
+javaemul.internal.ShortHelper.MAX_VALUE_$LI$();
+javaemul.internal.ShortHelper.MIN_VALUE_$LI$();
+javaemul.internal.DoubleHelper.PowersTable.invPowers_$LI$();
+javaemul.internal.DoubleHelper.PowersTable.powers_$LI$();
+java.nio.ByteOrder.LITTLE_ENDIAN_$LI$();
+java.nio.ByteOrder.BIG_ENDIAN_$LI$();
+java.lang.Class.classes_$LI$();
+java.lang.Class.constructors_$LI$();
+java.util.logging.Level.WARNING_$LI$();
+java.util.logging.Level.SEVERE_$LI$();
+java.util.logging.Level.OFF_$LI$();
+java.util.logging.Level.INFO_$LI$();
+java.util.logging.Level.FINEST_$LI$();
+java.util.logging.Level.FINER_$LI$();
+java.util.logging.Level.FINE_$LI$();
+java.util.logging.Level.CONFIG_$LI$();
+java.util.logging.Level.ALL_$LI$();
+java.util.Date.StringData.MONTHS_$LI$();
+java.util.Date.StringData.DAYS_$LI$();
+java.util.Comparators.NATURAL_$LI$();
+java.util.Locale.defaultLocale_$LI$();
+java.util.Locale.UK_$LI$();
+java.util.Locale.FRANCE_$LI$();
+java.util.Locale.US_$LI$();
+java.util.Locale.ENGLISH_$LI$();
+java.util.Locale.ROOT_$LI$();
+java.util.Random.twoToTheXMinus48_$LI$();
+java.util.Random.twoToTheXMinus24_$LI$();
+java.util.Random.__static_initialize();
+java.util.OptionalLong.EMPTY_$LI$();
+java.util.OptionalInt.EMPTY_$LI$();
+java.util.OptionalDouble.EMPTY_$LI$();
+java.util.Optional.EMPTY_$LI$();
+java.util.InternalJsMapFactory.jsMapCtor_$LI$();
+java.net.InternalJsURLFactory.jsURLCtor_$LI$();
+javaemul.internal.NumberHelper.__ParseLong.maxValueForRadix_$LI$();
+javaemul.internal.NumberHelper.__ParseLong.maxLengthForRadix_$LI$();
+javaemul.internal.NumberHelper.__ParseLong.maxDigitsRadixPower_$LI$();
+javaemul.internal.NumberHelper.__ParseLong.maxDigitsForRadix_$LI$();
+javaemul.internal.NumberHelper.__ParseLong.__static_initialize();
+javaemul.internal.MathHelper.PI_UNDER_180_$LI$();
+javaemul.internal.MathHelper.PI_OVER_180_$LI$();
+javaemul.internal.MathHelper.MIN_VALUE_$LI$();
+javaemul.internal.MathHelper.MAX_VALUE_$LI$();
+javaemul.internal.MathHelper.EPSILON_$LI$();
+javaemul.internal.CharacterHelper.BoxedValues.boxedValues_$LI$();
+javaemul.internal.CharacterHelper.TYPE_$LI$();
+javaemul.internal.stream.VoidRunnable.dryRun_$LI$();
+javaemul.internal.StringHashCache.front_$LI$();
+javaemul.internal.StringHashCache.back_$LI$();
+javaemul.internal.BooleanHelper.TYPE_$LI$();
+javaemul.internal.JreHelper.LOG10E_$LI$();
+test.Test.main(null);
null to this method will have no effect.
+ *
+ * @param {*} o
+ * the observer to be deleted.
+ */
+ Observable.prototype.deleteObserver = function (o) {
+ this.obs.removeElement(o);
+ };
+ Observable.prototype.notifyObservers$ = function () {
+ this.notifyObservers$java_lang_Object(null);
+ };
+ Observable.prototype.notifyObservers$java_lang_Object = function (arg) {
+ var arrLocal;
+ if (!this.changed)
+ return;
+ arrLocal = this.obs.toArray$();
+ this.clearChanged();
+ for (var i = arrLocal.length - 1; i >= 0; i--) {
+ arrLocal[i].update(this, arg);
+ }
+ };
+ /**
+ * If this object has changed, as indicated by the hasChanged
+ * method, then notify all of its observers and then call the
+ * clearChanged method to indicate that this object has no
+ * longer changed.
+ * update method called with two
+ * arguments: this observable object and the arg argument.
+ *
+ * @param {*} arg
+ * any object.
+ * @see java.util.Observable#clearChanged()
+ * @see java.util.Observable#hasChanged()
+ * @see java.util.Observer#update(java.util.Observable, java.lang.Object)
+ */
+ Observable.prototype.notifyObservers = function (arg) {
+ if (((arg != null) || arg === null)) {
+ return this.notifyObservers$java_lang_Object(arg);
+ }
+ else if (arg === undefined) {
+ return this.notifyObservers$();
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ /**
+ * Clears the observer list so that this object no longer has any observers.
+ */
+ Observable.prototype.deleteObservers = function () {
+ this.obs.removeAllElements();
+ };
+ /**
+ * Marks this Observable object as having been changed; the
+ * hasChanged method will now return true.
+ */
+ Observable.prototype.setChanged = function () {
+ this.changed = true;
+ };
+ /**
+ * Indicates that this object has no longer changed, or that it has already
+ * notified all of its observers of its most recent change, so that the
+ * hasChanged method will now return false. This method is
+ * called automatically by the notifyObservers methods.
+ *
+ * @see java.util.Observable#notifyObservers()
+ * @see java.util.Observable#notifyObservers(java.lang.Object)
+ */
+ Observable.prototype.clearChanged = function () {
+ this.changed = false;
+ };
+ /**
+ * Tests if this object has changed.
+ *
+ * @return {boolean} true if and only if the setChanged
+ * method has been called more recently than the
+ * clearChanged method on this object;
+ * false otherwise.
+ * @see java.util.Observable#clearChanged()
+ * @see java.util.Observable#setChanged()
+ */
+ Observable.prototype.hasChanged = function () {
+ return this.changed;
+ };
+ /**
+ * Returns the number of observers of this Observable object.
+ *
+ * @return {number} the number of observers of this object.
+ */
+ Observable.prototype.countObservers = function () {
+ return this.obs.size();
+ };
+ return Observable;
+ }());
+ util.Observable = Observable;
+ Observable["__class"] = "java.util.Observable";
+ })(util = java.util || (java.util = {}));
+})(java || (java = {}));
+(function (java) {
+ var util;
+ (function (util) {
+ /**
+ * A simple wrapper around JavaScriptObject to provide {@link java.util.Map}-like semantics for any
+ * key type.
+ * delim argument are the delimiters
+ * for separating tokens.
+ * returnDelims flag is true, then
+ * the delimiter characters are also returned as tokens. Each
+ * delimiter is returned as a string of length one. If the flag is
+ * false, the delimiter characters are skipped and only
+ * serve as separators between tokens.
+ * null
+ * @class
+ * @author unascribed
+ */
+ var StringTokenizer = /** @class */ (function () {
+ function StringTokenizer(str, delim, returnDelims) {
+ if (((typeof str === 'string') || str === null) && ((typeof delim === 'string') || delim === null) && ((typeof returnDelims === 'boolean') || returnDelims === null)) {
+ var __args = arguments;
+ if (this.currentPosition === undefined) {
+ this.currentPosition = 0;
+ }
+ if (this.newPosition === undefined) {
+ this.newPosition = 0;
+ }
+ if (this.maxPosition === undefined) {
+ this.maxPosition = 0;
+ }
+ if (this.str === undefined) {
+ this.str = null;
+ }
+ if (this.delimiters === undefined) {
+ this.delimiters = null;
+ }
+ if (this.retDelims === undefined) {
+ this.retDelims = false;
+ }
+ if (this.delimsChanged === undefined) {
+ this.delimsChanged = false;
+ }
+ if (this.maxDelimCodePoint === undefined) {
+ this.maxDelimCodePoint = 0;
+ }
+ if (this.delimiterCodePoints === undefined) {
+ this.delimiterCodePoints = null;
+ }
+ this.hasSurrogates = false;
+ this.currentPosition = 0;
+ this.newPosition = -1;
+ this.delimsChanged = false;
+ this.str = str;
+ this.maxPosition = str.length;
+ this.delimiters = delim;
+ this.retDelims = returnDelims;
+ this.setMaxDelimCodePoint();
+ }
+ else if (((typeof str === 'string') || str === null) && ((typeof delim === 'string') || delim === null) && returnDelims === undefined) {
+ var __args = arguments;
+ {
+ var __args_4 = arguments;
+ var returnDelims_1 = false;
+ if (this.currentPosition === undefined) {
+ this.currentPosition = 0;
+ }
+ if (this.newPosition === undefined) {
+ this.newPosition = 0;
+ }
+ if (this.maxPosition === undefined) {
+ this.maxPosition = 0;
+ }
+ if (this.str === undefined) {
+ this.str = null;
+ }
+ if (this.delimiters === undefined) {
+ this.delimiters = null;
+ }
+ if (this.retDelims === undefined) {
+ this.retDelims = false;
+ }
+ if (this.delimsChanged === undefined) {
+ this.delimsChanged = false;
+ }
+ if (this.maxDelimCodePoint === undefined) {
+ this.maxDelimCodePoint = 0;
+ }
+ if (this.delimiterCodePoints === undefined) {
+ this.delimiterCodePoints = null;
+ }
+ this.hasSurrogates = false;
+ this.currentPosition = 0;
+ this.newPosition = -1;
+ this.delimsChanged = false;
+ this.str = str;
+ this.maxPosition = str.length;
+ this.delimiters = delim;
+ this.retDelims = returnDelims_1;
+ this.setMaxDelimCodePoint();
+ }
+ if (this.currentPosition === undefined) {
+ this.currentPosition = 0;
+ }
+ if (this.newPosition === undefined) {
+ this.newPosition = 0;
+ }
+ if (this.maxPosition === undefined) {
+ this.maxPosition = 0;
+ }
+ if (this.str === undefined) {
+ this.str = null;
+ }
+ if (this.delimiters === undefined) {
+ this.delimiters = null;
+ }
+ if (this.retDelims === undefined) {
+ this.retDelims = false;
+ }
+ if (this.delimsChanged === undefined) {
+ this.delimsChanged = false;
+ }
+ if (this.maxDelimCodePoint === undefined) {
+ this.maxDelimCodePoint = 0;
+ }
+ if (this.delimiterCodePoints === undefined) {
+ this.delimiterCodePoints = null;
+ }
+ this.hasSurrogates = false;
+ }
+ else if (((typeof str === 'string') || str === null) && delim === undefined && returnDelims === undefined) {
+ var __args = arguments;
+ {
+ var __args_5 = arguments;
+ var delim_1 = " \t\n\r\f";
+ var returnDelims_2 = false;
+ if (this.currentPosition === undefined) {
+ this.currentPosition = 0;
+ }
+ if (this.newPosition === undefined) {
+ this.newPosition = 0;
+ }
+ if (this.maxPosition === undefined) {
+ this.maxPosition = 0;
+ }
+ if (this.str === undefined) {
+ this.str = null;
+ }
+ if (this.delimiters === undefined) {
+ this.delimiters = null;
+ }
+ if (this.retDelims === undefined) {
+ this.retDelims = false;
+ }
+ if (this.delimsChanged === undefined) {
+ this.delimsChanged = false;
+ }
+ if (this.maxDelimCodePoint === undefined) {
+ this.maxDelimCodePoint = 0;
+ }
+ if (this.delimiterCodePoints === undefined) {
+ this.delimiterCodePoints = null;
+ }
+ this.hasSurrogates = false;
+ this.currentPosition = 0;
+ this.newPosition = -1;
+ this.delimsChanged = false;
+ this.str = str;
+ this.maxPosition = str.length;
+ this.delimiters = delim_1;
+ this.retDelims = returnDelims_2;
+ this.setMaxDelimCodePoint();
+ }
+ if (this.currentPosition === undefined) {
+ this.currentPosition = 0;
+ }
+ if (this.newPosition === undefined) {
+ this.newPosition = 0;
+ }
+ if (this.maxPosition === undefined) {
+ this.maxPosition = 0;
+ }
+ if (this.str === undefined) {
+ this.str = null;
+ }
+ if (this.delimiters === undefined) {
+ this.delimiters = null;
+ }
+ if (this.retDelims === undefined) {
+ this.retDelims = false;
+ }
+ if (this.delimsChanged === undefined) {
+ this.delimsChanged = false;
+ }
+ if (this.maxDelimCodePoint === undefined) {
+ this.maxDelimCodePoint = 0;
+ }
+ if (this.delimiterCodePoints === undefined) {
+ this.delimiterCodePoints = null;
+ }
+ this.hasSurrogates = false;
+ }
+ else
+ throw new Error('invalid overload');
+ }
+ /**
+ * Set maxDelimCodePoint to the highest char in the delimiter set.
+ * @private
+ */
+ /*private*/ StringTokenizer.prototype.setMaxDelimCodePoint = function () {
+ if (this.delimiters == null) {
+ this.maxDelimCodePoint = 0;
+ return;
+ }
+ var m = 0;
+ var c;
+ var count = 0;
+ for (var i = 0; i < this.delimiters.length; i += javaemul.internal.CharacterHelper.charCount(c)) {
+ {
+ c = (this.delimiters.charAt(i)).charCodeAt(0);
+ if (c >= (function (c) { return c.charCodeAt == null ? c : c.charCodeAt(0); })(javaemul.internal.CharacterHelper.MIN_HIGH_SURROGATE) && c <= (function (c) { return c.charCodeAt == null ? c : c.charCodeAt(0); })(javaemul.internal.CharacterHelper.MAX_LOW_SURROGATE)) {
+ c = /* codePointAt */ this.delimiters.charCodeAt(i);
+ this.hasSurrogates = true;
+ }
+ if (m < c)
+ m = c;
+ count++;
+ }
+ ;
+ }
+ this.maxDelimCodePoint = m;
+ if (this.hasSurrogates) {
+ this.delimiterCodePoints = (function (s) { var a = []; while (s-- > 0)
+ a.push(0); return a; })(count);
+ for (var i = 0, j = 0; i < count; i++, j += javaemul.internal.CharacterHelper.charCount(c)) {
+ {
+ c = /* codePointAt */ this.delimiters.charCodeAt(j);
+ this.delimiterCodePoints[i] = c;
+ }
+ ;
+ }
+ }
+ };
+ /**
+ * Skips delimiters starting from the specified position. If retDelims
+ * is false, returns the index of the first non-delimiter character at or
+ * after startPos. If retDelims is true, startPos is returned.
+ * @param {number} startPos
+ * @return {number}
+ * @private
+ */
+ /*private*/ StringTokenizer.prototype.skipDelimiters = function (startPos) {
+ if (this.delimiters == null)
+ throw new java.lang.NullPointerException();
+ var position = startPos;
+ while ((!this.retDelims && position < this.maxPosition)) {
+ {
+ if (!this.hasSurrogates) {
+ var c = this.str.charAt(position);
+ if (((function (c) { return c.charCodeAt == null ? c : c.charCodeAt(0); })(c) > this.maxDelimCodePoint) || (this.delimiters.indexOf(c) < 0))
+ break;
+ position++;
+ }
+ else {
+ var c = this.str.charCodeAt(position);
+ if ((c > this.maxDelimCodePoint) || !this.isDelimiter(c)) {
+ break;
+ }
+ position += javaemul.internal.CharacterHelper.charCount(c);
+ }
+ }
+ }
+ ;
+ return position;
+ };
+ /**
+ * Skips ahead from startPos and returns the index of the next delimiter
+ * character encountered, or maxPosition if no such delimiter is found.
+ * @param {number} startPos
+ * @return {number}
+ * @private
+ */
+ /*private*/ StringTokenizer.prototype.scanToken = function (startPos) {
+ var position = startPos;
+ while ((position < this.maxPosition)) {
+ {
+ if (!this.hasSurrogates) {
+ var c = this.str.charAt(position);
+ if (((function (c) { return c.charCodeAt == null ? c : c.charCodeAt(0); })(c) <= this.maxDelimCodePoint) && (this.delimiters.indexOf(c) >= 0))
+ break;
+ position++;
+ }
+ else {
+ var c = this.str.charCodeAt(position);
+ if ((c <= this.maxDelimCodePoint) && this.isDelimiter(c))
+ break;
+ position += javaemul.internal.CharacterHelper.charCount(c);
+ }
+ }
+ }
+ ;
+ if (this.retDelims && (startPos === position)) {
+ if (!this.hasSurrogates) {
+ var c = this.str.charAt(position);
+ if (((function (c) { return c.charCodeAt == null ? c : c.charCodeAt(0); })(c) <= this.maxDelimCodePoint) && (this.delimiters.indexOf(c) >= 0))
+ position++;
+ }
+ else {
+ var c = this.str.charCodeAt(position);
+ if ((c <= this.maxDelimCodePoint) && this.isDelimiter(c))
+ position += javaemul.internal.CharacterHelper.charCount(c);
+ }
+ }
+ return position;
+ };
+ /*private*/ StringTokenizer.prototype.isDelimiter = function (codePoint) {
+ for (var i = 0; i < this.delimiterCodePoints.length; i++) {
+ {
+ if (this.delimiterCodePoints[i] === codePoint) {
+ return true;
+ }
+ }
+ ;
+ }
+ return false;
+ };
+ /**
+ * Tests if there are more tokens available from this tokenizer's string.
+ * If this method returns true, then a subsequent call to
+ * nextToken with no argument will successfully return a token.
+ *
+ * @return {boolean} true if and only if there is at least one token
+ * in the string after the current position; false
+ * otherwise.
+ */
+ StringTokenizer.prototype.hasMoreTokens = function () {
+ this.newPosition = this.skipDelimiters(this.currentPosition);
+ return (this.newPosition < this.maxPosition);
+ };
+ StringTokenizer.prototype.nextToken$ = function () {
+ this.currentPosition = (this.newPosition >= 0 && !this.delimsChanged) ? this.newPosition : this.skipDelimiters(this.currentPosition);
+ this.delimsChanged = false;
+ this.newPosition = -1;
+ if (this.currentPosition >= this.maxPosition)
+ throw new java.util.NoSuchElementException();
+ var start = this.currentPosition;
+ this.currentPosition = this.scanToken(this.currentPosition);
+ return this.str.substring(start, this.currentPosition);
+ };
+ StringTokenizer.prototype.nextToken$java_lang_String = function (delim) {
+ this.delimiters = delim;
+ this.delimsChanged = true;
+ this.setMaxDelimCodePoint();
+ return this.nextToken$();
+ };
+ /**
+ * Returns the next token in this string tokenizer's string. First,
+ * the set of characters considered to be delimiters by this
+ * StringTokenizer object is changed to be the characters in
+ * the string delim. Then the next token in the string
+ * after the current position is returned. The current position is
+ * advanced beyond the recognized token. The new delimiter set
+ * remains the default after this call.
+ *
+ * @param {string} delim the new delimiters.
+ * @return {string} the next token, after switching to the new delimiter set.
+ * @exception NoSuchElementException if there are no more tokens in this
+ * tokenizer's string.
+ * @exception NullPointerException if delim is null
+ */
+ StringTokenizer.prototype.nextToken = function (delim) {
+ if (((typeof delim === 'string') || delim === null)) {
+ return this.nextToken$java_lang_String(delim);
+ }
+ else if (delim === undefined) {
+ return this.nextToken$();
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ /**
+ * Returns the same value as the hasMoreTokens
+ * method. It exists so that this class can implement the
+ * Enumeration interface.
+ *
+ * @return {boolean} true if there are more tokens;
+ * false otherwise.
+ * @see java.util.Enumeration
+ * @see java.util.StringTokenizer#hasMoreTokens()
+ */
+ StringTokenizer.prototype.hasMoreElements = function () {
+ return this.hasMoreTokens();
+ };
+ /**
+ * Returns the same value as the nextToken method,
+ * except that its declared return value is Object rather than
+ * String. It exists so that this class can implement the
+ * Enumeration interface.
+ *
+ * @return {*} the next token in the string.
+ * @exception NoSuchElementException if there are no more tokens in this
+ * tokenizer's string.
+ * @see java.util.Enumeration
+ * @see java.util.StringTokenizer#nextToken()
+ */
+ StringTokenizer.prototype.nextElement = function () {
+ return this.nextToken$();
+ };
+ /**
+ * Calculates the number of times that this tokenizer's
+ * nextToken method can be called before it generates an
+ * exception. The current position is not advanced.
+ *
+ * @return {number} the number of tokens remaining in the string using the current
+ * delimiter set.
+ * @see java.util.StringTokenizer#nextToken()
+ */
+ StringTokenizer.prototype.countTokens = function () {
+ var count = 0;
+ var currpos = this.currentPosition;
+ while ((currpos < this.maxPosition)) {
+ {
+ currpos = this.skipDelimiters(currpos);
+ if (currpos >= this.maxPosition)
+ break;
+ currpos = this.scanToken(currpos);
+ count++;
+ }
+ }
+ ;
+ return count;
+ };
+ return StringTokenizer;
+ }());
+ util.StringTokenizer = StringTokenizer;
+ StringTokenizer["__class"] = "java.util.StringTokenizer";
+ StringTokenizer["__interfaces"] = ["java.util.Enumeration"];
+ })(util = java.util || (java.util = {}));
+})(java || (java = {}));
+(function (java) {
+ var util;
+ (function (util) {
+ var regex;
+ (function (regex) {
+ var Matcher = /** @class */ (function () {
+ function Matcher(_pattern, text) {
+ if (this._pattern === undefined) {
+ this._pattern = null;
+ }
+ if (this.text === undefined) {
+ this.text = null;
+ }
+ if (this.starts === undefined) {
+ this.starts = null;
+ }
+ if (this.ends === undefined) {
+ this.ends = null;
+ }
+ if (this.groups === undefined) {
+ this.groups = null;
+ }
+ this.first = -1;
+ this.last = 0;
+ this.lastAppendPosition = 0;
+ this._pattern = _pattern;
+ this.text = text;
+ this.reset$();
+ }
+ Matcher.prototype.hasGroups = function () {
+ if (this.groups == null)
+ throw new java.lang.IllegalStateException("No match available");
+ };
+ Matcher.prototype.searchWith = function (regExp) {
+ var startLastIndex = (regExp.lastIndex | 0);
+ var exec = regExp.exec(this.text);
+ this.groups = exec;
+ if (this.groups == null) {
+ this.reset$();
+ return false;
+ }
+ this.starts = [];
+ this.ends = [];
+ var parenthesisStart = [];
+ var parenthesisEnds = [];
+ var nonCapturesToCaptures = new Matcher.NonCapturesToCaptures(parenthesisStart, parenthesisEnds);
+ var regExpStringWithAllCaptures = (regExp.source).replace(new RegExp("((?:\\\\.|\\[\\^?\\]\\]|\\[\\^?(?:[^\\\\\\]]|\\\\.|)+\\])+)|\\(((?:\\?\\:)?)|(\\))", "g"), ((function (nonCapturesToCaptures) {
+ return function () {
+ var args = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ args[_i] = arguments[_i];
+ }
+ return nonCapturesToCaptures.apply(args);
+ };
+ })(nonCapturesToCaptures)));
+ var regExpWithAllCaptures = new RegExp(regExpStringWithAllCaptures);
+ var indexGetter = new Matcher.IndexGetter(regExp.source, parenthesisStart, parenthesisEnds, this.starts, this.ends, startLastIndex);
+ (this.text.substring(startLastIndex)).replace(regExpWithAllCaptures, ((function (indexGetter) {
+ return function () {
+ var args = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ args[_i] = arguments[_i];
+ }
+ return indexGetter.apply(args);
+ };
+ })(indexGetter)));
+ return true;
+ };
+ Matcher.prototype.end$ = function () {
+ return this.end$int(0);
+ };
+ Matcher.prototype.end$int = function (i) {
+ this.hasGroups();
+ return this.ends[i];
+ };
+ Matcher.prototype.end$java_lang_String = function (string) {
+ return this.end$int(this._pattern.namedGroupsNames.get(string) + this.regionStart());
+ };
+ Matcher.prototype.end = function (string) {
+ if (((typeof string === 'string') || string === null)) {
+ return this.end$java_lang_String(string);
+ }
+ else if (((typeof string === 'number') || string === null)) {
+ return this.end$int(string);
+ }
+ else if (string === undefined) {
+ return this.end$();
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ Matcher.prototype.find$ = function () {
+ return this.searchWith(this._pattern.regexp);
+ };
+ Matcher.prototype.find$int = function (start) {
+ this._pattern.regexp.lastIndex = start;
+ return this.find$();
+ };
+ Matcher.prototype.find = function (start) {
+ if (((typeof start === 'number') || start === null)) {
+ return this.find$int(start);
+ }
+ else if (start === undefined) {
+ return this.find$();
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ Matcher.prototype.group$ = function () {
+ return this.group$int(0);
+ };
+ Matcher.prototype.group$int = function (i) {
+ this.hasGroups();
+ return this.groups[i];
+ };
+ Matcher.prototype.group$java_lang_String = function (string) {
+ return this.group$int(this._pattern.namedGroupsNames.get(string) + this.regionStart());
+ };
+ Matcher.prototype.group = function (string) {
+ if (((typeof string === 'string') || string === null)) {
+ return this.group$java_lang_String(string);
+ }
+ else if (((typeof string === 'number') || string === null)) {
+ return this.group$int(string);
+ }
+ else if (string === undefined) {
+ return this.group$();
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ /**
+ *
+ * @return {number}
+ */
+ Matcher.prototype.groupCount = function () {
+ return this.groups.length - 1;
+ };
+ Matcher.prototype.hitEnd = function () {
+ return this.end$() === this.text.length;
+ };
+ Matcher.prototype.lookingAt = function () {
+ this.reset$();
+ return this.searchWith(java.util.regex.Pattern.compile$java_lang_String("^(?:" + this._pattern.pattern() + ")").regexp);
+ };
+ Matcher.prototype.matches = function () {
+ this.reset$();
+ return this.searchWith(java.util.regex.Pattern.compile$java_lang_String("^(?:" + this._pattern.pattern() + ")$").regexp);
+ };
+ Matcher.prototype.pattern = function () {
+ return this._pattern;
+ };
+ Matcher.prototype.regionEnd = function () {
+ this.hasGroups();
+ return this.groups.length;
+ };
+ Matcher.prototype.regionStart = function () {
+ this.hasGroups();
+ return 1;
+ };
+ Matcher.prototype.replaceAll = function (replacement) {
+ this.reset$();
+ this.text = (this.text).replace(this._pattern.regexp, replacement);
+ return this.text;
+ };
+ Matcher.prototype.replaceFirst = function (replacement) {
+ this.reset$();
+ var firstReplacer = new Matcher.FirstReplacer(replacement);
+ this.text = (this.text).replace(this._pattern.regexp, (((function (firstReplacer) {
+ return function (args) { return firstReplacer.apply(args); };
+ })(firstReplacer))));
+ return this.text;
+ };
+ Matcher.prototype.reset$ = function () {
+ this._pattern.regexp.lastIndex = 0;
+ this.groups = null;
+ this.starts = null;
+ this.ends = null;
+ this.first = -1;
+ this.last = 0;
+ return this;
+ };
+ Matcher.prototype.reset$java_lang_CharSequence = function (input) {
+ this.text = input.toString();
+ return this.reset$();
+ };
+ Matcher.prototype.reset = function (input) {
+ if (((input != null && (input["__interfaces"] != null && input["__interfaces"].indexOf("java.lang.CharSequence") >= 0 || input.constructor != null && input.constructor["__interfaces"] != null && input.constructor["__interfaces"].indexOf("java.lang.CharSequence") >= 0 || typeof input === "string")) || input === null)) {
+ return this.reset$java_lang_CharSequence(input);
+ }
+ else if (input === undefined) {
+ return this.reset$();
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ Matcher.prototype.start$ = function () {
+ return this.start$int(0);
+ };
+ Matcher.prototype.start$int = function (i) {
+ this.hasGroups();
+ return this.starts[i];
+ };
+ Matcher.prototype.start$java_lang_String = function (string) {
+ return this.start$int(this._pattern.namedGroupsNames.get(string) + this.regionStart());
+ };
+ Matcher.prototype.start = function (string) {
+ if (((typeof string === 'string') || string === null)) {
+ return this.start$java_lang_String(string);
+ }
+ else if (((typeof string === 'number') || string === null)) {
+ return this.start$int(string);
+ }
+ else if (string === undefined) {
+ return this.start$();
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ Matcher.prototype.toMatchResult = function () {
+ return this;
+ };
+ Matcher.prototype.usePattern = function (newPattern) {
+ this._pattern = newPattern;
+ return this;
+ };
+ return Matcher;
+ }());
+ regex.Matcher = Matcher;
+ Matcher["__class"] = "java.util.regex.Matcher";
+ Matcher["__interfaces"] = ["java.util.regex.MatchResult"];
+ (function (Matcher) {
+ var IndexGetter = /** @class */ (function () {
+ function IndexGetter(regexString, parenthesisStart, parenthesisEnd, starts, ends, startLastIndex) {
+ if (this.regexString === undefined) {
+ this.regexString = null;
+ }
+ if (this.parenthesisStart === undefined) {
+ this.parenthesisStart = null;
+ }
+ if (this.parenthesisEnd === undefined) {
+ this.parenthesisEnd = null;
+ }
+ if (this.starts === undefined) {
+ this.starts = null;
+ }
+ if (this.ends === undefined) {
+ this.ends = null;
+ }
+ if (this.startLastIndex === undefined) {
+ this.startLastIndex = 0;
+ }
+ this.regexString = regexString;
+ this.parenthesisStart = parenthesisStart;
+ this.parenthesisEnd = parenthesisEnd;
+ this.starts = starts;
+ this.ends = ends;
+ this.startLastIndex = startLastIndex;
+ }
+ /**
+ *
+ * @param {Array} args
+ * @return {string}
+ */
+ IndexGetter.prototype.apply = function (args) {
+ (this.starts).push((args[args.length - 2]));
+ (this.ends).push((this.starts[0]) + args[0].length);
+ var lastIndices = (new java.util.Stack());
+ lastIndices.push(this.ends[0]);
+ lastIndices.push(this.starts[0]);
+ var countEndsFrom = 0;
+ for (var i = 0; i < args.length - 3; ++i) {
+ {
+ var pl = this.parenthesisStart[i];
+ while ((this.parenthesisEnd[countEndsFrom] < pl)) {
+ {
+ countEndsFrom += 1;
+ lastIndices.pop();
+ }
+ }
+ ;
+ var start = lastIndices.pop();
+ var len = args[i + 1] != null ? args[i + 1].length : 0;
+ lastIndices.push(start + len);
+ lastIndices.push(start);
+ if ((function (c) { return c.charCodeAt == null ? c : c.charCodeAt(0); })(this.regexString.charAt(pl + 1)) == '?'.charCodeAt(0)) {
+ continue;
+ }
+ if (len === 0) {
+ (this.starts).push(-1);
+ (this.ends).push(-1);
+ }
+ else {
+ start += this.startLastIndex;
+ (this.starts).push(start);
+ (this.ends).push(start + len);
+ }
+ }
+ ;
+ }
+ this.starts[0] += this.startLastIndex;
+ this.ends[0] += this.startLastIndex;
+ return args[0];
+ };
+ return IndexGetter;
+ }());
+ Matcher.IndexGetter = IndexGetter;
+ IndexGetter["__class"] = "java.util.regex.Matcher.IndexGetter";
+ IndexGetter["__interfaces"] = ["java.util.function.Function"];
+ var NonCapturesToCaptures = /** @class */ (function () {
+ function NonCapturesToCaptures(start, ends) {
+ if (this.start === undefined) {
+ this.start = null;
+ }
+ if (this.ends === undefined) {
+ this.ends = null;
+ }
+ this.start = start;
+ this.ends = ends;
+ }
+ /**
+ *
+ * @param {Array} args
+ * @return {string}
+ */
+ NonCapturesToCaptures.prototype.apply = function (args) {
+ if (args[1] !== undefined) {
+ return args[1];
+ }
+ if (args[2] !== undefined) {
+ (this.start).push(javaemul.internal.IntegerHelper.parseInt((args[args.length - 2])));
+ return "(";
+ }
+ if (args[3] !== undefined) {
+ (this.ends).push(javaemul.internal.IntegerHelper.parseInt((args[args.length - 2])));
+ return args[3];
+ }
+ throw new Error("NonCapturesToCaptures");
+ };
+ return NonCapturesToCaptures;
+ }());
+ Matcher.NonCapturesToCaptures = NonCapturesToCaptures;
+ NonCapturesToCaptures["__class"] = "java.util.regex.Matcher.NonCapturesToCaptures";
+ NonCapturesToCaptures["__interfaces"] = ["java.util.function.Function"];
+ var FirstReplacer = /** @class */ (function () {
+ function FirstReplacer(replacement) {
+ if (this.replacement === undefined) {
+ this.replacement = null;
+ }
+ this.first = true;
+ this.replacement = replacement;
+ }
+ /**
+ *
+ * @param {Array} args
+ * @return {string}
+ */
+ FirstReplacer.prototype.apply = function (args) {
+ if (this.first) {
+ this.first = false;
+ return this.replacement;
+ }
+ return args[0];
+ };
+ return FirstReplacer;
+ }());
+ Matcher.FirstReplacer = FirstReplacer;
+ FirstReplacer["__class"] = "java.util.regex.Matcher.FirstReplacer";
+ FirstReplacer["__interfaces"] = ["java.util.function.Function"];
+ })(Matcher = regex.Matcher || (regex.Matcher = {}));
+ })(regex = util.regex || (util.regex = {}));
+ })(util = java.util || (java.util = {}));
+})(java || (java = {}));
+(function (java) {
+ var util;
+ (function (util) {
+ var regex;
+ (function (regex_1) {
+ var Pattern = /** @class */ (function () {
+ function Pattern(regexp, _flags, namedGroupsNames) {
+ if (this.regexp === undefined) {
+ this.regexp = null;
+ }
+ if (this._flags === undefined) {
+ this._flags = 0;
+ }
+ if (this.namedGroupsNames === undefined) {
+ this.namedGroupsNames = null;
+ }
+ this.regexp = regexp;
+ this._flags = _flags;
+ this.namedGroupsNames = namedGroupsNames;
+ }
+ Pattern.compile$java_lang_String = function (regexp) {
+ return Pattern.compile$java_lang_String$int(regexp, 0);
+ };
+ Pattern.compile$java_lang_String$int = function (regexpString, flags) {
+ var jsFlags = "g";
+ if ((flags & Pattern.MULTILINE) > 0) {
+ jsFlags += "m";
+ }
+ if ((flags & Pattern.CASE_INSENSITIVE) > 0) {
+ jsFlags += "i";
+ }
+ if ((flags & Pattern.UNICODE_CHARACTER_CLASS) > 0) {
+ jsFlags += "u";
+ }
+ if ((flags & Pattern.UNICODE_CASE) > 0) {
+ jsFlags += "ui";
+ }
+ var namedGroupsNames = (new java.util.HashMap());
+ var groupNameRemover = new Pattern.GroupNameRemover(namedGroupsNames);
+ regexpString = (regexpString).replace(new RegExp("(?:\\\\\\\\)*(\\\\?)\\[\\^?\\]?|(?:\\\\\\\\)*(\\\\?)\\]|(?:\\\\\\\\)*(\\\\?)\\((?:(\\?\\:)|\\?<([^>]+)>)?", "g"), (((function (groupNameRemover) {
+ return function () {
+ var args = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ args[_i] = arguments[_i];
+ }
+ return groupNameRemover.apply(args);
+ };
+ })(groupNameRemover)))).replace(new RegExp("(\\?\\:|(?:[*+?]|\\{[^\\}]+\\})*)((?:[^\\\\()|]|\\\\.|\\[\\^?\\]\\]|\\[\\^?(?:[^\\\\\\]]|\\\\.|)+\\])*)", "g"), ((function () {
+ var args = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ args[_i] = arguments[_i];
+ }
+ if (args[2] === undefined || args[2].length === 0) {
+ return args[1];
+ }
+ var regexp = args[args.length - 1];
+ var startIndexOfMatched = javaemul.internal.IntegerHelper.parseInt((args[args.length - 2]));
+ var endIndexOfMatched = startIndexOfMatched + args[0].length;
+ var hasOpenBracket = (startIndexOfMatched > 0 && ("(" === (regexp.charAt(startIndexOfMatched - 1)))) || (startIndexOfMatched > 2 && ("(?:" === (regexp.substr(startIndexOfMatched - 3, 3))));
+ var hasCloseBracket = regexp.length > endIndexOfMatched && (")" === (regexp.charAt(endIndexOfMatched)));
+ if (hasOpenBracket && hasCloseBracket) {
+ return args[1] + args[2];
+ }
+ return args[1] + "(?:" + args[2] + ")";
+ })));
+ try {
+ return new Pattern(new RegExp(regexpString, jsFlags), flags, namedGroupsNames);
+ }
+ catch (e) {
+ throw new java.util.regex.PatternSyntaxException(e, regexpString);
+ }
+ ;
+ };
+ Pattern.compile = function (regexpString, flags) {
+ if (((typeof regexpString === 'string') || regexpString === null) && ((typeof flags === 'number') || flags === null)) {
+ return java.util.regex.Pattern.compile$java_lang_String$int(regexpString, flags);
+ }
+ else if (((typeof regexpString === 'string') || regexpString === null) && flags === undefined) {
+ return java.util.regex.Pattern.compile$java_lang_String(regexpString);
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ Pattern.prototype.flags = function () {
+ return this._flags;
+ };
+ Pattern.prototype.matcher = function (sequence) {
+ return new java.util.regex.Matcher(this, sequence.toString());
+ };
+ Pattern.matches = function (regex, input) {
+ return Pattern.compile$java_lang_String(regex).matcher(input).matches();
+ };
+ Pattern.prototype.pattern = function () {
+ return this.regexp.source;
+ };
+ Pattern.quote = function (s) {
+ return JSON.stringify(s);
+ };
+ Pattern.prototype.split = function (input, limit) {
+ if (limit === void 0) { limit = 0; }
+ return (input.toString()).split(this.regexp, limit).toArray();
+ };
+ Pattern.prototype.splitAsStream = function (input) {
+ return java.util.Arrays.stream(this.split(input));
+ };
+ /**
+ *
+ * @return {string}
+ */
+ Pattern.prototype.toString = function () {
+ return this.pattern();
+ };
+ Pattern.CASE_INSENSITIVE = 2;
+ Pattern.MULTILINE = 8;
+ Pattern.UNICODE_CASE = 64;
+ Pattern.UNICODE_CHARACTER_CLASS = 256;
+ return Pattern;
+ }());
+ regex_1.Pattern = Pattern;
+ Pattern["__class"] = "java.util.regex.Pattern";
+ Pattern["__interfaces"] = ["java.io.Serializable"];
+ (function (Pattern) {
+ var GroupNameRemover = /** @class */ (function () {
+ function GroupNameRemover(namedGroupsNames) {
+ if (this.namedGroupsNames === undefined) {
+ this.namedGroupsNames = null;
+ }
+ this.count = 0;
+ this.inBrackets = false;
+ this.namedGroupsNames = namedGroupsNames;
+ }
+ /**
+ *
+ * @param {Array} args
+ * @return {string}
+ */
+ GroupNameRemover.prototype.apply = function (args) {
+ if (this.inBrackets || args[2] !== undefined) {
+ this.inBrackets = args[2] === undefined || args[2].length === 1;
+ return args[0];
+ }
+ if (args[1] !== undefined) {
+ this.inBrackets = args[1].length === 0;
+ return args[0];
+ }
+ if (args[3] !== undefined && args[3].length !== 0) {
+ return args[0];
+ }
+ if (args[4] === undefined) {
+ this.count += 1;
+ }
+ if (args[5] !== undefined) {
+ this.namedGroupsNames.put((args[5]), this.count);
+ args[0] = args[0].replace(new RegExp("\\?<[^>]+>"), "");
+ }
+ return args[0];
+ };
+ return GroupNameRemover;
+ }());
+ Pattern.GroupNameRemover = GroupNameRemover;
+ GroupNameRemover["__class"] = "java.util.regex.Pattern.GroupNameRemover";
+ GroupNameRemover["__interfaces"] = ["java.util.function.Function"];
+ })(Pattern = regex_1.Pattern || (regex_1.Pattern = {}));
+ })(regex = util.regex || (util.regex = {}));
+ })(util = java.util || (java.util = {}));
+})(java || (java = {}));
+(function (java) {
+ var util;
+ (function (util) {
+ /**
+ * Skeletal implementation of the Collection interface. [Sun
+ * docs]
+ *
+ * @param Comparator<String> compareString = Comparators.natural()
+ *
+ * @return {*} the natural Comparator
+ */
+ Comparators.natural = function () {
+ return (Comparators.NATURAL_$LI$());
+ };
+ return Comparators;
+ }());
+ util.Comparators = Comparators;
+ Comparators["__class"] = "java.util.Comparators";
+ (function (Comparators) {
+ var NaturalComparator = /** @class */ (function () {
+ function NaturalComparator() {
+ }
+ /**
+ *
+ * @param {*} o1
+ * @param {*} o2
+ * @return {number}
+ */
+ NaturalComparator.prototype.compare = function (o1, o2) {
+ javaemul.internal.InternalPreconditions.checkNotNull(o1);
+ javaemul.internal.InternalPreconditions.checkNotNull(o2);
+ if ((o1)["compareTo"] === undefined) {
+ return /* compareTo */ o1.toString().localeCompare(o2.toString());
+ }
+ return o1.compareTo(o2);
+ };
+ return NaturalComparator;
+ }());
+ Comparators.NaturalComparator = NaturalComparator;
+ NaturalComparator["__class"] = "java.util.Comparators.NaturalComparator";
+ NaturalComparator["__interfaces"] = ["java.util.Comparator"];
+ })(Comparators = util.Comparators || (util.Comparators = {}));
+ })(util = java.util || (java.util = {}));
+})(java || (java = {}));
+(function (java) {
+ var util;
+ (function (util) {
+ /**
+ * Represents a date and time.
+ * @param {number} year
+ * @param {number} month
+ * @param {number} date
+ * @param {number} hrs
+ * @param {number} min
+ * @param {number} sec
+ * @class
+ */
+ var Date = /** @class */ (function () {
+ function Date(year, month, date, hrs, min, sec) {
+ if (((typeof year === 'number') || year === null) && ((typeof month === 'number') || month === null) && ((typeof date === 'number') || date === null) && ((typeof hrs === 'number') || hrs === null) && ((typeof min === 'number') || min === null) && ((typeof sec === 'number') || sec === null)) {
+ var __args = arguments;
+ if (this.jsdate === undefined) {
+ this.jsdate = null;
+ }
+ this.jsdate = (new (Date.jsdateClass())());
+ this.jsdate["setFullYear"](this.jsdate, year + 1900, month, date);
+ this.jsdate["setHours"](this.jsdate, hrs, min, sec, 0);
+ this.fixDaylightSavings(hrs);
+ }
+ else if (((typeof year === 'number') || year === null) && ((typeof month === 'number') || month === null) && ((typeof date === 'number') || date === null) && ((typeof hrs === 'number') || hrs === null) && ((typeof min === 'number') || min === null) && sec === undefined) {
+ var __args = arguments;
+ {
+ var __args_6 = arguments;
+ var sec_1 = 0;
+ if (this.jsdate === undefined) {
+ this.jsdate = null;
+ }
+ this.jsdate = (new (Date.jsdateClass())());
+ this.jsdate["setFullYear"](this.jsdate, year + 1900, month, date);
+ this.jsdate["setHours"](this.jsdate, hrs, min, sec_1, 0);
+ this.fixDaylightSavings(hrs);
+ }
+ if (this.jsdate === undefined) {
+ this.jsdate = null;
+ }
+ }
+ else if (((typeof year === 'number') || year === null) && ((typeof month === 'number') || month === null) && ((typeof date === 'number') || date === null) && hrs === undefined && min === undefined && sec === undefined) {
+ var __args = arguments;
+ {
+ var __args_7 = arguments;
+ var hrs_1 = 0;
+ var min_1 = 0;
+ var sec_2 = 0;
+ if (this.jsdate === undefined) {
+ this.jsdate = null;
+ }
+ this.jsdate = (new (Date.jsdateClass())());
+ this.jsdate["setFullYear"](this.jsdate, year + 1900, month, date);
+ this.jsdate["setHours"](this.jsdate, hrs_1, min_1, sec_2, 0);
+ this.fixDaylightSavings(hrs_1);
+ }
+ if (this.jsdate === undefined) {
+ this.jsdate = null;
+ }
+ }
+ else if (((typeof year === 'string') || year === null) && month === undefined && date === undefined && hrs === undefined && min === undefined && sec === undefined) {
+ var __args = arguments;
+ var date_1 = __args[0];
+ {
+ var __args_8 = arguments;
+ var date_2 = Date.parse(__args_8[0]);
+ if (this.jsdate === undefined) {
+ this.jsdate = null;
+ }
+ this.jsdate = (new (Date.jsdateClass())(date_2));
+ }
+ if (this.jsdate === undefined) {
+ this.jsdate = null;
+ }
+ }
+ else if (((typeof year === 'number') || year === null) && month === undefined && date === undefined && hrs === undefined && min === undefined && sec === undefined) {
+ var __args = arguments;
+ var date_3 = __args[0];
+ if (this.jsdate === undefined) {
+ this.jsdate = null;
+ }
+ this.jsdate = (new (Date.jsdateClass())(date_3));
+ }
+ else if (year === undefined && month === undefined && date === undefined && hrs === undefined && min === undefined && sec === undefined) {
+ var __args = arguments;
+ if (this.jsdate === undefined) {
+ this.jsdate = null;
+ }
+ this.jsdate = (new (Date.jsdateClass())());
+ }
+ else
+ throw new Error('invalid overload');
+ }
+ Date.parse = function (s) {
+ var parsed = (Date.jsdateClass()["parse"](s));
+ if ( /* isNaN */isNaN(parsed)) {
+ throw new java.lang.IllegalArgumentException();
+ }
+ return (function (n) { return n < 0 ? Math.ceil(n) : Math.floor(n); })(parsed);
+ };
+ Date.UTC = function (year, month, date, hrs, min, sec) {
+ return (Date.jsdateClass()["UTC"](year + 1900, month, date, hrs, min, sec, 0));
+ };
+ /**
+ * Ensure a number is displayed with two digits.
+ *
+ * @return {string} a two-character base 10 representation of the number
+ * @param {number} number
+ */
+ Date.padTwo = function (number) {
+ if (number < 10) {
+ return "0" + number;
+ }
+ else {
+ return /* valueOf */ new String(number).toString();
+ }
+ };
+ Date.jsdateClass = function () {
+ return (window["Date"]);
+ };
+ Date.prototype.after = function (when) {
+ return this.getTime() > when.getTime();
+ };
+ Date.prototype.before = function (when) {
+ return this.getTime() < when.getTime();
+ };
+ Date.prototype.clone = function () {
+ return new Date(this.getTime());
+ };
+ Date.prototype.compareTo$java_util_Date = function (other) {
+ return /* compare */ (this.getTime() - other.getTime());
+ };
+ /**
+ *
+ * @param {java.util.Date} other
+ * @return {number}
+ */
+ Date.prototype.compareTo = function (other) {
+ if (((other != null && other instanceof Date) || other === null)) {
+ return this.compareTo$java_util_Date(other);
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ /**
+ *
+ * @param {*} obj
+ * @return {boolean}
+ */
+ Date.prototype.equals = function (obj) {
+ return ((obj != null && obj instanceof Date) && (this.getTime() === obj.getTime()));
+ };
+ Date.prototype.getDate = function () {
+ return (this.jsdate["getDate"](this.jsdate));
+ };
+ Date.prototype.getDay = function () {
+ return (this.jsdate["getDay"](this.jsdate));
+ };
+ Date.prototype.getHours = function () {
+ return (this.jsdate["getHours"](this.jsdate));
+ };
+ Date.prototype.getMinutes = function () {
+ return (this.jsdate["getMinutes"](this.jsdate));
+ };
+ Date.prototype.getMonth = function () {
+ return (this.jsdate["getMonth"](this.jsdate));
+ };
+ Date.prototype.getSeconds = function () {
+ return (this.jsdate["getSeconds"](this.jsdate));
+ };
+ Date.prototype.getTime = function () {
+ return (this.jsdate["getTime"](this.jsdate));
+ };
+ Date.prototype.getTimezoneOffset = function () {
+ return (this.jsdate["getTimezoneOffset"](this.jsdate));
+ };
+ Date.prototype.getYear = function () {
+ return (this.jsdate["getFullYear"](this.jsdate)) - 1900;
+ };
+ /**
+ *
+ * @return {number}
+ */
+ Date.prototype.hashCode = function () {
+ var time = this.getTime();
+ return ((time ^ (time >>> 32)) | 0);
+ };
+ Date.prototype.setDate = function (date) {
+ var hours = this.getHours();
+ this.jsdate["setDate"](this.jsdate, date);
+ this.fixDaylightSavings(hours);
+ };
+ Date.prototype.setHours = function (hours) {
+ this.jsdate["setHours"](this.jsdate, hours);
+ this.fixDaylightSavings(hours);
+ };
+ Date.prototype.setMinutes = function (minutes) {
+ var hours = this.getHours() + (minutes / 60 | 0);
+ this.jsdate["setMinutes"](this.jsdate, minutes);
+ this.fixDaylightSavings(hours);
+ };
+ Date.prototype.setMonth = function (month) {
+ var hours = this.getHours();
+ this.jsdate["setMonth"](this.jsdate, month);
+ this.fixDaylightSavings(hours);
+ };
+ Date.prototype.setSeconds = function (seconds) {
+ var hours = this.getHours() + (seconds / (60 * 60) | 0);
+ this.jsdate["setSeconds"](this.jsdate, seconds);
+ this.fixDaylightSavings(hours);
+ };
+ Date.prototype.setTime = function (time) {
+ this.jsdate["setTime"](this.jsdate, time);
+ };
+ Date.prototype.setYear = function (year) {
+ var hours = this.getHours();
+ this.jsdate["setFullYear"](this.jsdate, year + 1900);
+ this.fixDaylightSavings(hours);
+ };
+ Date.prototype.toGMTString = function () {
+ return this.jsdate["getUTCDate"](this.jsdate) + " " + Date.StringData.MONTHS_$LI$()[(this.jsdate["getUTCMonth"](this.jsdate))] + " " + this.jsdate["getUTCFullYear"](this.jsdate) + " " + Date.padTwo((this.jsdate["getUTCHours"](this.jsdate))) + ":" + Date.padTwo((this.jsdate["getUTCMinutes"](this.jsdate))) + ":" + Date.padTwo((this.jsdate["getUTCSeconds"](this.jsdate))) + " GMT";
+ };
+ Date.prototype.toLocaleString = function () {
+ return this.jsdate.toLocaleString();
+ };
+ /**
+ *
+ * @return {string}
+ */
+ Date.prototype.toString = function () {
+ var offset = -(this.getTimezoneOffset() | 0);
+ var hourOffset = ((offset >= 0) ? "+" : "") + ((offset / 60 | 0));
+ var minuteOffset = Date.padTwo(Math.abs(offset) % 60);
+ return Date.StringData.DAYS_$LI$()[(this.getDay() | 0)] + " " + Date.StringData.MONTHS_$LI$()[(this.getMonth() | 0)] + " " + Date.padTwo((this.getDate() | 0)) + " " + Date.padTwo((this.getHours() | 0)) + ":" + Date.padTwo((this.getMinutes() | 0)) + ":" + Date.padTwo((this.getSeconds() | 0)) + " GMT" + hourOffset + minuteOffset + " " + this.jsdate["getFullYear"](this.jsdate);
+ };
+ /**
+ * Detects if the requested time falls into a non-existent time range due to
+ * local time advancing into daylight savings time or is ambiguous due to
+ * going out of daylight savings. If so, adjust accordingly.
+ * @param {number} requestedHours
+ * @private
+ */
+ Date.prototype.fixDaylightSavings = function (requestedHours) {
+ requestedHours %= 24;
+ if (this.getHours() !== requestedHours) {
+ var copy = (new (Date.jsdateClass())(this.getTime()));
+ copy["setDate"](((copy["getDate"](copy)) + 1));
+ var timeDiff = (this.jsdate["getTimezoneOffset"](this.jsdate)) - (copy["getTimezoneOffset"](copy));
+ if (timeDiff > 0) {
+ var timeDiffHours = (timeDiff / 60 | 0);
+ var timeDiffMinutes = timeDiff % 60;
+ var day = (this.getDate() | 0);
+ var badHours = (this.getHours() | 0);
+ if (badHours + timeDiffHours >= 24) {
+ day++;
+ }
+ var newTime = (new (Date.jsdateClass())((this.jsdate["getFullYear"](this.jsdate)), this.getMonth(), day, requestedHours + timeDiffHours, this.getMinutes() + timeDiffMinutes, this.getSeconds(), (this.jsdate["getMilliseconds"](this.jsdate))));
+ this.setTime((newTime["getMilliseconds"](newTime)));
+ }
+ }
+ var originalTimeInMillis = this.getTime();
+ this.setTime(originalTimeInMillis + Date.ONE_HOUR_IN_MILLISECONDS);
+ if (this.getHours() !== requestedHours) {
+ this.setTime(originalTimeInMillis);
+ }
+ };
+ Date.ONE_HOUR_IN_MILLISECONDS = 60 * 60 * 1000;
+ return Date;
+ }());
+ util.Date = Date;
+ Date["__class"] = "java.util.Date";
+ Date["__interfaces"] = ["java.lang.Cloneable", "java.lang.Comparable", "java.io.Serializable"];
+ (function (Date) {
+ /**
+ * Encapsulates static data to avoid Date itself having a static
+ * initializer.
+ * @class
+ */
+ var StringData = /** @class */ (function () {
+ function StringData() {
+ }
+ StringData.DAYS_$LI$ = function () { if (StringData.DAYS == null) {
+ StringData.DAYS = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
+ } return StringData.DAYS; };
+ ;
+ StringData.MONTHS_$LI$ = function () { if (StringData.MONTHS == null) {
+ StringData.MONTHS = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
+ } return StringData.MONTHS; };
+ ;
+ return StringData;
+ }());
+ Date.StringData = StringData;
+ StringData["__class"] = "java.util.Date.StringData";
+ })(Date = util.Date || (util.Date = {}));
+ })(util = java.util || (java.util = {}));
+})(java || (java = {}));
+(function (java) {
+ var util;
+ (function (util) {
+ var logging;
+ (function (logging) {
+ /**
+ * An emulation of the java.util.logging.Handler class. See
+ *
+ * The Java API doc for details
+ * @class
+ */
+ var Handler = /** @class */ (function () {
+ function Handler() {
+ if (this.formatter === undefined) {
+ this.formatter = null;
+ }
+ if (this.level === undefined) {
+ this.level = null;
+ }
+ }
+ Handler.prototype.getFormatter = function () {
+ return this.formatter;
+ };
+ Handler.prototype.getLevel = function () {
+ if (this.level != null) {
+ return this.level;
+ }
+ return java.util.logging.Level.ALL_$LI$();
+ };
+ Handler.prototype.isLoggable = function (record) {
+ return this.getLevel().intValue() <= record.getLevel().intValue();
+ };
+ Handler.prototype.setFormatter = function (newFormatter) {
+ this.formatter = newFormatter;
+ };
+ Handler.prototype.setLevel = function (newLevel) {
+ this.level = newLevel;
+ };
+ return Handler;
+ }());
+ logging.Handler = Handler;
+ Handler["__class"] = "java.util.logging.Handler";
+ })(logging = util.logging || (util.logging = {}));
+ })(util = java.util || (java.util = {}));
+})(java || (java = {}));
+(function (java) {
+ var util;
+ (function (util) {
+ var logging;
+ (function (logging) {
+ /**
+ * An emulation of the java.util.logging.LogRecord class. See
+ *
+ * The Java API doc for details
+ * @param {java.util.logging.Level} level
+ * @param {string} msg
+ * @class
+ */
+ var LogRecord = /** @class */ (function () {
+ function LogRecord(level, msg) {
+ if (((level != null && level instanceof java.util.logging.Level) || level === null) && ((typeof msg === 'string') || msg === null)) {
+ var __args = arguments;
+ if (this.level === undefined) {
+ this.level = null;
+ }
+ if (this.msg === undefined) {
+ this.msg = null;
+ }
+ if (this.millis === undefined) {
+ this.millis = 0;
+ }
+ this.loggerName = "";
+ this.thrown = null;
+ this.level = level;
+ this.msg = msg;
+ this.millis = java.lang.System.currentTimeMillis();
+ }
+ else if (level === undefined && msg === undefined) {
+ var __args = arguments;
+ if (this.level === undefined) {
+ this.level = null;
+ }
+ if (this.msg === undefined) {
+ this.msg = null;
+ }
+ if (this.millis === undefined) {
+ this.millis = 0;
+ }
+ this.loggerName = "";
+ this.thrown = null;
+ }
+ else
+ throw new Error('invalid overload');
+ }
+ LogRecord.prototype.getLevel = function () {
+ return this.level;
+ };
+ LogRecord.prototype.getLoggerName = function () {
+ return this.loggerName;
+ };
+ LogRecord.prototype.getMessage = function () {
+ return this.msg;
+ };
+ LogRecord.prototype.getMillis = function () {
+ return this.millis;
+ };
+ LogRecord.prototype.getThrown = function () {
+ return this.thrown;
+ };
+ LogRecord.prototype.setLevel = function (newLevel) {
+ this.level = newLevel;
+ };
+ LogRecord.prototype.setLoggerName = function (newName) {
+ this.loggerName = newName;
+ };
+ LogRecord.prototype.setMessage = function (newMessage) {
+ this.msg = newMessage;
+ };
+ LogRecord.prototype.setMillis = function (newMillis) {
+ this.millis = newMillis;
+ };
+ LogRecord.prototype.setThrown = function (newThrown) {
+ this.thrown = newThrown;
+ };
+ return LogRecord;
+ }());
+ logging.LogRecord = LogRecord;
+ LogRecord["__class"] = "java.util.logging.LogRecord";
+ LogRecord["__interfaces"] = ["java.io.Serializable"];
+ })(logging = util.logging || (util.logging = {}));
+ })(util = java.util || (java.util = {}));
+})(java || (java = {}));
+(function (java) {
+ var util;
+ (function (util) {
+ var logging;
+ (function (logging) {
+ /**
+ * An emulation of the java.util.logging.LogManager class. See
+ *
+ * The Java API doc for details
+ * @class
+ */
+ var LogManager = /** @class */ (function () {
+ function LogManager() {
+ this.loggerMap = (new java.util.HashMap());
+ }
+ LogManager.getLogManager = function () {
+ if (LogManager.singleton == null) {
+ LogManager.singleton = new LogManager();
+ var rootLogger = new java.util.logging.Logger("", null);
+ rootLogger.setLevel(java.util.logging.Level.INFO_$LI$());
+ LogManager.singleton.addLoggerImpl(rootLogger);
+ }
+ return LogManager.singleton;
+ };
+ LogManager.prototype.addLogger = function (logger) {
+ if (this.getLogger(logger.getName()) != null) {
+ return false;
+ }
+ this.addLoggerAndEnsureParents(logger);
+ return true;
+ };
+ LogManager.prototype.getLogger = function (name) {
+ return this.loggerMap.get(name);
+ };
+ LogManager.prototype.getLoggerNames = function () {
+ return java.util.Collections.enumeration(this.loggerMap.keySet());
+ };
+ /**
+ * Helper function to add a logger when we have already determined that it
+ * does not exist. When we add a logger, we recursively add all of it's
+ * ancestors. Since loggers do not get removed, logger creation is cheap,
+ * and there are not usually too many loggers in an ancestry chain,
+ * this is a simple way to ensure that the parent/child relationships are
+ * always correctly set up.
+ * @param {java.util.logging.Logger} logger
+ * @private
+ */
+ /*private*/ LogManager.prototype.addLoggerAndEnsureParents = function (logger) {
+ var name = logger.getName();
+ var parentName = name.substring(0, Math.max(0, name.lastIndexOf('.')));
+ logger.setParent(this.ensureLogger(parentName));
+ this.addLoggerImpl(logger);
+ };
+ /*private*/ LogManager.prototype.addLoggerImpl = function (logger) {
+ if (java.lang.System.getProperty$java_lang_String$java_lang_String("gwt.logging.simpleConsoleHandler", "ENABLED") === ("ENABLED")) {
+ if ( /* isEmpty */(logger.getName().length === 0)) {
+ logger.addHandler(new java.util.logging.SimpleConsoleLogHandler());
+ }
+ }
+ this.loggerMap.put(logger.getName(), logger);
+ };
+ /**
+ * Helper function to create a logger if it does not exist since the public
+ * APIs for getLogger and addLogger make it difficult to use those functions
+ * for this.
+ * @param {string} name
+ * @return {java.util.logging.Logger}
+ */
+ LogManager.prototype.ensureLogger = function (name) {
+ var logger = this.getLogger(name);
+ if (logger == null) {
+ var newLogger = new java.util.logging.Logger(name, null);
+ this.addLoggerAndEnsureParents(newLogger);
+ return newLogger;
+ }
+ return logger;
+ };
+ LogManager.singleton = null;
+ return LogManager;
+ }());
+ logging.LogManager = LogManager;
+ LogManager["__class"] = "java.util.logging.LogManager";
+ })(logging = util.logging || (util.logging = {}));
+ })(util = java.util || (java.util = {}));
+})(java || (java = {}));
+(function (java) {
+ var util;
+ (function (util) {
+ var logging;
+ (function (logging) {
+ /**
+ * An emulation of the java.util.logging.Formatter class. See
+ *
+ * The Java API doc for details
+ * @class
+ */
+ var Formatter = /** @class */ (function () {
+ function Formatter() {
+ }
+ Formatter.prototype.formatMessage = function (record) {
+ return this.format(record);
+ };
+ return Formatter;
+ }());
+ logging.Formatter = Formatter;
+ Formatter["__class"] = "java.util.logging.Formatter";
+ })(logging = util.logging || (util.logging = {}));
+ })(util = java.util || (java.util = {}));
+})(java || (java = {}));
+(function (java) {
+ var util;
+ (function (util) {
+ var logging;
+ (function (logging) {
+ /**
+ * An emulation of the java.util.logging.Level class. See
+ *
+ * The Java API doc for details
+ * @class
+ */
+ var Level = /** @class */ (function () {
+ function Level() {
+ }
+ Level.ALL_$LI$ = function () { if (Level.ALL == null) {
+ Level.ALL = new Level.LevelAll();
+ } return Level.ALL; };
+ ;
+ Level.CONFIG_$LI$ = function () { if (Level.CONFIG == null) {
+ Level.CONFIG = new Level.LevelConfig();
+ } return Level.CONFIG; };
+ ;
+ Level.FINE_$LI$ = function () { if (Level.FINE == null) {
+ Level.FINE = new Level.LevelFine();
+ } return Level.FINE; };
+ ;
+ Level.FINER_$LI$ = function () { if (Level.FINER == null) {
+ Level.FINER = new Level.LevelFiner();
+ } return Level.FINER; };
+ ;
+ Level.FINEST_$LI$ = function () { if (Level.FINEST == null) {
+ Level.FINEST = new Level.LevelFinest();
+ } return Level.FINEST; };
+ ;
+ Level.INFO_$LI$ = function () { if (Level.INFO == null) {
+ Level.INFO = new Level.LevelInfo();
+ } return Level.INFO; };
+ ;
+ Level.OFF_$LI$ = function () { if (Level.OFF == null) {
+ Level.OFF = new Level.LevelOff();
+ } return Level.OFF; };
+ ;
+ Level.SEVERE_$LI$ = function () { if (Level.SEVERE == null) {
+ Level.SEVERE = new Level.LevelSevere();
+ } return Level.SEVERE; };
+ ;
+ Level.WARNING_$LI$ = function () { if (Level.WARNING == null) {
+ Level.WARNING = new Level.LevelWarning();
+ } return Level.WARNING; };
+ ;
+ Level.parse = function (name) {
+ java.util.logging.Logger.assertLoggingValues();
+ var loggingDisabled = java.lang.System.getProperty$java_lang_String$java_lang_String("gwt.logging.enabled", "FALSE") === ("FALSE");
+ if (loggingDisabled) {
+ return null;
+ }
+ var value = name.toUpperCase();
+ switch ((value)) {
+ case "ALL":
+ return Level.ALL_$LI$();
+ case "CONFIG":
+ return Level.CONFIG_$LI$();
+ case "FINE":
+ return Level.FINE_$LI$();
+ case "FINER":
+ return Level.FINER_$LI$();
+ case "FINEST":
+ return Level.FINEST_$LI$();
+ case "INFO":
+ return Level.INFO_$LI$();
+ case "OFF":
+ return Level.OFF_$LI$();
+ case "SEVERE":
+ return Level.SEVERE_$LI$();
+ case "WARNING":
+ return Level.WARNING_$LI$();
+ default:
+ throw new java.lang.IllegalArgumentException("Invalid level \"" + name + "\"");
+ }
+ };
+ Level.prototype.getName = function () {
+ return "DUMMY";
+ };
+ Level.prototype.intValue = function () {
+ return -1;
+ };
+ /**
+ *
+ * @return {string}
+ */
+ Level.prototype.toString = function () {
+ return this.getName();
+ };
+ return Level;
+ }());
+ logging.Level = Level;
+ Level["__class"] = "java.util.logging.Level";
+ Level["__interfaces"] = ["java.io.Serializable"];
+ (function (Level) {
+ var LevelAll = /** @class */ (function (_super) {
+ __extends(LevelAll, _super);
+ function LevelAll() {
+ return _super.call(this) || this;
+ }
+ /**
+ *
+ * @return {string}
+ */
+ LevelAll.prototype.getName = function () {
+ return "ALL";
+ };
+ /**
+ *
+ * @return {number}
+ */
+ LevelAll.prototype.intValue = function () {
+ return javaemul.internal.IntegerHelper.MIN_VALUE;
+ };
+ return LevelAll;
+ }(java.util.logging.Level));
+ Level.LevelAll = LevelAll;
+ LevelAll["__class"] = "java.util.logging.Level.LevelAll";
+ LevelAll["__interfaces"] = ["java.io.Serializable"];
+ var LevelConfig = /** @class */ (function (_super) {
+ __extends(LevelConfig, _super);
+ function LevelConfig() {
+ return _super.call(this) || this;
+ }
+ /**
+ *
+ * @return {string}
+ */
+ LevelConfig.prototype.getName = function () {
+ return "CONFIG";
+ };
+ /**
+ *
+ * @return {number}
+ */
+ LevelConfig.prototype.intValue = function () {
+ return 700;
+ };
+ return LevelConfig;
+ }(java.util.logging.Level));
+ Level.LevelConfig = LevelConfig;
+ LevelConfig["__class"] = "java.util.logging.Level.LevelConfig";
+ LevelConfig["__interfaces"] = ["java.io.Serializable"];
+ var LevelFine = /** @class */ (function (_super) {
+ __extends(LevelFine, _super);
+ function LevelFine() {
+ return _super.call(this) || this;
+ }
+ /**
+ *
+ * @return {string}
+ */
+ LevelFine.prototype.getName = function () {
+ return "FINE";
+ };
+ /**
+ *
+ * @return {number}
+ */
+ LevelFine.prototype.intValue = function () {
+ return 500;
+ };
+ return LevelFine;
+ }(java.util.logging.Level));
+ Level.LevelFine = LevelFine;
+ LevelFine["__class"] = "java.util.logging.Level.LevelFine";
+ LevelFine["__interfaces"] = ["java.io.Serializable"];
+ var LevelFiner = /** @class */ (function (_super) {
+ __extends(LevelFiner, _super);
+ function LevelFiner() {
+ return _super.call(this) || this;
+ }
+ /**
+ *
+ * @return {string}
+ */
+ LevelFiner.prototype.getName = function () {
+ return "FINER";
+ };
+ /**
+ *
+ * @return {number}
+ */
+ LevelFiner.prototype.intValue = function () {
+ return 400;
+ };
+ return LevelFiner;
+ }(java.util.logging.Level));
+ Level.LevelFiner = LevelFiner;
+ LevelFiner["__class"] = "java.util.logging.Level.LevelFiner";
+ LevelFiner["__interfaces"] = ["java.io.Serializable"];
+ var LevelFinest = /** @class */ (function (_super) {
+ __extends(LevelFinest, _super);
+ function LevelFinest() {
+ return _super.call(this) || this;
+ }
+ /**
+ *
+ * @return {string}
+ */
+ LevelFinest.prototype.getName = function () {
+ return "FINEST";
+ };
+ /**
+ *
+ * @return {number}
+ */
+ LevelFinest.prototype.intValue = function () {
+ return 300;
+ };
+ return LevelFinest;
+ }(java.util.logging.Level));
+ Level.LevelFinest = LevelFinest;
+ LevelFinest["__class"] = "java.util.logging.Level.LevelFinest";
+ LevelFinest["__interfaces"] = ["java.io.Serializable"];
+ var LevelInfo = /** @class */ (function (_super) {
+ __extends(LevelInfo, _super);
+ function LevelInfo() {
+ return _super.call(this) || this;
+ }
+ /**
+ *
+ * @return {string}
+ */
+ LevelInfo.prototype.getName = function () {
+ return "INFO";
+ };
+ /**
+ *
+ * @return {number}
+ */
+ LevelInfo.prototype.intValue = function () {
+ return 800;
+ };
+ return LevelInfo;
+ }(java.util.logging.Level));
+ Level.LevelInfo = LevelInfo;
+ LevelInfo["__class"] = "java.util.logging.Level.LevelInfo";
+ LevelInfo["__interfaces"] = ["java.io.Serializable"];
+ var LevelOff = /** @class */ (function (_super) {
+ __extends(LevelOff, _super);
+ function LevelOff() {
+ return _super.call(this) || this;
+ }
+ /**
+ *
+ * @return {string}
+ */
+ LevelOff.prototype.getName = function () {
+ return "OFF";
+ };
+ /**
+ *
+ * @return {number}
+ */
+ LevelOff.prototype.intValue = function () {
+ return javaemul.internal.IntegerHelper.MAX_VALUE;
+ };
+ return LevelOff;
+ }(java.util.logging.Level));
+ Level.LevelOff = LevelOff;
+ LevelOff["__class"] = "java.util.logging.Level.LevelOff";
+ LevelOff["__interfaces"] = ["java.io.Serializable"];
+ var LevelSevere = /** @class */ (function (_super) {
+ __extends(LevelSevere, _super);
+ function LevelSevere() {
+ return _super.call(this) || this;
+ }
+ /**
+ *
+ * @return {string}
+ */
+ LevelSevere.prototype.getName = function () {
+ return "SEVERE";
+ };
+ /**
+ *
+ * @return {number}
+ */
+ LevelSevere.prototype.intValue = function () {
+ return 1000;
+ };
+ return LevelSevere;
+ }(java.util.logging.Level));
+ Level.LevelSevere = LevelSevere;
+ LevelSevere["__class"] = "java.util.logging.Level.LevelSevere";
+ LevelSevere["__interfaces"] = ["java.io.Serializable"];
+ var LevelWarning = /** @class */ (function (_super) {
+ __extends(LevelWarning, _super);
+ function LevelWarning() {
+ return _super.call(this) || this;
+ }
+ /**
+ *
+ * @return {string}
+ */
+ LevelWarning.prototype.getName = function () {
+ return "WARNING";
+ };
+ /**
+ *
+ * @return {number}
+ */
+ LevelWarning.prototype.intValue = function () {
+ return 900;
+ };
+ return LevelWarning;
+ }(java.util.logging.Level));
+ Level.LevelWarning = LevelWarning;
+ LevelWarning["__class"] = "java.util.logging.Level.LevelWarning";
+ LevelWarning["__interfaces"] = ["java.io.Serializable"];
+ })(Level = logging.Level || (logging.Level = {}));
+ })(logging = util.logging || (util.logging = {}));
+ })(util = java.util || (java.util = {}));
+})(java || (java = {}));
+(function (java) {
+ var util;
+ (function (util) {
+ /**
+ * See
+ * the official Java API doc for details.
+ * @param {*} delimiter
+ * @param {*} prefix
+ * @param {*} suffix
+ * @class
+ */
+ var StringJoiner = /** @class */ (function () {
+ function StringJoiner(delimiter, prefix, suffix) {
+ if (((delimiter != null && (delimiter["__interfaces"] != null && delimiter["__interfaces"].indexOf("java.lang.CharSequence") >= 0 || delimiter.constructor != null && delimiter.constructor["__interfaces"] != null && delimiter.constructor["__interfaces"].indexOf("java.lang.CharSequence") >= 0 || typeof delimiter === "string")) || delimiter === null) && ((prefix != null && (prefix["__interfaces"] != null && prefix["__interfaces"].indexOf("java.lang.CharSequence") >= 0 || prefix.constructor != null && prefix.constructor["__interfaces"] != null && prefix.constructor["__interfaces"].indexOf("java.lang.CharSequence") >= 0 || typeof prefix === "string")) || prefix === null) && ((suffix != null && (suffix["__interfaces"] != null && suffix["__interfaces"].indexOf("java.lang.CharSequence") >= 0 || suffix.constructor != null && suffix.constructor["__interfaces"] != null && suffix.constructor["__interfaces"].indexOf("java.lang.CharSequence") >= 0 || typeof suffix === "string")) || suffix === null)) {
+ var __args = arguments;
+ if (this.delimiter === undefined) {
+ this.delimiter = null;
+ }
+ if (this.prefix === undefined) {
+ this.prefix = null;
+ }
+ if (this.suffix === undefined) {
+ this.suffix = null;
+ }
+ if (this.builder === undefined) {
+ this.builder = null;
+ }
+ if (this.emptyValue === undefined) {
+ this.emptyValue = null;
+ }
+ javaemul.internal.InternalPreconditions.checkNotNull(delimiter, "delimiter");
+ javaemul.internal.InternalPreconditions.checkNotNull(prefix, "prefix");
+ javaemul.internal.InternalPreconditions.checkNotNull(suffix, "suffix");
+ this.delimiter = delimiter.toString();
+ this.prefix = prefix.toString();
+ this.suffix = suffix.toString();
+ this.emptyValue = this.prefix + this.suffix;
+ }
+ else if (((delimiter != null && (delimiter["__interfaces"] != null && delimiter["__interfaces"].indexOf("java.lang.CharSequence") >= 0 || delimiter.constructor != null && delimiter.constructor["__interfaces"] != null && delimiter.constructor["__interfaces"].indexOf("java.lang.CharSequence") >= 0 || typeof delimiter === "string")) || delimiter === null) && prefix === undefined && suffix === undefined) {
+ var __args = arguments;
+ {
+ var __args_9 = arguments;
+ var prefix_1 = "";
+ var suffix_1 = "";
+ if (this.delimiter === undefined) {
+ this.delimiter = null;
+ }
+ if (this.prefix === undefined) {
+ this.prefix = null;
+ }
+ if (this.suffix === undefined) {
+ this.suffix = null;
+ }
+ if (this.builder === undefined) {
+ this.builder = null;
+ }
+ if (this.emptyValue === undefined) {
+ this.emptyValue = null;
+ }
+ javaemul.internal.InternalPreconditions.checkNotNull(delimiter, "delimiter");
+ javaemul.internal.InternalPreconditions.checkNotNull(prefix_1, "prefix");
+ javaemul.internal.InternalPreconditions.checkNotNull(suffix_1, "suffix");
+ this.delimiter = delimiter.toString();
+ this.prefix = prefix_1.toString();
+ this.suffix = suffix_1.toString();
+ this.emptyValue = this.prefix + this.suffix;
+ }
+ if (this.delimiter === undefined) {
+ this.delimiter = null;
+ }
+ if (this.prefix === undefined) {
+ this.prefix = null;
+ }
+ if (this.suffix === undefined) {
+ this.suffix = null;
+ }
+ if (this.builder === undefined) {
+ this.builder = null;
+ }
+ if (this.emptyValue === undefined) {
+ this.emptyValue = null;
+ }
+ }
+ else
+ throw new Error('invalid overload');
+ }
+ StringJoiner.prototype.add = function (newElement) {
+ this.initBuilderOrAddDelimiter();
+ this.builder.append$java_lang_CharSequence(newElement);
+ return this;
+ };
+ StringJoiner.prototype.length = function () {
+ if (this.builder == null) {
+ return this.emptyValue.length;
+ }
+ return this.builder.length() + this.suffix.length;
+ };
+ StringJoiner.prototype.merge = function (other) {
+ if (other.builder != null) {
+ var otherLength = other.builder.length();
+ this.initBuilderOrAddDelimiter();
+ this.builder.append$java_lang_CharSequence$int$int(other.builder, other.prefix.length, otherLength);
+ }
+ return this;
+ };
+ StringJoiner.prototype.setEmptyValue = function (emptyValue) {
+ javaemul.internal.InternalPreconditions.checkNotNull(emptyValue);
+ this.emptyValue = emptyValue.toString();
+ return this;
+ };
+ /**
+ *
+ * @return {string}
+ */
+ StringJoiner.prototype.toString = function () {
+ if (this.builder == null) {
+ return this.emptyValue;
+ }
+ else if ( /* isEmpty */(this.suffix.length === 0)) {
+ return this.builder.toString();
+ }
+ else {
+ return this.builder.toString() + this.suffix;
+ }
+ };
+ /*private*/ StringJoiner.prototype.initBuilderOrAddDelimiter = function () {
+ if (this.builder == null) {
+ this.builder = new java.lang.StringBuilder(this.prefix);
+ }
+ else {
+ this.builder.append$java_lang_String(this.delimiter);
+ }
+ };
+ return StringJoiner;
+ }());
+ util.StringJoiner = StringJoiner;
+ StringJoiner["__class"] = "java.util.StringJoiner";
+ })(util = java.util || (java.util = {}));
+})(java || (java = {}));
+(function (java) {
+ var util;
+ (function (util) {
+ /**
+ * Basic {@link Map.Entry} implementation that implements hashCode, equals, and
+ * toString.
+ * @class
+ */
+ var AbstractMapEntry = /** @class */ (function () {
+ function AbstractMapEntry() {
+ }
+ /**
+ *
+ * @param {*} other
+ * @return {boolean}
+ */
+ AbstractMapEntry.prototype.equals = function (other) {
+ if (!(other != null && (other["__interfaces"] != null && other["__interfaces"].indexOf("java.util.Map.Entry") >= 0 || other.constructor != null && other.constructor["__interfaces"] != null && other.constructor["__interfaces"].indexOf("java.util.Map.Entry") >= 0))) {
+ return false;
+ }
+ var entry = other;
+ return java.util.Objects.equals(this.getKey(), entry.getKey()) && java.util.Objects.equals(this.getValue(), entry.getValue());
+ };
+ /**
+ * Calculate the hash code using Sun's specified algorithm.
+ * @return {number}
+ */
+ AbstractMapEntry.prototype.hashCode = function () {
+ return java.util.Objects.hashCode(this.getKey()) ^ java.util.Objects.hashCode(this.getValue());
+ };
+ /**
+ *
+ * @return {string}
+ */
+ AbstractMapEntry.prototype.toString = function () {
+ return this.getKey() + "=" + this.getValue();
+ };
+ return AbstractMapEntry;
+ }());
+ util.AbstractMapEntry = AbstractMapEntry;
+ AbstractMapEntry["__class"] = "java.util.AbstractMapEntry";
+ AbstractMapEntry["__interfaces"] = ["java.util.Map.Entry"];
+ })(util = java.util || (java.util = {}));
+})(java || (java = {}));
+(function (java) {
+ var security;
+ (function (security) {
+ /**
+ * Message Digest Service Provider Interface - [Sun's
+ * docs].
+ * @class
+ */
+ var MessageDigestSpi = /** @class */ (function () {
+ function MessageDigestSpi() {
+ }
+ MessageDigestSpi.prototype.engineDigest$ = function () { throw new Error('cannot invoke abstract overloaded method... check your argument(s) type(s)'); };
+ MessageDigestSpi.prototype.engineDigest$byte_A$int$int = function (buf, offset, len) {
+ var digest = this.engineDigest$();
+ if (buf.length < digest.length + offset) {
+ throw new java.security.DigestException("Insufficient buffer space for digest");
+ }
+ if (len < digest.length) {
+ throw new java.security.DigestException("Length not large enough to hold digest");
+ }
+ java.lang.System.arraycopy(digest, 0, buf, offset, digest.length);
+ return digest.length;
+ };
+ MessageDigestSpi.prototype.engineDigest = function (buf, offset, len) {
+ if (((buf != null && buf instanceof Array && (buf.length == 0 || buf[0] == null || (typeof buf[0] === 'number'))) || buf === null) && ((typeof offset === 'number') || offset === null) && ((typeof len === 'number') || len === null)) {
+ return this.engineDigest$byte_A$int$int(buf, offset, len);
+ }
+ else if (buf === undefined && offset === undefined && len === undefined) {
+ return this.engineDigest$();
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ MessageDigestSpi.prototype.engineGetDigestLength = function () {
+ return 0;
+ };
+ MessageDigestSpi.prototype.engineUpdate$byte = function (input) { throw new Error('cannot invoke abstract overloaded method... check your argument(s) type(s)'); };
+ MessageDigestSpi.prototype.engineUpdate$byte_A$int$int = function (input, offset, len) { throw new Error('cannot invoke abstract overloaded method... check your argument(s) type(s)'); };
+ MessageDigestSpi.prototype.engineUpdate = function (input, offset, len) {
+ if (((input != null && input instanceof Array && (input.length == 0 || input[0] == null || (typeof input[0] === 'number'))) || input === null) && ((typeof offset === 'number') || offset === null) && ((typeof len === 'number') || len === null)) {
+ return this.engineUpdate$byte_A$int$int(input, offset, len);
+ }
+ else if (((typeof input === 'number') || input === null) && offset === undefined && len === undefined) {
+ return this.engineUpdate$byte(input);
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ return MessageDigestSpi;
+ }());
+ security.MessageDigestSpi = MessageDigestSpi;
+ MessageDigestSpi["__class"] = "java.security.MessageDigestSpi";
+ })(security = java.security || (java.security = {}));
+})(java || (java = {}));
+(function (java) {
+ var io;
+ (function (io) {
+ /**
+ * Provides a series of utilities to be reused between IO classes.
+ *
+ * TODO(chehayeb): move these checks to InternalPreconditions.
+ * @class
+ */
+ var IOUtils = /** @class */ (function () {
+ function IOUtils() {
+ }
+ IOUtils.checkOffsetAndCount$byte_A$int$int = function (buffer, byteOffset, byteCount) {
+ javaemul.internal.InternalPreconditions.checkNotNull(buffer);
+ IOUtils.checkOffsetAndCount$int$int$int(buffer.length, byteOffset, byteCount);
+ };
+ /**
+ * Validates the offset and the byte count for the given array of bytes.
+ *
+ * @param {Array} buffer Array of bytes to be checked.
+ * @param {number} byteOffset Starting offset in the array.
+ * @param {number} byteCount Total number of bytes to be accessed.
+ * @throws NullPointerException if the given reference to the buffer is null.
+ * @throws IndexOutOfBoundsException if {@code byteOffset} is negative, {@code byteCount} is
+ * negative or their sum exceeds the buffer length.
+ */
+ IOUtils.checkOffsetAndCount = function (buffer, byteOffset, byteCount) {
+ if (((buffer != null && buffer instanceof Array && (buffer.length == 0 || buffer[0] == null || (typeof buffer[0] === 'number'))) || buffer === null) && ((typeof byteOffset === 'number') || byteOffset === null) && ((typeof byteCount === 'number') || byteCount === null)) {
+ return java.io.IOUtils.checkOffsetAndCount$byte_A$int$int(buffer, byteOffset, byteCount);
+ }
+ else if (((buffer != null && buffer instanceof Array && (buffer.length == 0 || buffer[0] == null || (typeof buffer[0] === 'string'))) || buffer === null) && ((typeof byteOffset === 'number') || byteOffset === null) && ((typeof byteCount === 'number') || byteCount === null)) {
+ return java.io.IOUtils.checkOffsetAndCount$char_A$int$int(buffer, byteOffset, byteCount);
+ }
+ else if (((typeof buffer === 'number') || buffer === null) && ((typeof byteOffset === 'number') || byteOffset === null) && ((typeof byteCount === 'number') || byteCount === null)) {
+ return java.io.IOUtils.checkOffsetAndCount$int$int$int(buffer, byteOffset, byteCount);
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ IOUtils.checkOffsetAndCount$char_A$int$int = function (buffer, charOffset, charCount) {
+ javaemul.internal.InternalPreconditions.checkNotNull(buffer);
+ IOUtils.checkOffsetAndCount$int$int$int(buffer.length, charOffset, charCount);
+ };
+ /*private*/ IOUtils.checkOffsetAndCount$int$int$int = function (length, offset, count) {
+ if ((offset < 0) || (count < 0) || ((offset + count) > length)) {
+ throw new java.lang.IndexOutOfBoundsException();
+ }
+ };
+ return IOUtils;
+ }());
+ io.IOUtils = IOUtils;
+ IOUtils["__class"] = "java.io.IOUtils";
+ })(io = java.io || (java.io = {}));
+})(java || (java = {}));
+(function (java) {
+ var io;
+ (function (io) {
+ /**
+ * JSweet implementation.
+ * @class
+ */
+ var Writer = /** @class */ (function () {
+ function Writer(lock) {
+ if (((lock != null) || lock === null)) {
+ var __args = arguments;
+ if (this.writeBuffer === undefined) {
+ this.writeBuffer = null;
+ }
+ if (this.lock === undefined) {
+ this.lock = null;
+ }
+ if (lock == null) {
+ throw new java.lang.NullPointerException();
+ }
+ this.lock = lock;
+ }
+ else if (lock === undefined) {
+ var __args = arguments;
+ if (this.writeBuffer === undefined) {
+ this.writeBuffer = null;
+ }
+ if (this.lock === undefined) {
+ this.lock = null;
+ }
+ this.lock = this;
+ }
+ else
+ throw new Error('invalid overload');
+ }
+ Writer.prototype.write$int = function (c) {
+ {
+ if (this.writeBuffer == null) {
+ this.writeBuffer = (function (s) { var a = []; while (s-- > 0)
+ a.push(null); return a; })(Writer.WRITE_BUFFER_SIZE);
+ }
+ this.writeBuffer[0] = String.fromCharCode(c);
+ this.write$char_A$int$int(this.writeBuffer, 0, 1);
+ }
+ ;
+ };
+ Writer.prototype.write$char_A = function (cbuf) {
+ this.write$char_A$int$int(cbuf, 0, cbuf.length);
+ };
+ Writer.prototype.write$char_A$int$int = function (cbuf, off, len) { throw new Error('cannot invoke abstract overloaded method... check your argument(s) type(s)'); };
+ Writer.prototype.write$java_lang_String = function (str) {
+ this.write$java_lang_String$int$int(str, 0, str.length);
+ };
+ Writer.prototype.write$java_lang_String$int$int = function (str, off, len) {
+ {
+ var cbuf = void 0;
+ if (len <= Writer.WRITE_BUFFER_SIZE) {
+ if (this.writeBuffer == null) {
+ this.writeBuffer = (function (s) { var a = []; while (s-- > 0)
+ a.push(null); return a; })(Writer.WRITE_BUFFER_SIZE);
+ }
+ cbuf = this.writeBuffer;
+ }
+ else {
+ cbuf = (function (s) { var a = []; while (s-- > 0)
+ a.push(null); return a; })(len);
+ }
+ /* getChars */ (function (a, s, e, d, l) { d.splice.apply(d, [l, e - s].concat(a.substring(s, e).split(''))); })(str, off, (off + len), cbuf, 0);
+ this.write$char_A$int$int(cbuf, 0, len);
+ }
+ ;
+ };
+ Writer.prototype.write = function (str, off, len) {
+ if (((typeof str === 'string') || str === null) && ((typeof off === 'number') || off === null) && ((typeof len === 'number') || len === null)) {
+ return this.write$java_lang_String$int$int(str, off, len);
+ }
+ else if (((str != null && str instanceof Array && (str.length == 0 || str[0] == null || (typeof str[0] === 'string'))) || str === null) && ((typeof off === 'number') || off === null) && ((typeof len === 'number') || len === null)) {
+ return this.write$char_A$int$int(str, off, len);
+ }
+ else if (((str != null && str instanceof Array && (str.length == 0 || str[0] == null || (typeof str[0] === 'string'))) || str === null) && off === undefined && len === undefined) {
+ return this.write$char_A(str);
+ }
+ else if (((typeof str === 'string') || str === null) && off === undefined && len === undefined) {
+ return this.write$java_lang_String(str);
+ }
+ else if (((typeof str === 'number') || str === null) && off === undefined && len === undefined) {
+ return this.write$int(str);
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ Writer.prototype.append$java_lang_CharSequence = function (csq) {
+ if (csq == null)
+ this.write$java_lang_String("null");
+ else
+ this.write$java_lang_String(csq.toString());
+ return this;
+ };
+ Writer.prototype.append$java_lang_CharSequence$int$int = function (csq, start, end) {
+ var cs = (csq == null ? "null" : csq);
+ this.write$java_lang_String(/* subSequence */ cs.substring(start, end).toString());
+ return this;
+ };
+ Writer.prototype.append = function (csq, start, end) {
+ if (((csq != null && (csq["__interfaces"] != null && csq["__interfaces"].indexOf("java.lang.CharSequence") >= 0 || csq.constructor != null && csq.constructor["__interfaces"] != null && csq.constructor["__interfaces"].indexOf("java.lang.CharSequence") >= 0 || typeof csq === "string")) || csq === null) && ((typeof start === 'number') || start === null) && ((typeof end === 'number') || end === null)) {
+ return this.append$java_lang_CharSequence$int$int(csq, start, end);
+ }
+ else if (((csq != null && (csq["__interfaces"] != null && csq["__interfaces"].indexOf("java.lang.CharSequence") >= 0 || csq.constructor != null && csq.constructor["__interfaces"] != null && csq.constructor["__interfaces"].indexOf("java.lang.CharSequence") >= 0 || typeof csq === "string")) || csq === null) && start === undefined && end === undefined) {
+ return this.append$java_lang_CharSequence(csq);
+ }
+ else if (((typeof csq === 'string') || csq === null) && start === undefined && end === undefined) {
+ return this.append$char(csq);
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ Writer.prototype.append$char = function (c) {
+ this.write$int((c).charCodeAt(0));
+ return this;
+ };
+ Writer.WRITE_BUFFER_SIZE = 1024;
+ return Writer;
+ }());
+ io.Writer = Writer;
+ Writer["__class"] = "java.io.Writer";
+ Writer["__interfaces"] = ["java.lang.Appendable", "java.io.Closeable", "java.lang.AutoCloseable", "java.io.Flushable"];
+ })(io = java.io || (java.io = {}));
+})(java || (java = {}));
+(function (java) {
+ var io;
+ (function (io) {
+ /**
+ * This constructor does nothing. It is provided for signature
+ * compatibility.
+ * @class
+ * @extends *
+ */
+ var InputStream = /** @class */ (function () {
+ function InputStream() {
+ }
+ /**
+ * Returns an estimated number of bytes that can be read or skipped without blocking for more
+ * input.
+ *
+ * StringBuffer.
+ * @param {string} string
+ * @class
+ */
+ var AbstractStringBuilder = /** @class */ (function () {
+ function AbstractStringBuilder(string) {
+ if (this.string === undefined) {
+ this.string = null;
+ }
+ this.string = string;
+ }
+ AbstractStringBuilder.prototype.length = function () {
+ return this.string.length;
+ };
+ AbstractStringBuilder.prototype.setLength = function (newLength) {
+ var oldLength = this.length();
+ if (newLength < oldLength) {
+ this.string = this.string.substring(0, newLength);
+ }
+ else if (newLength > oldLength) {
+ this.string += /* valueOf */ new String((function (s) { var a = []; while (s-- > 0)
+ a.push(null); return a; })(newLength - oldLength)).toString();
+ }
+ };
+ AbstractStringBuilder.prototype.capacity = function () {
+ return javaemul.internal.IntegerHelper.MAX_VALUE;
+ };
+ AbstractStringBuilder.prototype.ensureCapacity = function (ignoredCapacity) {
+ };
+ AbstractStringBuilder.prototype.trimToSize = function () {
+ };
+ AbstractStringBuilder.prototype.charAt = function (index) {
+ return this.string.charAt(index);
+ };
+ AbstractStringBuilder.prototype.getChars = function (srcStart, srcEnd, dst, dstStart) {
+ javaemul.internal.InternalPreconditions.checkStringBounds(srcStart, srcEnd, this.length());
+ javaemul.internal.InternalPreconditions.checkStringBounds(dstStart, dstStart + (srcEnd - srcStart), dst.length);
+ while ((srcStart < srcEnd)) {
+ {
+ dst[dstStart++] = this.string.charAt(srcStart++);
+ }
+ }
+ ;
+ };
+ /**
+ * Warning! This method is much slower than the JRE implementation. If you need to do
+ * character level manipulation, you are strongly advised to use a char[] directly.
+ * @param {number} index
+ * @param {string} x
+ */
+ AbstractStringBuilder.prototype.setCharAt = function (index, x) {
+ this.replace0(index, index + 1, /* valueOf */ new String(x).toString());
+ };
+ AbstractStringBuilder.prototype.subSequence = function (start, end) {
+ return this.string.substring(start, end);
+ };
+ AbstractStringBuilder.prototype.substring$int = function (begin) {
+ return this.string.substring(begin);
+ };
+ AbstractStringBuilder.prototype.substring$int$int = function (begin, end) {
+ return this.string.substring(begin, end);
+ };
+ AbstractStringBuilder.prototype.substring = function (begin, end) {
+ if (((typeof begin === 'number') || begin === null) && ((typeof end === 'number') || end === null)) {
+ return this.substring$int$int(begin, end);
+ }
+ else if (((typeof begin === 'number') || begin === null) && end === undefined) {
+ return this.substring$int(begin);
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ AbstractStringBuilder.prototype.indexOf$java_lang_String = function (x) {
+ return this.string.indexOf(x);
+ };
+ AbstractStringBuilder.prototype.indexOf$java_lang_String$int = function (x, start) {
+ return this.string.indexOf(x, start);
+ };
+ AbstractStringBuilder.prototype.indexOf = function (x, start) {
+ if (((typeof x === 'string') || x === null) && ((typeof start === 'number') || start === null)) {
+ return this.indexOf$java_lang_String$int(x, start);
+ }
+ else if (((typeof x === 'string') || x === null) && start === undefined) {
+ return this.indexOf$java_lang_String(x);
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ AbstractStringBuilder.prototype.lastIndexOf$java_lang_String = function (s) {
+ return this.string.lastIndexOf(s);
+ };
+ AbstractStringBuilder.prototype.lastIndexOf$java_lang_String$int = function (s, start) {
+ return this.string.lastIndexOf(s, start);
+ };
+ AbstractStringBuilder.prototype.lastIndexOf = function (s, start) {
+ if (((typeof s === 'string') || s === null) && ((typeof start === 'number') || start === null)) {
+ return this.lastIndexOf$java_lang_String$int(s, start);
+ }
+ else if (((typeof s === 'string') || s === null) && start === undefined) {
+ return this.lastIndexOf$java_lang_String(s);
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ /**
+ *
+ * @return {string}
+ */
+ AbstractStringBuilder.prototype.toString = function () {
+ return this.string;
+ };
+ AbstractStringBuilder.prototype.append0 = function (x, start, end) {
+ if (x == null) {
+ x = "null";
+ }
+ this.string += /* subSequence */ x.substring(start, end);
+ };
+ AbstractStringBuilder.prototype.appendCodePoint0 = function (x) {
+ this.string += /* valueOf */ new String(/* toChars */ String.fromCharCode(x)).toString();
+ };
+ AbstractStringBuilder.prototype.replace0 = function (start, end, toInsert) {
+ this.string = this.string.substring(0, start) + toInsert + this.string.substring(end);
+ };
+ AbstractStringBuilder.prototype.reverse0 = function () {
+ var length = this.string.length;
+ if (length <= 1) {
+ return;
+ }
+ var buffer = (function (s) { var a = []; while (s-- > 0)
+ a.push(null); return a; })(length);
+ buffer[0] = this.string.charAt(length - 1);
+ for (var i = 1; i < length; i++) {
+ {
+ buffer[i] = this.string.charAt(length - 1 - i);
+ if (javaemul.internal.CharacterHelper.isSurrogatePair(buffer[i], buffer[i - 1])) {
+ AbstractStringBuilder.swap(buffer, i - 1, i);
+ }
+ }
+ ;
+ }
+ this.string = new String(buffer);
+ };
+ /*private*/ AbstractStringBuilder.swap = function (buffer, f, s) {
+ var tmp = buffer[f];
+ buffer[f] = buffer[s];
+ buffer[s] = tmp;
+ };
+ return AbstractStringBuilder;
+ }());
+ lang.AbstractStringBuilder = AbstractStringBuilder;
+ AbstractStringBuilder["__class"] = "java.lang.AbstractStringBuilder";
+ })(lang = java.lang || (java.lang = {}));
+})(java || (java = {}));
+(function (java) {
+ var lang;
+ (function (lang) {
+ /**
+ * The first-class representation of an enumeration.
+ *
+ * @param true if we are running in the design time mode.
+ */
+ Beans.isDesignTime = function () {
+ return false;
+ };
+ return Beans;
+ }());
+ beans.Beans = Beans;
+ Beans["__class"] = "java.beans.Beans";
+ })(beans = java.beans || (java.beans = {}));
+})(java || (java = {}));
+(function (java) {
+ var beans;
+ (function (beans) {
+ var PropertyDescriptor = /** @class */ (function () {
+ function PropertyDescriptor() {
+ }
+ PropertyDescriptor.prototype.getPropertyType = function () {
+ return null;
+ };
+ return PropertyDescriptor;
+ }());
+ beans.PropertyDescriptor = PropertyDescriptor;
+ PropertyDescriptor["__class"] = "java.beans.PropertyDescriptor";
+ })(beans = java.beans || (java.beans = {}));
+})(java || (java = {}));
+(function (java) {
+ var nio;
+ (function (nio) {
+ var file;
+ (function (file) {
+ var Paths = /** @class */ (function () {
+ function Paths() {
+ }
+ Paths.get = function () {
+ var paths = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ paths[_i] = arguments[_i];
+ }
+ return new java.nio.file.Path((paths).join(java.nio.file.Path.PATH_SEPARATOR_$LI$()));
+ };
+ return Paths;
+ }());
+ file.Paths = Paths;
+ Paths["__class"] = "java.nio.file.Paths";
+ })(file = nio.file || (nio.file = {}));
+ })(nio = java.nio || (java.nio = {}));
+})(java || (java = {}));
+(function (java) {
+ var nio;
+ (function (nio) {
+ var ByteOrder = /** @class */ (function () {
+ function ByteOrder() {
+ }
+ ByteOrder.BIG_ENDIAN_$LI$ = function () { if (ByteOrder.BIG_ENDIAN == null) {
+ ByteOrder.BIG_ENDIAN = new ByteOrder();
+ } return ByteOrder.BIG_ENDIAN; };
+ ;
+ ByteOrder.LITTLE_ENDIAN_$LI$ = function () { if (ByteOrder.LITTLE_ENDIAN == null) {
+ ByteOrder.LITTLE_ENDIAN = new ByteOrder();
+ } return ByteOrder.LITTLE_ENDIAN; };
+ ;
+ /**
+ *
+ * @return {string}
+ */
+ ByteOrder.prototype.toString = function () {
+ return this === ByteOrder.BIG_ENDIAN_$LI$() ? "BIG_ENDIAN" : "LITTLE_ENDIAN";
+ };
+ ByteOrder.nativeOrder = function () {
+ if (ByteOrder.NativeInstanceHolder.INSTANCE == null) {
+ ByteOrder.NativeInstanceHolder.INSTANCE = ByteOrder.NativeInstanceHolder.nativeOrderTester();
+ }
+ return ByteOrder.NativeInstanceHolder.INSTANCE;
+ };
+ return ByteOrder;
+ }());
+ nio.ByteOrder = ByteOrder;
+ ByteOrder["__class"] = "java.nio.ByteOrder";
+ (function (ByteOrder) {
+ var NativeInstanceHolder = /** @class */ (function () {
+ function NativeInstanceHolder() {
+ }
+ NativeInstanceHolder.nativeOrderTester = function () {
+ var arrayBuffer = new ArrayBuffer(2);
+ var uint8Array = new Uint8Array(arrayBuffer);
+ var uint16array = new Uint16Array(arrayBuffer);
+ uint8Array.set(Uint8Array.from([170, 187]), 0);
+ if (uint16array[0] === 48042)
+ return java.nio.ByteOrder.LITTLE_ENDIAN_$LI$();
+ if (uint16array[0] === 43707)
+ return java.nio.ByteOrder.BIG_ENDIAN_$LI$();
+ throw new Error("Something crazy just happened in native order test");
+ };
+ NativeInstanceHolder.INSTANCE = null;
+ return NativeInstanceHolder;
+ }());
+ ByteOrder.NativeInstanceHolder = NativeInstanceHolder;
+ NativeInstanceHolder["__class"] = "java.nio.ByteOrder.NativeInstanceHolder";
+ })(ByteOrder = nio.ByteOrder || (nio.ByteOrder = {}));
+ })(nio = java.nio || (java.nio = {}));
+})(java || (java = {}));
+(function (java) {
+ var nio;
+ (function (nio) {
+ var Buffer = /** @class */ (function () {
+ function Buffer(capacity, readOnly) {
+ if (this._capacity === undefined) {
+ this._capacity = 0;
+ }
+ if (this.readOnly === undefined) {
+ this.readOnly = false;
+ }
+ if (this._position === undefined) {
+ this._position = 0;
+ }
+ if (this._limit === undefined) {
+ this._limit = 0;
+ }
+ if (this._mark === undefined) {
+ this._mark = 0;
+ }
+ this._capacity = capacity;
+ this.readOnly = readOnly;
+ this._position = 0;
+ this._limit = capacity;
+ this._mark = -1;
+ }
+ Buffer.prototype.arrayOffset = function () {
+ return 0;
+ };
+ Buffer.prototype.capacity = function () {
+ return this._capacity;
+ };
+ Buffer.prototype.clear = function () {
+ this._limit = this._capacity;
+ this._position = 0;
+ this._mark = -1;
+ return this;
+ };
+ Buffer.prototype.flip = function () {
+ this._limit = this._position;
+ this._position = 0;
+ this._mark = -1;
+ return this;
+ };
+ Buffer.prototype.hasArray = function () {
+ return this.array() != null;
+ };
+ Buffer.prototype.hasRemaining = function () {
+ return this._position < this._limit;
+ };
+ Buffer.prototype.isDirect = function () {
+ return false;
+ };
+ Buffer.prototype.isReadOnly = function () {
+ return this.readOnly;
+ };
+ Buffer.prototype.limit$ = function () {
+ return this._limit;
+ };
+ Buffer.prototype.limit$int = function (newLimit) {
+ if (newLimit > this._capacity)
+ throw new java.lang.IllegalArgumentException("limit is bigger than capacity");
+ this._limit = newLimit;
+ this._position = Math.min(this._position, this._limit);
+ if (this._mark > this._limit)
+ this._mark = -1;
+ return this;
+ };
+ Buffer.prototype.limit = function (newLimit) {
+ if (((typeof newLimit === 'number') || newLimit === null)) {
+ return this.limit$int(newLimit);
+ }
+ else if (newLimit === undefined) {
+ return this.limit$();
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ Buffer.prototype.mark = function () {
+ this._mark = this._position;
+ return this;
+ };
+ Buffer.prototype.position$ = function () {
+ return this._position;
+ };
+ Buffer.prototype.position$int = function (newPosition) {
+ if (newPosition > this._limit)
+ throw new java.lang.IllegalArgumentException("position is bigger than limit");
+ this._position = newPosition;
+ if (this._mark > this._position)
+ this._mark = -1;
+ return this;
+ };
+ Buffer.prototype.position = function (newPosition) {
+ if (((typeof newPosition === 'number') || newPosition === null)) {
+ return this.position$int(newPosition);
+ }
+ else if (newPosition === undefined) {
+ return this.position$();
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ Buffer.prototype.remaining = function () {
+ return this._limit - this._position;
+ };
+ Buffer.prototype.reset = function () {
+ if (this._mark === -1)
+ throw new java.nio.InvalidMarkException();
+ this._position = this._mark;
+ return this;
+ };
+ Buffer.prototype.rewind = function () {
+ this._position = 0;
+ this._mark = -1;
+ return this;
+ };
+ return Buffer;
+ }());
+ nio.Buffer = Buffer;
+ Buffer["__class"] = "java.nio.Buffer";
+ })(nio = java.nio || (java.nio = {}));
+})(java || (java = {}));
+(function (java) {
+ var nio;
+ (function (nio) {
+ var charset;
+ (function (charset) {
+ /**
+ * A minimal emulation of {@link Charset}.
+ * @class
+ */
+ var Charset = /** @class */ (function () {
+ function Charset(name, aliasesIgnored) {
+ if (this.__name === undefined) {
+ this.__name = null;
+ }
+ this.__name = name;
+ }
+ Charset.availableCharsets = function () {
+ if (Charset.AvailableCharsets.CHARSETS == null) {
+ var map = (new java.util.TreeMap());
+ map.put(javaemul.internal.EmulatedCharset.ISO_8859_1_$LI$().name(), javaemul.internal.EmulatedCharset.ISO_8859_1_$LI$());
+ map.put(javaemul.internal.EmulatedCharset.ISO_LATIN_1_$LI$().name(), javaemul.internal.EmulatedCharset.ISO_LATIN_1_$LI$());
+ map.put(javaemul.internal.EmulatedCharset.UTF_8_$LI$().name(), javaemul.internal.EmulatedCharset.UTF_8_$LI$());
+ Charset.AvailableCharsets.CHARSETS = java.util.Collections.unmodifiableSortedMap(map);
+ }
+ return Charset.AvailableCharsets.CHARSETS;
+ };
+ Charset.forName = function (charsetName) {
+ javaemul.internal.InternalPreconditions.checkArgument(charsetName != null, "Null charset name");
+ charsetName = charsetName.toUpperCase();
+ if (javaemul.internal.EmulatedCharset.ISO_8859_1_$LI$().name() === charsetName) {
+ return javaemul.internal.EmulatedCharset.ISO_8859_1_$LI$();
+ }
+ else if (javaemul.internal.EmulatedCharset.ISO_LATIN_1_$LI$().name() === charsetName) {
+ return javaemul.internal.EmulatedCharset.ISO_LATIN_1_$LI$();
+ }
+ else if (javaemul.internal.EmulatedCharset.UTF_8_$LI$().name() === charsetName) {
+ return javaemul.internal.EmulatedCharset.UTF_8_$LI$();
+ }
+ if (!Charset.createLegalCharsetNameRegex().test(charsetName)) {
+ throw new java.nio.charset.IllegalCharsetNameException(charsetName);
+ }
+ else {
+ throw new java.nio.charset.UnsupportedCharsetException(charsetName);
+ }
+ };
+ Charset.createLegalCharsetNameRegex = function () {
+ return new RegExp("^[A-Za-z0-9][\\w-:\\.\\+]*$");
+ };
+ Charset.prototype.name = function () {
+ return this.__name;
+ };
+ Charset.prototype.compareTo$java_nio_charset_Charset = function (that) {
+ return /* compareToIgnoreCase */ this.__name.toUpperCase().localeCompare(that.__name.toUpperCase());
+ };
+ /**
+ *
+ * @param {java.nio.charset.Charset} that
+ * @return {number}
+ */
+ Charset.prototype.compareTo = function (that) {
+ if (((that != null && that instanceof java.nio.charset.Charset) || that === null)) {
+ return this.compareTo$java_nio_charset_Charset(that);
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ /**
+ *
+ * @return {number}
+ */
+ Charset.prototype.hashCode = function () {
+ return /* hashCode */ (function (o) { if (o.hashCode) {
+ return o.hashCode();
+ }
+ else {
+ return o.toString().split('').reduce(function (prevHash, currVal) { return (((prevHash << 5) - prevHash) + currVal.charCodeAt(0)) | 0; }, 0);
+ } })(this.__name);
+ };
+ /**
+ *
+ * @param {*} o
+ * @return {boolean}
+ */
+ Charset.prototype.equals = function (o) {
+ if (o === this) {
+ return true;
+ }
+ if (!(o != null && o instanceof java.nio.charset.Charset)) {
+ return false;
+ }
+ var that = o;
+ return this.__name === that.__name;
+ };
+ /**
+ *
+ * @return {string}
+ */
+ Charset.prototype.toString = function () {
+ return this.__name;
+ };
+ return Charset;
+ }());
+ charset.Charset = Charset;
+ Charset["__class"] = "java.nio.charset.Charset";
+ Charset["__interfaces"] = ["java.lang.Comparable"];
+ (function (Charset) {
+ var AvailableCharsets = /** @class */ (function () {
+ function AvailableCharsets() {
+ }
+ AvailableCharsets.CHARSETS = null;
+ return AvailableCharsets;
+ }());
+ Charset.AvailableCharsets = AvailableCharsets;
+ AvailableCharsets["__class"] = "java.nio.charset.Charset.AvailableCharsets";
+ })(Charset = charset.Charset || (charset.Charset = {}));
+ })(charset = nio.charset || (nio.charset = {}));
+ })(nio = java.nio || (java.nio = {}));
+})(java || (java = {}));
+(function (java) {
+ var text;
+ (function (text) {
+ /**
+ * A basic implementation for Java collators.
+ *
+ * @author Renaud Pawlak
+ * @class
+ */
+ var Collator = /** @class */ (function () {
+ function Collator() {
+ }
+ Collator.getInstance = function () {
+ if (Collator.collator == null) {
+ Collator.collator = new Collator();
+ }
+ return Collator.collator;
+ };
+ /**
+ *
+ * @param {*} a
+ * @param {*} b
+ * @return {number}
+ */
+ Collator.prototype.compare = function (a, b) {
+ return a.localeCompare(b);
+ };
+ Collator.collator = null;
+ return Collator;
+ }());
+ text.Collator = Collator;
+ Collator["__class"] = "java.text.Collator";
+ Collator["__interfaces"] = ["java.util.Comparator"];
+ })(text = java.text || (java.text = {}));
+})(java || (java = {}));
+(function (java) {
+ var text;
+ (function (text) {
+ var Normalizer = /** @class */ (function () {
+ function Normalizer() {
+ }
+ Normalizer.normalize = function (src, form) {
+ return (src.toString()).normalize(/* Enum.name */ java.text.Normalizer.Form[form]).toString();
+ };
+ return Normalizer;
+ }());
+ text.Normalizer = Normalizer;
+ Normalizer["__class"] = "java.text.Normalizer";
+ (function (Normalizer) {
+ var Form;
+ (function (Form) {
+ /**
+ * Canonical decomposition.
+ */
+ Form[Form["NFD"] = 0] = "NFD";
+ /**
+ * Canonical decomposition, followed by canonical composition.
+ */
+ Form[Form["NFC"] = 1] = "NFC";
+ /**
+ * Compatibility decomposition.
+ */
+ Form[Form["NFKD"] = 2] = "NFKD";
+ /**
+ * Compatibility decomposition, followed by canonical composition.
+ */
+ Form[Form["NFKC"] = 3] = "NFKC";
+ })(Form = Normalizer.Form || (Normalizer.Form = {}));
+ })(Normalizer = text.Normalizer || (text.Normalizer = {}));
+ })(text = java.text || (java.text = {}));
+})(java || (java = {}));
+(function (java) {
+ var text;
+ (function (text) {
+ /**
+ * Create a new ParsePosition with the given initial index.
+ *
+ * @param {number} index initial index
+ * @class
+ * @author Mark Davis
+ */
+ var ParsePosition = /** @class */ (function () {
+ function ParsePosition(index) {
+ this.index = 0;
+ this.errorIndex = -1;
+ this.index = index;
+ }
+ /**
+ * Retrieve the current parse position. On input to a parse method, this
+ * is the index of the character at which parsing will begin; on output, it
+ * is the index of the character following the last character parsed.
+ *
+ * @return {number} the current parse position
+ */
+ ParsePosition.prototype.getIndex = function () {
+ return this.index;
+ };
+ /**
+ * Set the current parse position.
+ *
+ * @param {number} index the current parse position
+ */
+ ParsePosition.prototype.setIndex = function (index) {
+ this.index = index;
+ };
+ /**
+ * Set the index at which a parse error occurred. Formatters
+ * should set this before returning an error code from their
+ * parseObject method. The default value is -1 if this is not set.
+ *
+ * @param {number} ei the index at which an error occurred
+ * @since 1.2
+ */
+ ParsePosition.prototype.setErrorIndex = function (ei) {
+ this.errorIndex = ei;
+ };
+ /**
+ * Retrieve the index at which an error occurred, or -1 if the
+ * error index has not been set.
+ *
+ * @return {number} the index at which an error occurred
+ * @since 1.2
+ */
+ ParsePosition.prototype.getErrorIndex = function () {
+ return this.errorIndex;
+ };
+ /**
+ * Overrides equals
+ * @param {*} obj
+ * @return {boolean}
+ */
+ ParsePosition.prototype.equals = function (obj) {
+ if (obj == null)
+ return false;
+ if (!(obj != null && obj instanceof java.text.ParsePosition))
+ return false;
+ var other = obj;
+ return (this.index === other.index && this.errorIndex === other.errorIndex);
+ };
+ /**
+ * Returns a hash code for this ParsePosition.
+ * @return {number} a hash code value for this object
+ */
+ ParsePosition.prototype.hashCode = function () {
+ return (this.errorIndex << 16) | this.index;
+ };
+ /**
+ * Return a string representation of this ParsePosition.
+ * @return {string} a string representation of this object
+ */
+ ParsePosition.prototype.toString = function () {
+ return /* getName */ (function (c) { return c["__class"] ? c["__class"] : c["name"]; })(this.constructor) + "[index=" + this.index + ",errorIndex=" + this.errorIndex + ']';
+ };
+ return ParsePosition;
+ }());
+ text.ParsePosition = ParsePosition;
+ ParsePosition["__class"] = "java.text.ParsePosition";
+ })(text = java.text || (java.text = {}));
+})(java || (java = {}));
+(function (javaemul) {
+ var internal;
+ (function (internal) {
+ var stream;
+ (function (stream) {
+ /**
+ * @author Władysław Kargul
+ * @param {*} previous
+ * @class
+ * @extends javaemul.internal.stream.TerminalStreamRow
+ */
+ var StreamRowEnd = /** @class */ (function (_super) {
+ __extends(StreamRowEnd, _super);
+ function StreamRowEnd(previous) {
+ var _this = _super.call(this) || this;
+ if (_this.previous === undefined) {
+ _this.previous = null;
+ }
+ _this.previous = previous;
+ return _this;
+ }
+ StreamRowEnd.prototype.chain = function (next) {
+ if (this.previous != null) {
+ this.previous.chain(next);
+ }
+ this.previous = next;
+ next.chain(this);
+ };
+ StreamRowEnd.prototype.item = function (a) {
+ return true;
+ };
+ return StreamRowEnd;
+ }(javaemul.internal.stream.TerminalStreamRow));
+ stream.StreamRowEnd = StreamRowEnd;
+ StreamRowEnd["__class"] = "javaemul.internal.stream.StreamRowEnd";
+ StreamRowEnd["__interfaces"] = ["javaemul.internal.stream.StreamRow"];
+ })(stream = internal.stream || (internal.stream = {}));
+ })(internal = javaemul.internal || (javaemul.internal = {}));
+})(javaemul || (javaemul = {}));
+(function (javaemul) {
+ var internal;
+ (function (internal) {
+ var stream;
+ (function (stream) {
+ var StreamRowAllFilter = /** @class */ (function (_super) {
+ __extends(StreamRowAllFilter, _super);
+ function StreamRowAllFilter(predicate) {
+ var _this = _super.call(this) || this;
+ if (_this.predicate === undefined) {
+ _this.predicate = null;
+ }
+ if (_this.predicateValue === undefined) {
+ _this.predicateValue = false;
+ }
+ if (_this.attempts === undefined) {
+ _this.attempts = 0;
+ }
+ _this.predicate = (predicate);
+ return _this;
+ }
+ StreamRowAllFilter.prototype.getPredicateValue = function () {
+ return this.attempts === 0 || this.predicateValue;
+ };
+ StreamRowAllFilter.prototype.item = function (a) {
+ ++this.attempts;
+ this.predicateValue = (function (target) { return (typeof target === 'function') ? target(a) : target.test(a); })(this.predicate) && this.predicateValue;
+ return this.predicateValue;
+ };
+ return StreamRowAllFilter;
+ }(javaemul.internal.stream.TerminalStreamRow));
+ stream.StreamRowAllFilter = StreamRowAllFilter;
+ StreamRowAllFilter["__class"] = "javaemul.internal.stream.StreamRowAllFilter";
+ StreamRowAllFilter["__interfaces"] = ["javaemul.internal.stream.StreamRow"];
+ })(stream = internal.stream || (internal.stream = {}));
+ })(internal = javaemul.internal || (javaemul.internal = {}));
+})(javaemul || (javaemul = {}));
+(function (javaemul) {
+ var internal;
+ (function (internal) {
+ var stream;
+ (function (stream) {
+ var StreamRowOnceFilter = /** @class */ (function (_super) {
+ __extends(StreamRowOnceFilter, _super);
+ function StreamRowOnceFilter(predicate) {
+ var _this = _super.call(this) || this;
+ if (_this.predicate === undefined) {
+ _this.predicate = null;
+ }
+ if (_this.predicateValue === undefined) {
+ _this.predicateValue = false;
+ }
+ _this.firstMatch = java.util.Optional.empty();
+ _this.predicate = (predicate);
+ return _this;
+ }
+ StreamRowOnceFilter.prototype.getFirstMatch = function () {
+ return this.firstMatch;
+ };
+ StreamRowOnceFilter.prototype.getPredicateValue = function () {
+ return this.predicateValue;
+ };
+ StreamRowOnceFilter.prototype.item = function (a) {
+ this.predicateValue = (function (target) { return (typeof target === 'function') ? target(a) : target.test(a); })(this.predicate);
+ if (this.predicateValue) {
+ this.firstMatch = java.util.Optional.of(a);
+ }
+ return !this.predicateValue;
+ };
+ return StreamRowOnceFilter;
+ }(javaemul.internal.stream.TerminalStreamRow));
+ stream.StreamRowOnceFilter = StreamRowOnceFilter;
+ StreamRowOnceFilter["__class"] = "javaemul.internal.stream.StreamRowOnceFilter";
+ StreamRowOnceFilter["__interfaces"] = ["javaemul.internal.stream.StreamRow"];
+ })(stream = internal.stream || (internal.stream = {}));
+ })(internal = javaemul.internal || (javaemul.internal = {}));
+})(javaemul || (javaemul = {}));
+(function (javaemul) {
+ var internal;
+ (function (internal) {
+ var stream;
+ (function (stream) {
+ var StreamRowReduce = /** @class */ (function (_super) {
+ __extends(StreamRowReduce, _super);
+ function StreamRowReduce(result, operator) {
+ var _this = _super.call(this) || this;
+ if (_this.result === undefined) {
+ _this.result = null;
+ }
+ if (_this.operator === undefined) {
+ _this.operator = null;
+ }
+ _this.result = result;
+ _this.operator = (operator);
+ return _this;
+ }
+ StreamRowReduce.prototype.getResult = function () {
+ return this.result;
+ };
+ StreamRowReduce.prototype.item = function (a) {
+ var _this = this;
+ this.result = java.util.Optional.of(this.result.map(function (v) { return (function (target) { return (typeof target === 'function') ? target(v, a) : target.apply(v, a); })(_this.operator); }).orElse(a));
+ return true;
+ };
+ return StreamRowReduce;
+ }(javaemul.internal.stream.TerminalStreamRow));
+ stream.StreamRowReduce = StreamRowReduce;
+ StreamRowReduce["__class"] = "javaemul.internal.stream.StreamRowReduce";
+ StreamRowReduce["__interfaces"] = ["javaemul.internal.stream.StreamRow"];
+ })(stream = internal.stream || (internal.stream = {}));
+ })(internal = javaemul.internal || (javaemul.internal = {}));
+})(javaemul || (javaemul = {}));
+(function (javaemul) {
+ var internal;
+ (function (internal) {
+ var stream;
+ (function (stream) {
+ var StreamRowCount = /** @class */ (function (_super) {
+ __extends(StreamRowCount, _super);
+ function StreamRowCount() {
+ var _this = _super.call(this) || this;
+ if (_this.count === undefined) {
+ _this.count = 0;
+ }
+ return _this;
+ }
+ StreamRowCount.prototype.getCount = function () {
+ return this.count;
+ };
+ StreamRowCount.prototype.item = function (a) {
+ ++this.count;
+ return true;
+ };
+ return StreamRowCount;
+ }(javaemul.internal.stream.TerminalStreamRow));
+ stream.StreamRowCount = StreamRowCount;
+ StreamRowCount["__class"] = "javaemul.internal.stream.StreamRowCount";
+ StreamRowCount["__interfaces"] = ["javaemul.internal.stream.StreamRow"];
+ })(stream = internal.stream || (internal.stream = {}));
+ })(internal = javaemul.internal || (javaemul.internal = {}));
+})(javaemul || (javaemul = {}));
+(function (javaemul) {
+ var internal;
+ (function (internal) {
+ var stream;
+ (function (stream) {
+ var StreamRowCollector = /** @class */ (function (_super) {
+ __extends(StreamRowCollector, _super);
+ function StreamRowCollector(collection) {
+ var _this = _super.call(this) || this;
+ if (_this.collection === undefined) {
+ _this.collection = null;
+ }
+ _this.collection = collection;
+ return _this;
+ }
+ StreamRowCollector.prototype.item = function (a) {
+ this.collection.add(a);
+ return true;
+ };
+ StreamRowCollector.prototype.end = function () {
+ for (var index130 = this.collection.iterator(); index130.hasNext();) {
+ var item = index130.next();
+ {
+ if (!this.next.item(item)) {
+ break;
+ }
+ }
+ }
+ this.next.end();
+ };
+ return StreamRowCollector;
+ }(javaemul.internal.stream.TransientStreamRow));
+ stream.StreamRowCollector = StreamRowCollector;
+ StreamRowCollector["__class"] = "javaemul.internal.stream.StreamRowCollector";
+ StreamRowCollector["__interfaces"] = ["javaemul.internal.stream.StreamRow"];
+ })(stream = internal.stream || (internal.stream = {}));
+ })(internal = javaemul.internal || (javaemul.internal = {}));
+})(javaemul || (javaemul = {}));
+(function (javaemul) {
+ var internal;
+ (function (internal) {
+ var stream;
+ (function (stream) {
+ var StreamRowMap = /** @class */ (function (_super) {
+ __extends(StreamRowMap, _super);
+ function StreamRowMap(map) {
+ var _this = _super.call(this) || this;
+ if (_this.map === undefined) {
+ _this.map = null;
+ }
+ _this.map = (map);
+ return _this;
+ }
+ StreamRowMap.prototype.item = function (a) {
+ return this.next.item((function (target) { return (typeof target === 'function') ? target(a) : target.apply(a); })(this.map));
+ };
+ StreamRowMap.prototype.end = function () {
+ this.next.end();
+ };
+ return StreamRowMap;
+ }(javaemul.internal.stream.TransientStreamRow));
+ stream.StreamRowMap = StreamRowMap;
+ StreamRowMap["__class"] = "javaemul.internal.stream.StreamRowMap";
+ StreamRowMap["__interfaces"] = ["javaemul.internal.stream.StreamRow"];
+ })(stream = internal.stream || (internal.stream = {}));
+ })(internal = javaemul.internal || (javaemul.internal = {}));
+})(javaemul || (javaemul = {}));
+(function (javaemul) {
+ var internal;
+ (function (internal) {
+ var stream;
+ (function (stream) {
+ var StreamRowFilter = /** @class */ (function (_super) {
+ __extends(StreamRowFilter, _super);
+ function StreamRowFilter(predicate) {
+ var _this = _super.call(this) || this;
+ if (_this.predicate === undefined) {
+ _this.predicate = null;
+ }
+ _this.predicate = (predicate);
+ return _this;
+ }
+ StreamRowFilter.prototype.item = function (a) {
+ if ((function (target) { return (typeof target === 'function') ? target(a) : target.test(a); })(this.predicate)) {
+ return this.next.item(a);
+ }
+ return true;
+ };
+ StreamRowFilter.prototype.end = function () {
+ this.next.end();
+ };
+ return StreamRowFilter;
+ }(javaemul.internal.stream.TransientStreamRow));
+ stream.StreamRowFilter = StreamRowFilter;
+ StreamRowFilter["__class"] = "javaemul.internal.stream.StreamRowFilter";
+ StreamRowFilter["__interfaces"] = ["javaemul.internal.stream.StreamRow"];
+ })(stream = internal.stream || (internal.stream = {}));
+ })(internal = javaemul.internal || (javaemul.internal = {}));
+})(javaemul || (javaemul = {}));
+(function (javaemul) {
+ var internal;
+ (function (internal) {
+ var stream;
+ (function (stream) {
+ var StreamRowFilterFlop = /** @class */ (function (_super) {
+ __extends(StreamRowFilterFlop, _super);
+ function StreamRowFilterFlop(predicate) {
+ var _this = _super.call(this) || this;
+ if (_this.predicate === undefined) {
+ _this.predicate = null;
+ }
+ _this.predicate = (predicate);
+ return _this;
+ }
+ StreamRowFilterFlop.prototype.item = function (a) {
+ var test = (function (target) { return (typeof target === 'function') ? target(a) : target.test(a); })(this.predicate);
+ if (test) {
+ return this.next.item(a);
+ }
+ return false;
+ };
+ StreamRowFilterFlop.prototype.end = function () {
+ this.next.end();
+ };
+ return StreamRowFilterFlop;
+ }(javaemul.internal.stream.TransientStreamRow));
+ stream.StreamRowFilterFlop = StreamRowFilterFlop;
+ StreamRowFilterFlop["__class"] = "javaemul.internal.stream.StreamRowFilterFlop";
+ StreamRowFilterFlop["__interfaces"] = ["javaemul.internal.stream.StreamRow"];
+ })(stream = internal.stream || (internal.stream = {}));
+ })(internal = javaemul.internal || (javaemul.internal = {}));
+})(javaemul || (javaemul = {}));
+(function (javaemul) {
+ var internal;
+ (function (internal) {
+ var stream;
+ (function (stream) {
+ var StreamRowFlatMap = /** @class */ (function (_super) {
+ __extends(StreamRowFlatMap, _super);
+ function StreamRowFlatMap(flatMap) {
+ var _this = _super.call(this) || this;
+ if (_this.flatMap === undefined) {
+ _this.flatMap = null;
+ }
+ _this.flatMap = (flatMap);
+ return _this;
+ }
+ StreamRowFlatMap.prototype.item = function (a) {
+ var _this = this;
+ var subStream = (function (target) { return (typeof target === 'function') ? target(a) : target.apply(a); })(this.flatMap);
+ try {
+ try {
+ subStream.forEach(function (o) {
+ if (!_this.next.item(o)) {
+ throw new javaemul.internal.stream.StopException();
+ }
+ });
+ }
+ catch (e) {
+ return false;
+ }
+ ;
+ }
+ finally {
+ subStream.close();
+ }
+ ;
+ return true;
+ };
+ StreamRowFlatMap.prototype.end = function () {
+ this.next.end();
+ };
+ return StreamRowFlatMap;
+ }(javaemul.internal.stream.TransientStreamRow));
+ stream.StreamRowFlatMap = StreamRowFlatMap;
+ StreamRowFlatMap["__class"] = "javaemul.internal.stream.StreamRowFlatMap";
+ StreamRowFlatMap["__interfaces"] = ["javaemul.internal.stream.StreamRow"];
+ })(stream = internal.stream || (internal.stream = {}));
+ })(internal = javaemul.internal || (javaemul.internal = {}));
+})(javaemul || (javaemul = {}));
+(function (javaemul) {
+ var internal;
+ (function (internal) {
+ /**
+ * Wraps a primitive double as an object.
+ * @param {number} value
+ * @class
+ * @extends javaemul.internal.NumberHelper
+ */
+ var DoubleHelper = /** @class */ (function (_super) {
+ __extends(DoubleHelper, _super);
+ function DoubleHelper(s) {
+ var _this = this;
+ if (((typeof s === 'string') || s === null)) {
+ var __args = arguments;
+ _this = _super.call(this) || this;
+ }
+ else if (((typeof s === 'number') || s === null)) {
+ var __args = arguments;
+ var value = __args[0];
+ _this = _super.call(this) || this;
+ }
+ else
+ throw new Error('invalid overload');
+ return _this;
+ }
+ DoubleHelper.compare = function (x, y) {
+ if (x < y) {
+ return -1;
+ }
+ if (x > y) {
+ return 1;
+ }
+ if (x === y) {
+ return 0;
+ }
+ if (DoubleHelper.isNaN(x)) {
+ if (DoubleHelper.isNaN(y)) {
+ return 0;
+ }
+ else {
+ return 1;
+ }
+ }
+ else {
+ return -1;
+ }
+ };
+ DoubleHelper.doubleToLongBits = function (value) {
+ if (DoubleHelper.isNaN(value)) {
+ return 9221120237041090560;
+ }
+ var negative = false;
+ if (value === 0.0) {
+ if (1.0 / value === DoubleHelper.NEGATIVE_INFINITY) {
+ return -9223372036854775808;
+ }
+ else {
+ return 0;
+ }
+ }
+ if (value < 0.0) {
+ negative = true;
+ value = -value;
+ }
+ if (DoubleHelper.isInfinite(value)) {
+ if (negative) {
+ return -4503599627370496;
+ }
+ else {
+ return 9218868437227405312;
+ }
+ }
+ var exp = 0;
+ if (value < 1.0) {
+ var bit = 512;
+ for (var i = 0; i < 10; i++, bit >>= 1) {
+ {
+ if (value < DoubleHelper.PowersTable.invPowers_$LI$()[i] && exp - bit >= -1023) {
+ value *= DoubleHelper.PowersTable.powers_$LI$()[i];
+ exp -= bit;
+ }
+ }
+ ;
+ }
+ if (value < 1.0 && exp - 1 >= -1023) {
+ value *= 2.0;
+ exp--;
+ }
+ }
+ else if (value >= 2.0) {
+ var bit = 512;
+ for (var i = 0; i < 10; i++, bit >>= 1) {
+ {
+ if (value >= DoubleHelper.PowersTable.powers_$LI$()[i]) {
+ value *= DoubleHelper.PowersTable.invPowers_$LI$()[i];
+ exp += bit;
+ }
+ }
+ ;
+ }
+ }
+ if (exp > -1023) {
+ value -= 1.0;
+ }
+ else {
+ value *= 0.5;
+ }
+ var ihi = (function (n) { return n < 0 ? Math.ceil(n) : Math.floor(n); })((value * DoubleHelper.POWER_20));
+ value -= ihi * DoubleHelper.POWER_MINUS_20;
+ var ilo = (function (n) { return n < 0 ? Math.ceil(n) : Math.floor(n); })((value * DoubleHelper.POWER_52));
+ ihi |= (exp + 1023) << 20;
+ if (negative) {
+ ihi |= 2147483648;
+ }
+ return (ihi << 32) | ilo;
+ };
+ /**
+ * @skip Here for shared implementation with Arrays.hashCode
+ * @param {number} d
+ * @return {number}
+ */
+ DoubleHelper.hashCode = function (d) {
+ return (d | 0);
+ };
+ DoubleHelper.isInfinite = function (x) {
+ return x === javaemul.internal.JsUtils.getInfinity() || x === -javaemul.internal.JsUtils.getInfinity();
+ };
+ DoubleHelper.isNaN = function (x) {
+ return (isNaN(x));
+ };
+ DoubleHelper.longBitsToDouble = function (bits) {
+ var ihi = (function (n) { return n < 0 ? Math.ceil(n) : Math.floor(n); })((bits >> 32));
+ var ilo = (function (n) { return n < 0 ? Math.ceil(n) : Math.floor(n); })((bits & 4294967295));
+ if (ihi < 0) {
+ ihi += 4294967296;
+ }
+ if (ilo < 0) {
+ ilo += 4294967296;
+ }
+ var negative = (ihi & -2147483648) !== 0;
+ var exp = (((ihi >> 20) & 2047) | 0);
+ ihi &= 1048575;
+ if (exp === 0) {
+ var d_1 = (ihi * DoubleHelper.POWER_MINUS_20) + (ilo * DoubleHelper.POWER_MINUS_52);
+ d_1 *= DoubleHelper.POWER_MINUS_1022;
+ return negative ? (d_1 === 0.0 ? -0.0 : -d_1) : d_1;
+ }
+ else if (exp === 2047) {
+ if (ihi === 0 && ilo === 0) {
+ return negative ? DoubleHelper.NEGATIVE_INFINITY : DoubleHelper.POSITIVE_INFINITY;
+ }
+ else {
+ return DoubleHelper.NaN;
+ }
+ }
+ exp -= 1023;
+ var d = 1.0 + (ihi * DoubleHelper.POWER_MINUS_20) + (ilo * DoubleHelper.POWER_MINUS_52);
+ if (exp > 0) {
+ var bit = 512;
+ for (var i = 0; i < 10; i++, bit >>= 1) {
+ {
+ if (exp >= bit) {
+ d *= DoubleHelper.PowersTable.powers_$LI$()[i];
+ exp -= bit;
+ }
+ }
+ ;
+ }
+ }
+ else if (exp < 0) {
+ while ((exp < 0)) {
+ {
+ var bit = 512;
+ for (var i = 0; i < 10; i++, bit >>= 1) {
+ {
+ if (exp <= -bit) {
+ d *= DoubleHelper.PowersTable.invPowers_$LI$()[i];
+ exp += bit;
+ }
+ }
+ ;
+ }
+ }
+ }
+ ;
+ }
+ return negative ? -d : d;
+ };
+ DoubleHelper.parseDouble = function (s) {
+ return internal.NumberHelper.__parseAndValidateDouble(s);
+ };
+ DoubleHelper.toString = function (b) {
+ return /* valueOf */ new String(b).toString();
+ };
+ DoubleHelper.valueOf$double = function (d) {
+ return new Number(d);
+ };
+ DoubleHelper.valueOf$java_lang_String = function (s) {
+ return new Number(s);
+ };
+ DoubleHelper.valueOf = function (s) {
+ if (((typeof s === 'string') || s === null)) {
+ return javaemul.internal.DoubleHelper.valueOf$java_lang_String(s);
+ }
+ else if (((typeof s === 'number') || s === null)) {
+ return javaemul.internal.DoubleHelper.valueOf$double(s);
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ /**
+ *
+ * @return {number}
+ */
+ DoubleHelper.prototype.byteValue = function () {
+ return (this.doubleValue() | 0);
+ };
+ DoubleHelper.prototype.compareTo$javaemul_internal_DoubleHelper = function (b) {
+ return DoubleHelper.compare(this.doubleValue(), b.doubleValue());
+ };
+ /**
+ *
+ * @param {javaemul.internal.DoubleHelper} b
+ * @return {number}
+ */
+ DoubleHelper.prototype.compareTo = function (b) {
+ if (((b != null && b instanceof javaemul.internal.DoubleHelper) || b === null)) {
+ return this.compareTo$javaemul_internal_DoubleHelper(b);
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ /**
+ *
+ * @return {number}
+ */
+ DoubleHelper.prototype.doubleValue = function () {
+ return DoubleHelper.unsafeCast((javaemul.internal.InternalPreconditions.checkNotNull(this)));
+ };
+ DoubleHelper.unsafeCast = function (instance) {
+ return (instance);
+ };
+ /**
+ *
+ * @param {*} o
+ * @return {boolean}
+ */
+ DoubleHelper.prototype.equals = function (o) {
+ return javaemul.internal.InternalPreconditions.checkNotNull(this) === o;
+ };
+ /**
+ *
+ * @return {number}
+ */
+ DoubleHelper.prototype.floatValue = function () {
+ return this.doubleValue();
+ };
+ /**
+ * Performance caution: using Double objects as map keys is not recommended.
+ * Using double values as keys is generally a bad idea due to difficulty
+ * determining exact equality. In addition, there is no efficient JavaScript
+ * equivalent of doubleToIntBits. As a result, this method
+ * computes a hash code by truncating the whole number portion of the
+ * double, which may lead to poor performance for certain value sets if
+ * Doubles are used as keys in a {@link java.util.HashMap}.
+ * @return {number}
+ */
+ DoubleHelper.prototype.hashCode = function () {
+ return DoubleHelper.hashCode(this.doubleValue());
+ };
+ /**
+ *
+ * @return {number}
+ */
+ DoubleHelper.prototype.intValue = function () {
+ return (this.doubleValue() | 0);
+ };
+ DoubleHelper.prototype.isInfinite = function () {
+ return DoubleHelper.isInfinite(this.doubleValue());
+ };
+ DoubleHelper.prototype.isNaN = function () {
+ return DoubleHelper.isNaN(this.doubleValue());
+ };
+ /**
+ *
+ * @return {number}
+ */
+ DoubleHelper.prototype.longValue = function () {
+ return (function (n) { return n < 0 ? Math.ceil(n) : Math.floor(n); })(this.doubleValue());
+ };
+ /**
+ *
+ * @return {number}
+ */
+ DoubleHelper.prototype.shortValue = function () {
+ return (this.doubleValue() | 0);
+ };
+ /**
+ *
+ * @return {string}
+ */
+ DoubleHelper.prototype.toString = function () {
+ return DoubleHelper.toString(this.doubleValue());
+ };
+ DoubleHelper.MAX_VALUE = 1.7976931348623157E308;
+ DoubleHelper.MIN_VALUE = 4.9E-324;
+ DoubleHelper.MIN_NORMAL = 2.2250738585072014E-308;
+ DoubleHelper.MAX_EXPONENT = 1023;
+ DoubleHelper.MIN_EXPONENT = -1022;
+ DoubleHelper.NaN = 0.0 / 0.0;
+ DoubleHelper.NEGATIVE_INFINITY = -1.0 / 0.0;
+ DoubleHelper.POSITIVE_INFINITY = 1.0 / 0.0;
+ DoubleHelper.SIZE = 64;
+ DoubleHelper.POWER_512 = 1.3407807929942597E154;
+ DoubleHelper.POWER_MINUS_512 = 7.458340731200207E-155;
+ DoubleHelper.POWER_256 = 1.157920892373162E77;
+ DoubleHelper.POWER_MINUS_256 = 8.636168555094445E-78;
+ DoubleHelper.POWER_128 = 3.4028236692093846E38;
+ DoubleHelper.POWER_MINUS_128 = 2.9387358770557188E-39;
+ DoubleHelper.POWER_64 = 1.8446744073709552E19;
+ DoubleHelper.POWER_MINUS_64 = 5.421010862427522E-20;
+ DoubleHelper.POWER_52 = 4.503599627370496E15;
+ DoubleHelper.POWER_MINUS_52 = 2.220446049250313E-16;
+ DoubleHelper.POWER_32 = 4.294967296E9;
+ DoubleHelper.POWER_MINUS_32 = 2.3283064365386963E-10;
+ DoubleHelper.POWER_31 = 2.147483648E9;
+ DoubleHelper.POWER_20 = 1048576.0;
+ DoubleHelper.POWER_MINUS_20 = 9.5367431640625E-7;
+ DoubleHelper.POWER_16 = 65536.0;
+ DoubleHelper.POWER_MINUS_16 = 1.52587890625E-5;
+ DoubleHelper.POWER_8 = 256.0;
+ DoubleHelper.POWER_MINUS_8 = 0.00390625;
+ DoubleHelper.POWER_4 = 16.0;
+ DoubleHelper.POWER_MINUS_4 = 0.0625;
+ DoubleHelper.POWER_2 = 4.0;
+ DoubleHelper.POWER_MINUS_2 = 0.25;
+ DoubleHelper.POWER_1 = 2.0;
+ DoubleHelper.POWER_MINUS_1 = 0.5;
+ DoubleHelper.POWER_MINUS_1022 = 2.2250738585072014E-308;
+ return DoubleHelper;
+ }(javaemul.internal.NumberHelper));
+ internal.DoubleHelper = DoubleHelper;
+ DoubleHelper["__class"] = "javaemul.internal.DoubleHelper";
+ DoubleHelper["__interfaces"] = ["java.lang.Comparable", "java.io.Serializable"];
+ (function (DoubleHelper) {
+ var PowersTable = /** @class */ (function () {
+ function PowersTable() {
+ }
+ PowersTable.powers_$LI$ = function () { if (PowersTable.powers == null) {
+ PowersTable.powers = [javaemul.internal.DoubleHelper.POWER_512, javaemul.internal.DoubleHelper.POWER_256, javaemul.internal.DoubleHelper.POWER_128, javaemul.internal.DoubleHelper.POWER_64, javaemul.internal.DoubleHelper.POWER_32, javaemul.internal.DoubleHelper.POWER_16, javaemul.internal.DoubleHelper.POWER_8, javaemul.internal.DoubleHelper.POWER_4, javaemul.internal.DoubleHelper.POWER_2, javaemul.internal.DoubleHelper.POWER_1];
+ } return PowersTable.powers; };
+ ;
+ PowersTable.invPowers_$LI$ = function () { if (PowersTable.invPowers == null) {
+ PowersTable.invPowers = [javaemul.internal.DoubleHelper.POWER_MINUS_512, javaemul.internal.DoubleHelper.POWER_MINUS_256, javaemul.internal.DoubleHelper.POWER_MINUS_128, javaemul.internal.DoubleHelper.POWER_MINUS_64, javaemul.internal.DoubleHelper.POWER_MINUS_32, javaemul.internal.DoubleHelper.POWER_MINUS_16, javaemul.internal.DoubleHelper.POWER_MINUS_8, javaemul.internal.DoubleHelper.POWER_MINUS_4, javaemul.internal.DoubleHelper.POWER_MINUS_2, javaemul.internal.DoubleHelper.POWER_MINUS_1];
+ } return PowersTable.invPowers; };
+ ;
+ return PowersTable;
+ }());
+ DoubleHelper.PowersTable = PowersTable;
+ PowersTable["__class"] = "javaemul.internal.DoubleHelper.PowersTable";
+ })(DoubleHelper = internal.DoubleHelper || (internal.DoubleHelper = {}));
+ })(internal = javaemul.internal || (javaemul.internal = {}));
+})(javaemul || (javaemul = {}));
+(function (javaemul) {
+ var internal;
+ (function (internal) {
+ /**
+ * Wraps a primitive short as an object.
+ * @param {number} value
+ * @class
+ * @extends javaemul.internal.NumberHelper
+ */
+ var ShortHelper = /** @class */ (function (_super) {
+ __extends(ShortHelper, _super);
+ function ShortHelper(s) {
+ var _this = this;
+ if (((typeof s === 'string') || s === null)) {
+ var __args = arguments;
+ _this = _super.call(this) || this;
+ if (_this.value === undefined) {
+ _this.value = 0;
+ }
+ _this.value = ShortHelper.parseShort(s);
+ }
+ else if (((typeof s === 'number') || s === null)) {
+ var __args = arguments;
+ var value = __args[0];
+ _this = _super.call(this) || this;
+ if (_this.value === undefined) {
+ _this.value = 0;
+ }
+ _this.value = value;
+ }
+ else
+ throw new Error('invalid overload');
+ return _this;
+ }
+ ShortHelper.MIN_VALUE_$LI$ = function () { if (ShortHelper.MIN_VALUE == null) {
+ ShortHelper.MIN_VALUE = (32768 | 0);
+ } return ShortHelper.MIN_VALUE; };
+ ;
+ ShortHelper.MAX_VALUE_$LI$ = function () { if (ShortHelper.MAX_VALUE == null) {
+ ShortHelper.MAX_VALUE = (32767 | 0);
+ } return ShortHelper.MAX_VALUE; };
+ ;
+ ShortHelper.TYPE_$LI$ = function () { if (ShortHelper.TYPE == null) {
+ ShortHelper.TYPE = Number;
+ } return ShortHelper.TYPE; };
+ ;
+ ShortHelper.compare = function (x, y) {
+ return x - y;
+ };
+ ShortHelper.decode = function (s) {
+ return ShortHelper.valueOf$short((internal.NumberHelper.__decodeAndValidateInt(s, ShortHelper.MIN_VALUE_$LI$(), ShortHelper.MAX_VALUE_$LI$()) | 0));
+ };
+ /**
+ * @skip Here for shared implementation with Arrays.hashCode
+ * @param {number} s
+ * @return {number}
+ */
+ ShortHelper.hashCode = function (s) {
+ return s;
+ };
+ ShortHelper.parseShort = function (s, radix) {
+ if (radix === void 0) { radix = 10; }
+ return (internal.NumberHelper.__parseAndValidateInt(s, radix, ShortHelper.MIN_VALUE_$LI$(), ShortHelper.MAX_VALUE_$LI$()) | 0);
+ };
+ ShortHelper.reverseBytes = function (s) {
+ return ((((s & 255) << 8) | ((s & 65280) >> 8)) | 0);
+ };
+ ShortHelper.toString = function (b) {
+ return /* valueOf */ new String(b).toString();
+ };
+ ShortHelper.valueOf$short = function (s) {
+ if (s > -129 && s < 128) {
+ var rebase = s + 128;
+ var result = ShortHelper.BoxedValues.boxedValues_$LI$()[rebase];
+ if (result == null) {
+ result = ShortHelper.BoxedValues.boxedValues_$LI$()[rebase] = new Number(s);
+ }
+ return result;
+ }
+ return new Number(s);
+ };
+ ShortHelper.valueOf$java_lang_String = function (s) {
+ return ShortHelper.valueOf$java_lang_String$int(s, 10);
+ };
+ ShortHelper.valueOf$java_lang_String$int = function (s, radix) {
+ return ShortHelper.valueOf$short(ShortHelper.parseShort(s, radix));
+ };
+ ShortHelper.valueOf = function (s, radix) {
+ if (((typeof s === 'string') || s === null) && ((typeof radix === 'number') || radix === null)) {
+ return javaemul.internal.ShortHelper.valueOf$java_lang_String$int(s, radix);
+ }
+ else if (((typeof s === 'string') || s === null) && radix === undefined) {
+ return javaemul.internal.ShortHelper.valueOf$java_lang_String(s);
+ }
+ else if (((typeof s === 'number') || s === null) && radix === undefined) {
+ return javaemul.internal.ShortHelper.valueOf$short(s);
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ /**
+ *
+ * @return {number}
+ */
+ ShortHelper.prototype.byteValue = function () {
+ return (this.value | 0);
+ };
+ ShortHelper.prototype.compareTo$javaemul_internal_ShortHelper = function (b) {
+ return ShortHelper.compare(this.value, b.value);
+ };
+ /**
+ *
+ * @param {javaemul.internal.ShortHelper} b
+ * @return {number}
+ */
+ ShortHelper.prototype.compareTo = function (b) {
+ if (((b != null && b instanceof javaemul.internal.ShortHelper) || b === null)) {
+ return this.compareTo$javaemul_internal_ShortHelper(b);
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ /**
+ *
+ * @return {number}
+ */
+ ShortHelper.prototype.doubleValue = function () {
+ return this.value;
+ };
+ /**
+ *
+ * @param {*} o
+ * @return {boolean}
+ */
+ ShortHelper.prototype.equals = function (o) {
+ return (o != null && o instanceof javaemul.internal.ShortHelper) && (o.value === this.value);
+ };
+ /**
+ *
+ * @return {number}
+ */
+ ShortHelper.prototype.floatValue = function () {
+ return this.value;
+ };
+ /**
+ *
+ * @return {number}
+ */
+ ShortHelper.prototype.hashCode = function () {
+ return ShortHelper.hashCode(this.value);
+ };
+ /**
+ *
+ * @return {number}
+ */
+ ShortHelper.prototype.intValue = function () {
+ return this.value;
+ };
+ /**
+ *
+ * @return {number}
+ */
+ ShortHelper.prototype.longValue = function () {
+ return this.value;
+ };
+ /**
+ *
+ * @return {number}
+ */
+ ShortHelper.prototype.shortValue = function () {
+ return this.value;
+ };
+ /**
+ *
+ * @return {string}
+ */
+ ShortHelper.prototype.toString = function () {
+ return ShortHelper.toString(this.value);
+ };
+ ShortHelper.SIZE = 16;
+ return ShortHelper;
+ }(javaemul.internal.NumberHelper));
+ internal.ShortHelper = ShortHelper;
+ ShortHelper["__class"] = "javaemul.internal.ShortHelper";
+ ShortHelper["__interfaces"] = ["java.lang.Comparable", "java.io.Serializable"];
+ (function (ShortHelper) {
+ /**
+ * Use nested class to avoid clinit on outer.
+ * @class
+ */
+ var BoxedValues = /** @class */ (function () {
+ function BoxedValues() {
+ }
+ BoxedValues.boxedValues_$LI$ = function () { if (BoxedValues.boxedValues == null) {
+ BoxedValues.boxedValues = (function (s) { var a = []; while (s-- > 0)
+ a.push(null); return a; })(256);
+ } return BoxedValues.boxedValues; };
+ ;
+ return BoxedValues;
+ }());
+ ShortHelper.BoxedValues = BoxedValues;
+ BoxedValues["__class"] = "javaemul.internal.ShortHelper.BoxedValues";
+ })(ShortHelper = internal.ShortHelper || (internal.ShortHelper = {}));
+ })(internal = javaemul.internal || (javaemul.internal = {}));
+})(javaemul || (javaemul = {}));
+(function (javaemul) {
+ var internal;
+ (function (internal) {
+ /**
+ * Wraps native byte as an object.
+ * @param {number} value
+ * @class
+ * @extends javaemul.internal.NumberHelper
+ */
+ var ByteHelper = /** @class */ (function (_super) {
+ __extends(ByteHelper, _super);
+ function ByteHelper(s) {
+ var _this = this;
+ if (((typeof s === 'string') || s === null)) {
+ var __args = arguments;
+ _this = _super.call(this) || this;
+ if (_this.value === undefined) {
+ _this.value = 0;
+ }
+ _this.value = ByteHelper.parseByte(s);
+ }
+ else if (((typeof s === 'number') || s === null)) {
+ var __args = arguments;
+ var value = __args[0];
+ _this = _super.call(this) || this;
+ if (_this.value === undefined) {
+ _this.value = 0;
+ }
+ _this.value = value;
+ }
+ else
+ throw new Error('invalid overload');
+ return _this;
+ }
+ ByteHelper.MIN_VALUE_$LI$ = function () { if (ByteHelper.MIN_VALUE == null) {
+ ByteHelper.MIN_VALUE = (128 | 0);
+ } return ByteHelper.MIN_VALUE; };
+ ;
+ ByteHelper.MAX_VALUE_$LI$ = function () { if (ByteHelper.MAX_VALUE == null) {
+ ByteHelper.MAX_VALUE = (127 | 0);
+ } return ByteHelper.MAX_VALUE; };
+ ;
+ ByteHelper.TYPE_$LI$ = function () { if (ByteHelper.TYPE == null) {
+ ByteHelper.TYPE = Number;
+ } return ByteHelper.TYPE; };
+ ;
+ ByteHelper.compare = function (x, y) {
+ return x - y;
+ };
+ ByteHelper.decode = function (s) {
+ return ByteHelper.valueOf$byte((internal.NumberHelper.__decodeAndValidateInt(s, ByteHelper.MIN_VALUE_$LI$(), ByteHelper.MAX_VALUE_$LI$()) | 0));
+ };
+ /**
+ * @skip
+ *
+ * Here for shared implementation with Arrays.hashCode
+ * @param {number} b
+ * @return {number}
+ */
+ ByteHelper.hashCode = function (b) {
+ return b;
+ };
+ ByteHelper.parseByte = function (s, radix) {
+ if (radix === void 0) { radix = 10; }
+ return (internal.NumberHelper.__parseAndValidateInt(s, radix, ByteHelper.MIN_VALUE_$LI$(), ByteHelper.MAX_VALUE_$LI$()) | 0);
+ };
+ ByteHelper.toString = function (b) {
+ return /* valueOf */ new String(b).toString();
+ };
+ ByteHelper.valueOf$byte = function (b) {
+ var rebase = b + 128;
+ var result = ByteHelper.BoxedValues.boxedValues_$LI$()[rebase];
+ if (result == null) {
+ result = ByteHelper.BoxedValues.boxedValues_$LI$()[rebase] = new Number(b);
+ }
+ return result;
+ };
+ ByteHelper.valueOf$java_lang_String = function (s) {
+ return ByteHelper.valueOf$java_lang_String$int(s, 10);
+ };
+ ByteHelper.valueOf$java_lang_String$int = function (s, radix) {
+ return javaemul.internal.ByteHelper.valueOf(ByteHelper.parseByte(s, radix));
+ };
+ ByteHelper.valueOf = function (s, radix) {
+ if (((typeof s === 'string') || s === null) && ((typeof radix === 'number') || radix === null)) {
+ return javaemul.internal.ByteHelper.valueOf$java_lang_String$int(s, radix);
+ }
+ else if (((typeof s === 'string') || s === null) && radix === undefined) {
+ return javaemul.internal.ByteHelper.valueOf$java_lang_String(s);
+ }
+ else if (((typeof s === 'number') || s === null) && radix === undefined) {
+ return javaemul.internal.ByteHelper.valueOf$byte(s);
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ /**
+ *
+ * @return {number}
+ */
+ ByteHelper.prototype.byteValue = function () {
+ return this.value;
+ };
+ ByteHelper.prototype.compareTo$javaemul_internal_ByteHelper = function (b) {
+ return ByteHelper.compare(this.value, b.value);
+ };
+ /**
+ *
+ * @param {javaemul.internal.ByteHelper} b
+ * @return {number}
+ */
+ ByteHelper.prototype.compareTo = function (b) {
+ if (((b != null && b instanceof javaemul.internal.ByteHelper) || b === null)) {
+ return this.compareTo$javaemul_internal_ByteHelper(b);
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ /**
+ *
+ * @return {number}
+ */
+ ByteHelper.prototype.doubleValue = function () {
+ return this.value;
+ };
+ /**
+ *
+ * @param {*} o
+ * @return {boolean}
+ */
+ ByteHelper.prototype.equals = function (o) {
+ return (o != null && o instanceof javaemul.internal.ByteHelper) && (o.value === this.value);
+ };
+ /**
+ *
+ * @return {number}
+ */
+ ByteHelper.prototype.floatValue = function () {
+ return this.value;
+ };
+ /**
+ *
+ * @return {number}
+ */
+ ByteHelper.prototype.hashCode = function () {
+ return ByteHelper.hashCode(this.value);
+ };
+ /**
+ *
+ * @return {number}
+ */
+ ByteHelper.prototype.intValue = function () {
+ return this.value;
+ };
+ /**
+ *
+ * @return {number}
+ */
+ ByteHelper.prototype.longValue = function () {
+ return this.value;
+ };
+ /**
+ *
+ * @return {number}
+ */
+ ByteHelper.prototype.shortValue = function () {
+ return this.value;
+ };
+ /**
+ *
+ * @return {string}
+ */
+ ByteHelper.prototype.toString = function () {
+ return ByteHelper.toString(this.value);
+ };
+ ByteHelper.SIZE = 8;
+ return ByteHelper;
+ }(javaemul.internal.NumberHelper));
+ internal.ByteHelper = ByteHelper;
+ ByteHelper["__class"] = "javaemul.internal.ByteHelper";
+ ByteHelper["__interfaces"] = ["java.lang.Comparable", "java.io.Serializable"];
+ (function (ByteHelper) {
+ /**
+ * Use nested class to avoid clinit on outer.
+ * @class
+ */
+ var BoxedValues = /** @class */ (function () {
+ function BoxedValues() {
+ }
+ BoxedValues.boxedValues_$LI$ = function () { if (BoxedValues.boxedValues == null) {
+ BoxedValues.boxedValues = (function (s) { var a = []; while (s-- > 0)
+ a.push(null); return a; })(256);
+ } return BoxedValues.boxedValues; };
+ ;
+ return BoxedValues;
+ }());
+ ByteHelper.BoxedValues = BoxedValues;
+ BoxedValues["__class"] = "javaemul.internal.ByteHelper.BoxedValues";
+ })(ByteHelper = internal.ByteHelper || (internal.ByteHelper = {}));
+ })(internal = javaemul.internal || (javaemul.internal = {}));
+})(javaemul || (javaemul = {}));
+(function (javaemul) {
+ var internal;
+ (function (internal) {
+ /**
+ * Wraps a primitive float as an object.
+ * @param {number} value
+ * @class
+ * @extends javaemul.internal.NumberHelper
+ */
+ var FloatHelper = /** @class */ (function (_super) {
+ __extends(FloatHelper, _super);
+ function FloatHelper(s) {
+ var _this = this;
+ if (((typeof s === 'string') || s === null)) {
+ var __args = arguments;
+ _this = _super.call(this) || this;
+ if (_this.value === undefined) {
+ _this.value = 0;
+ }
+ _this.value = FloatHelper.parseFloat(s);
+ }
+ else if (((typeof s === 'number') || s === null)) {
+ var __args = arguments;
+ var value = __args[0];
+ _this = _super.call(this) || this;
+ if (_this.value === undefined) {
+ _this.value = 0;
+ }
+ _this.value = value;
+ }
+ else if (((typeof s === 'number') || s === null)) {
+ var __args = arguments;
+ var value = __args[0];
+ _this = _super.call(this) || this;
+ if (_this.value === undefined) {
+ _this.value = 0;
+ }
+ _this.value = value;
+ }
+ else
+ throw new Error('invalid overload');
+ return _this;
+ }
+ FloatHelper.compare = function (x, y) {
+ return javaemul.internal.DoubleHelper.compare(x, y);
+ };
+ FloatHelper.floatToIntBits = function (value) {
+ if (FloatHelper.isNaN(value)) {
+ return 2143289344;
+ }
+ if (value === 0.0) {
+ if (1.0 / value === FloatHelper.NEGATIVE_INFINITY) {
+ return -2147483648;
+ }
+ else {
+ return 0;
+ }
+ }
+ var negative = false;
+ if (value < 0.0) {
+ negative = true;
+ value = -value;
+ }
+ if (FloatHelper.isInfinite(value)) {
+ if (negative) {
+ return -8388608;
+ }
+ else {
+ return 2139095040;
+ }
+ }
+ var l = javaemul.internal.DoubleHelper.doubleToLongBits(value);
+ var exp = ((((l >> 52) & 2047) - 1023) | 0);
+ var mantissa = (((l & 4503599627370495) >> 29) | 0);
+ if (exp <= -127) {
+ mantissa = (8388608 | mantissa) >> (-127 - exp + 1);
+ exp = -127;
+ }
+ var bits = negative ? FloatHelper.POWER_31_INT : 0;
+ bits |= (exp + 127) << 23;
+ bits |= mantissa;
+ return (bits | 0);
+ };
+ /**
+ * @skip Here for shared implementation with Arrays.hashCode.
+ * @param {number} f
+ * @return {number} hash value of float (currently just truncated to int)
+ */
+ FloatHelper.hashCode = function (f) {
+ return (f | 0);
+ };
+ FloatHelper.intBitsToFloat = function (bits) {
+ var negative = (bits & -2147483648) !== 0;
+ var exp = (bits >> 23) & 255;
+ bits &= 8388607;
+ if (exp === 0) {
+ if (bits === 0) {
+ return negative ? -0.0 : 0.0;
+ }
+ }
+ else if (exp === 255) {
+ if (bits === 0) {
+ return negative ? FloatHelper.NEGATIVE_INFINITY : FloatHelper.POSITIVE_INFINITY;
+ }
+ else {
+ return FloatHelper.NaN;
+ }
+ }
+ if (exp === 0) {
+ exp = 1;
+ while (((bits & 8388608) === 0)) {
+ {
+ bits <<= 1;
+ exp--;
+ }
+ }
+ ;
+ bits &= 8388607;
+ }
+ var bits64 = negative ? -9223372036854775808 : 0;
+ bits64 |= ((function (n) { return n < 0 ? Math.ceil(n) : Math.floor(n); })((exp + 896))) << 52;
+ bits64 |= ((function (n) { return n < 0 ? Math.ceil(n) : Math.floor(n); })(bits)) << 29;
+ return javaemul.internal.DoubleHelper.longBitsToDouble(bits64);
+ };
+ FloatHelper.isInfinite = function (x) {
+ return javaemul.internal.DoubleHelper.isInfinite(x);
+ };
+ FloatHelper.isNaN = function (x) {
+ return javaemul.internal.DoubleHelper.isNaN(x);
+ };
+ FloatHelper.parseFloat = function (s) {
+ var doubleValue = internal.NumberHelper.__parseAndValidateDouble(s);
+ if (doubleValue > FloatHelper.MAX_VALUE) {
+ return FloatHelper.POSITIVE_INFINITY;
+ }
+ else if (doubleValue < -FloatHelper.MAX_VALUE) {
+ return FloatHelper.NEGATIVE_INFINITY;
+ }
+ return doubleValue;
+ };
+ FloatHelper.toString = function (b) {
+ return /* valueOf */ new String(b).toString();
+ };
+ FloatHelper.valueOf$float = function (f) {
+ return new Number(f);
+ };
+ FloatHelper.valueOf$java_lang_String = function (s) {
+ return new Number(s);
+ };
+ FloatHelper.valueOf = function (s) {
+ if (((typeof s === 'string') || s === null)) {
+ return javaemul.internal.FloatHelper.valueOf$java_lang_String(s);
+ }
+ else if (((typeof s === 'number') || s === null)) {
+ return javaemul.internal.FloatHelper.valueOf$float(s);
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ /**
+ *
+ * @return {number}
+ */
+ FloatHelper.prototype.byteValue = function () {
+ return (this.value | 0);
+ };
+ FloatHelper.prototype.compareTo$javaemul_internal_FloatHelper = function (b) {
+ return FloatHelper.compare(this.value, b.value);
+ };
+ /**
+ *
+ * @param {javaemul.internal.FloatHelper} b
+ * @return {number}
+ */
+ FloatHelper.prototype.compareTo = function (b) {
+ if (((b != null && b instanceof javaemul.internal.FloatHelper) || b === null)) {
+ return this.compareTo$javaemul_internal_FloatHelper(b);
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ /**
+ *
+ * @return {number}
+ */
+ FloatHelper.prototype.doubleValue = function () {
+ return this.value;
+ };
+ /**
+ *
+ * @param {*} o
+ * @return {boolean}
+ */
+ FloatHelper.prototype.equals = function (o) {
+ return (o != null && o instanceof javaemul.internal.FloatHelper) && (o.value === this.value);
+ };
+ /**
+ *
+ * @return {number}
+ */
+ FloatHelper.prototype.floatValue = function () {
+ return this.value;
+ };
+ /**
+ * Performance caution: using Float objects as map keys is not recommended.
+ * Using floating point values as keys is generally a bad idea due to
+ * difficulty determining exact equality. In addition, there is no efficient
+ * JavaScript equivalent of floatToIntBits. As a result, this
+ * method computes a hash code by truncating the whole number portion of the
+ * float, which may lead to poor performance for certain value sets if
+ * Floats are used as keys in a {@link java.util.HashMap}.
+ * @return {number}
+ */
+ FloatHelper.prototype.hashCode = function () {
+ return FloatHelper.hashCode(this.value);
+ };
+ /**
+ *
+ * @return {number}
+ */
+ FloatHelper.prototype.intValue = function () {
+ return (this.value | 0);
+ };
+ FloatHelper.prototype.isInfinite = function () {
+ return FloatHelper.isInfinite(this.value);
+ };
+ FloatHelper.prototype.isNaN = function () {
+ return FloatHelper.isNaN(this.value);
+ };
+ /**
+ *
+ * @return {number}
+ */
+ FloatHelper.prototype.longValue = function () {
+ return (function (n) { return n < 0 ? Math.ceil(n) : Math.floor(n); })(this.value);
+ };
+ /**
+ *
+ * @return {number}
+ */
+ FloatHelper.prototype.shortValue = function () {
+ return (this.value | 0);
+ };
+ /**
+ *
+ * @return {string}
+ */
+ FloatHelper.prototype.toString = function () {
+ return FloatHelper.toString(this.value);
+ };
+ FloatHelper.MAX_VALUE = 3.4028235E38;
+ FloatHelper.MIN_VALUE = 1.4E-45;
+ FloatHelper.MAX_EXPONENT = 127;
+ FloatHelper.MIN_EXPONENT = -126;
+ FloatHelper.MIN_NORMAL = 1.17549435E-38;
+ FloatHelper.NaN = 0.0 / 0.0;
+ FloatHelper.NEGATIVE_INFINITY = -1.0 / 0.0;
+ FloatHelper.POSITIVE_INFINITY = 1.0 / 0.0;
+ FloatHelper.SIZE = 32;
+ FloatHelper.POWER_31_INT = 2147483648;
+ return FloatHelper;
+ }(javaemul.internal.NumberHelper));
+ internal.FloatHelper = FloatHelper;
+ FloatHelper["__class"] = "javaemul.internal.FloatHelper";
+ FloatHelper["__interfaces"] = ["java.lang.Comparable", "java.io.Serializable"];
+ })(internal = javaemul.internal || (javaemul.internal = {}));
+})(javaemul || (javaemul = {}));
+(function (javaemul) {
+ var internal;
+ (function (internal) {
+ /**
+ * Wraps a primitive int as an object.
+ * @param {number} value
+ * @class
+ * @extends javaemul.internal.NumberHelper
+ */
+ var IntegerHelper = /** @class */ (function (_super) {
+ __extends(IntegerHelper, _super);
+ function IntegerHelper(s) {
+ var _this = this;
+ if (((typeof s === 'string') || s === null)) {
+ var __args = arguments;
+ _this = _super.call(this) || this;
+ if (_this.value === undefined) {
+ _this.value = 0;
+ }
+ _this.value = IntegerHelper.parseInt(s);
+ }
+ else if (((typeof s === 'number') || s === null)) {
+ var __args = arguments;
+ var value = __args[0];
+ _this = _super.call(this) || this;
+ if (_this.value === undefined) {
+ _this.value = 0;
+ }
+ _this.value = value;
+ }
+ else
+ throw new Error('invalid overload');
+ return _this;
+ }
+ IntegerHelper.bitCount = function (x) {
+ x -= ((x >> 1) & 1431655765);
+ x = (((x >> 2) & 858993459) + (x & 858993459));
+ x = (((x >> 4) + x) & 252645135);
+ x += (x >> 8);
+ x += (x >> 16);
+ return x & 63;
+ };
+ IntegerHelper.compare = function (x, y) {
+ if (x < y) {
+ return -1;
+ }
+ else if (x > y) {
+ return 1;
+ }
+ else {
+ return 0;
+ }
+ };
+ IntegerHelper.decode = function (s) {
+ return IntegerHelper.valueOf$int(internal.NumberHelper.__decodeAndValidateInt(s, IntegerHelper.MIN_VALUE, IntegerHelper.MAX_VALUE));
+ };
+ /**
+ * @skip
+ *
+ * Here for shared implementation with Arrays.hashCode
+ * @param {number} i
+ * @return {number}
+ */
+ IntegerHelper.hashCode = function (i) {
+ return i;
+ };
+ IntegerHelper.highestOneBit = function (i) {
+ if (i < 0) {
+ return IntegerHelper.MIN_VALUE;
+ }
+ else if (i === 0) {
+ return 0;
+ }
+ else {
+ var rtn = void 0;
+ for (rtn = 1073741824; (rtn & i) === 0; rtn >>= 1) {
+ {
+ }
+ ;
+ }
+ return rtn;
+ }
+ };
+ IntegerHelper.lowestOneBit = function (i) {
+ return i & -i;
+ };
+ IntegerHelper.numberOfLeadingZeros = function (i) {
+ if (i < 0) {
+ return 0;
+ }
+ else if (i === 0) {
+ return IntegerHelper.SIZE;
+ }
+ else {
+ var y = void 0;
+ var m = void 0;
+ var n = void 0;
+ y = -(i >> 16);
+ m = (y >> 16) & 16;
+ n = 16 - m;
+ i = i >> m;
+ y = i - 256;
+ m = (y >> 16) & 8;
+ n += m;
+ i <<= m;
+ y = i - 4096;
+ m = (y >> 16) & 4;
+ n += m;
+ i <<= m;
+ y = i - 16384;
+ m = (y >> 16) & 2;
+ n += m;
+ i <<= m;
+ y = i >> 14;
+ m = y & ~(y >> 1);
+ return n + 2 - m;
+ }
+ };
+ IntegerHelper.numberOfTrailingZeros = function (i) {
+ if (i === 0) {
+ return IntegerHelper.SIZE;
+ }
+ else {
+ var rtn = 0;
+ for (var r = 1; (r & i) === 0; r <<= 1) {
+ {
+ rtn++;
+ }
+ ;
+ }
+ return rtn;
+ }
+ };
+ IntegerHelper.parseInt = function (s, radix) {
+ if (radix === void 0) { radix = 10; }
+ return internal.NumberHelper.__parseAndValidateInt(s, radix, IntegerHelper.MIN_VALUE, IntegerHelper.MAX_VALUE);
+ };
+ IntegerHelper.reverse = function (i) {
+ var nibbles = IntegerHelper.ReverseNibbles.reverseNibbles_$LI$();
+ return (nibbles[i >>> 28]) | (nibbles[(i >> 24) & 15] << 4) | (nibbles[(i >> 20) & 15] << 8) | (nibbles[(i >> 16) & 15] << 12) | (nibbles[(i >> 12) & 15] << 16) | (nibbles[(i >> 8) & 15] << 20) | (nibbles[(i >> 4) & 15] << 24) | (nibbles[i & 15] << 28);
+ };
+ IntegerHelper.reverseBytes = function (i) {
+ return ((i & 255) << 24) | ((i & 65280) << 8) | ((i & 16711680) >> 8) | ((i & -16777216) >>> 24);
+ };
+ IntegerHelper.rotateLeft = function (i, distance) {
+ while ((distance-- > 0)) {
+ {
+ i = i << 1 | ((i < 0) ? 1 : 0);
+ }
+ }
+ ;
+ return i;
+ };
+ IntegerHelper.rotateRight = function (i, distance) {
+ var ui = i & IntegerHelper.MAX_VALUE;
+ var carry = (i < 0) ? 1073741824 : 0;
+ while ((distance-- > 0)) {
+ {
+ var nextcarry = ui & 1;
+ ui = carry | (ui >> 1);
+ carry = (nextcarry === 0) ? 0 : 1073741824;
+ }
+ }
+ ;
+ if (carry !== 0) {
+ ui = ui | IntegerHelper.MIN_VALUE;
+ }
+ return ui;
+ };
+ IntegerHelper.signum = function (i) {
+ if (i === 0) {
+ return 0;
+ }
+ else if (i < 0) {
+ return -1;
+ }
+ else {
+ return 1;
+ }
+ };
+ IntegerHelper.toBinaryString = function (value) {
+ return IntegerHelper.toUnsignedRadixString(value, 2);
+ };
+ IntegerHelper.toHexString = function (value) {
+ return IntegerHelper.toUnsignedRadixString(value, 16);
+ };
+ IntegerHelper.toOctalString = function (value) {
+ return IntegerHelper.toUnsignedRadixString(value, 8);
+ };
+ IntegerHelper.toString$int = function (value) {
+ return /* valueOf */ new String(value).toString();
+ };
+ IntegerHelper.toString$int$int = function (value, radix) {
+ if (radix === 10 || radix < javaemul.internal.CharacterHelper.MIN_RADIX || radix > javaemul.internal.CharacterHelper.MAX_RADIX) {
+ return /* valueOf */ new String(value).toString();
+ }
+ return IntegerHelper.toRadixString(value, radix);
+ };
+ IntegerHelper.toString = function (value, radix) {
+ if (((typeof value === 'number') || value === null) && ((typeof radix === 'number') || radix === null)) {
+ return javaemul.internal.IntegerHelper.toString$int$int(value, radix);
+ }
+ else if (((typeof value === 'number') || value === null) && radix === undefined) {
+ return javaemul.internal.IntegerHelper.toString$int(value);
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ IntegerHelper.valueOf$int = function (i) {
+ if (i > -129 && i < 128) {
+ var rebase = i + 128;
+ var result = IntegerHelper.BoxedValues.boxedValues_$LI$()[rebase];
+ if (result == null) {
+ result = IntegerHelper.BoxedValues.boxedValues_$LI$()[rebase] = new Number(i);
+ }
+ return result;
+ }
+ return new Number(i);
+ };
+ IntegerHelper.valueOf$java_lang_String = function (s) {
+ return IntegerHelper.valueOf$java_lang_String$int(s, 10);
+ };
+ IntegerHelper.valueOf$java_lang_String$int = function (s, radix) {
+ return IntegerHelper.valueOf$int(IntegerHelper.parseInt(s, radix));
+ };
+ IntegerHelper.valueOf = function (s, radix) {
+ if (((typeof s === 'string') || s === null) && ((typeof radix === 'number') || radix === null)) {
+ return javaemul.internal.IntegerHelper.valueOf$java_lang_String$int(s, radix);
+ }
+ else if (((typeof s === 'string') || s === null) && radix === undefined) {
+ return javaemul.internal.IntegerHelper.valueOf$java_lang_String(s);
+ }
+ else if (((typeof s === 'number') || s === null) && radix === undefined) {
+ return javaemul.internal.IntegerHelper.valueOf$int(s);
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ IntegerHelper.toRadixString = function (value, radix) {
+ return (value.toString(radix));
+ };
+ IntegerHelper.toUnsignedRadixString = function (value, radix) {
+ return ((value >>> 0).toString(radix));
+ };
+ /**
+ *
+ * @return {number}
+ */
+ IntegerHelper.prototype.byteValue = function () {
+ return (this.value | 0);
+ };
+ IntegerHelper.prototype.compareTo$javaemul_internal_IntegerHelper = function (b) {
+ return IntegerHelper.compare(this.value, b.value);
+ };
+ /**
+ *
+ * @param {javaemul.internal.IntegerHelper} b
+ * @return {number}
+ */
+ IntegerHelper.prototype.compareTo = function (b) {
+ if (((b != null && b instanceof javaemul.internal.IntegerHelper) || b === null)) {
+ return this.compareTo$javaemul_internal_IntegerHelper(b);
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ /**
+ *
+ * @return {number}
+ */
+ IntegerHelper.prototype.doubleValue = function () {
+ return this.value;
+ };
+ /**
+ *
+ * @param {*} o
+ * @return {boolean}
+ */
+ IntegerHelper.prototype.equals = function (o) {
+ return (o != null && o instanceof javaemul.internal.IntegerHelper) && (o.value === this.value);
+ };
+ /**
+ *
+ * @return {number}
+ */
+ IntegerHelper.prototype.floatValue = function () {
+ return this.value;
+ };
+ /**
+ *
+ * @return {number}
+ */
+ IntegerHelper.prototype.hashCode = function () {
+ return IntegerHelper.hashCode(this.value);
+ };
+ /**
+ *
+ * @return {number}
+ */
+ IntegerHelper.prototype.intValue = function () {
+ return this.value;
+ };
+ /**
+ *
+ * @return {number}
+ */
+ IntegerHelper.prototype.longValue = function () {
+ return this.value;
+ };
+ /**
+ *
+ * @return {number}
+ */
+ IntegerHelper.prototype.shortValue = function () {
+ return (this.value | 0);
+ };
+ /**
+ *
+ * @return {string}
+ */
+ IntegerHelper.prototype.toString = function () {
+ return IntegerHelper.toString$int(this.value);
+ };
+ IntegerHelper.getInteger = function (nm) {
+ return IntegerHelper.decode(java.lang.System.getProperty$java_lang_String(nm));
+ };
+ IntegerHelper.MAX_VALUE = 2147483647;
+ IntegerHelper.MIN_VALUE = -2147483648;
+ IntegerHelper.SIZE = 32;
+ return IntegerHelper;
+ }(javaemul.internal.NumberHelper));
+ internal.IntegerHelper = IntegerHelper;
+ IntegerHelper["__class"] = "javaemul.internal.IntegerHelper";
+ IntegerHelper["__interfaces"] = ["java.lang.Comparable", "java.io.Serializable"];
+ (function (IntegerHelper) {
+ /**
+ * Use nested class to avoid clinit on outer.
+ * @class
+ */
+ var BoxedValues = /** @class */ (function () {
+ function BoxedValues() {
+ }
+ BoxedValues.boxedValues_$LI$ = function () { if (BoxedValues.boxedValues == null) {
+ BoxedValues.boxedValues = (function (s) { var a = []; while (s-- > 0)
+ a.push(null); return a; })(256);
+ } return BoxedValues.boxedValues; };
+ ;
+ return BoxedValues;
+ }());
+ IntegerHelper.BoxedValues = BoxedValues;
+ BoxedValues["__class"] = "javaemul.internal.IntegerHelper.BoxedValues";
+ /**
+ * Use nested class to avoid clinit on outer.
+ * @class
+ */
+ var ReverseNibbles = /** @class */ (function () {
+ function ReverseNibbles() {
+ }
+ ReverseNibbles.reverseNibbles_$LI$ = function () { if (ReverseNibbles.reverseNibbles == null) {
+ ReverseNibbles.reverseNibbles = [0, 8, 4, 12, 2, 10, 6, 14, 1, 9, 5, 13, 3, 11, 7, 15];
+ } return ReverseNibbles.reverseNibbles; };
+ ;
+ return ReverseNibbles;
+ }());
+ IntegerHelper.ReverseNibbles = ReverseNibbles;
+ ReverseNibbles["__class"] = "javaemul.internal.IntegerHelper.ReverseNibbles";
+ })(IntegerHelper = internal.IntegerHelper || (internal.IntegerHelper = {}));
+ })(internal = javaemul.internal || (javaemul.internal = {}));
+})(javaemul || (javaemul = {}));
+(function (javaemul) {
+ var internal;
+ (function (internal) {
+ /**
+ * Wraps a primitive long as an object.
+ * @param {number} value
+ * @class
+ * @extends javaemul.internal.NumberHelper
+ */
+ var LongHelper = /** @class */ (function (_super) {
+ __extends(LongHelper, _super);
+ function LongHelper(s) {
+ var _this = this;
+ if (((typeof s === 'string') || s === null)) {
+ var __args = arguments;
+ _this = _super.call(this) || this;
+ if (_this.value === undefined) {
+ _this.value = 0;
+ }
+ _this.value = LongHelper.parseLong(s);
+ }
+ else if (((typeof s === 'number') || s === null)) {
+ var __args = arguments;
+ var value = __args[0];
+ _this = _super.call(this) || this;
+ if (_this.value === undefined) {
+ _this.value = 0;
+ }
+ _this.value = value;
+ }
+ else
+ throw new Error('invalid overload');
+ return _this;
+ }
+ LongHelper.bitCount = function (i) {
+ var high = ((i >> 32) | 0);
+ var low = (i | 0);
+ return javaemul.internal.IntegerHelper.bitCount(high) + javaemul.internal.IntegerHelper.bitCount(low);
+ };
+ LongHelper.compare = function (x, y) {
+ if (x < y) {
+ return -1;
+ }
+ else if (x > y) {
+ return 1;
+ }
+ else {
+ return 0;
+ }
+ };
+ LongHelper.decode = function (s) {
+ var decode = internal.NumberHelper.__decodeNumberString(s);
+ return LongHelper.valueOf$java_lang_String$int(decode.payload, decode.radix);
+ };
+ /**
+ * @skip Here for shared implementation with Arrays.hashCode
+ * @param {number} l
+ * @return {number}
+ */
+ LongHelper.hashCode = function (l) {
+ return (l | 0);
+ };
+ LongHelper.highestOneBit = function (i) {
+ var high = ((i >> 32) | 0);
+ if (high !== 0) {
+ return ((function (n) { return n < 0 ? Math.ceil(n) : Math.floor(n); })(javaemul.internal.IntegerHelper.highestOneBit(high))) << 32;
+ }
+ else {
+ return javaemul.internal.IntegerHelper.highestOneBit((i | 0)) & 4294967295;
+ }
+ };
+ LongHelper.lowestOneBit = function (i) {
+ return i & -i;
+ };
+ LongHelper.numberOfLeadingZeros = function (i) {
+ var high = ((i >> 32) | 0);
+ if (high !== 0) {
+ return javaemul.internal.IntegerHelper.numberOfLeadingZeros(high);
+ }
+ else {
+ return javaemul.internal.IntegerHelper.numberOfLeadingZeros((i | 0)) + 32;
+ }
+ };
+ LongHelper.numberOfTrailingZeros = function (i) {
+ var low = (i | 0);
+ if (low !== 0) {
+ return javaemul.internal.IntegerHelper.numberOfTrailingZeros(low);
+ }
+ else {
+ return javaemul.internal.IntegerHelper.numberOfTrailingZeros(((i >> 32) | 0)) + 32;
+ }
+ };
+ LongHelper.parseLong = function (s, radix) {
+ if (radix === void 0) { radix = 10; }
+ return internal.NumberHelper.__parseAndValidateLong(s, radix);
+ };
+ LongHelper.reverse = function (i) {
+ var high = ((i >>> 32) | 0);
+ var low = (i | 0);
+ return ((function (n) { return n < 0 ? Math.ceil(n) : Math.floor(n); })(javaemul.internal.IntegerHelper.reverse(low)) << 32) | (javaemul.internal.IntegerHelper.reverse(high) & 4294967295);
+ };
+ LongHelper.reverseBytes = function (i) {
+ var high = ((i >>> 32) | 0);
+ var low = (i | 0);
+ return ((function (n) { return n < 0 ? Math.ceil(n) : Math.floor(n); })(javaemul.internal.IntegerHelper.reverseBytes(low)) << 32) | (javaemul.internal.IntegerHelper.reverseBytes(high) & 4294967295);
+ };
+ LongHelper.rotateLeft = function (i, distance) {
+ while ((distance-- > 0)) {
+ {
+ i = i << 1 | ((i < 0) ? 1 : 0);
+ }
+ }
+ ;
+ return i;
+ };
+ LongHelper.rotateRight = function (i, distance) {
+ var ui = i & LongHelper.MAX_VALUE;
+ var carry = (i < 0) ? 4611686018427387904 : 0;
+ while ((distance-- > 0)) {
+ {
+ var nextcarry = ui & 1;
+ ui = carry | (ui >> 1);
+ carry = (nextcarry === 0) ? 0 : 4611686018427387904;
+ }
+ }
+ ;
+ if (carry !== 0) {
+ ui = ui | LongHelper.MIN_VALUE;
+ }
+ return ui;
+ };
+ LongHelper.signum = function (i) {
+ if (i === 0) {
+ return 0;
+ }
+ else if (i < 0) {
+ return -1;
+ }
+ else {
+ return 1;
+ }
+ };
+ LongHelper.toBinaryString = function (value) {
+ return LongHelper.toPowerOfTwoUnsignedString(value, 1);
+ };
+ LongHelper.toHexString = function (value) {
+ return LongHelper.toPowerOfTwoUnsignedString(value, 4);
+ };
+ LongHelper.toOctalString = function (value) {
+ return LongHelper.toPowerOfTwoUnsignedString(value, 3);
+ };
+ LongHelper.toString$long = function (value) {
+ return /* valueOf */ new String(value).toString();
+ };
+ LongHelper.toString$long$int = function (value, intRadix) {
+ if (intRadix === 10 || intRadix < javaemul.internal.CharacterHelper.MIN_RADIX || intRadix > javaemul.internal.CharacterHelper.MAX_RADIX) {
+ return /* valueOf */ new String(value).toString();
+ }
+ var intValue = (value | 0);
+ if (intValue === value) {
+ return javaemul.internal.IntegerHelper.toString$int$int(intValue, intRadix);
+ }
+ var negative = value < 0;
+ if (!negative) {
+ value = -value;
+ }
+ var bufLen = intRadix < 8 ? 65 : 23;
+ var buf = (function (s) { var a = []; while (s-- > 0)
+ a.push(null); return a; })(bufLen);
+ var cursor = bufLen;
+ var radix = intRadix;
+ do {
+ {
+ var q = (function (n) { return n < 0 ? Math.ceil(n) : Math.floor(n); })(value / radix);
+ buf[--cursor] = javaemul.internal.CharacterHelper.forDigit$int(((radix * q - value) | 0));
+ value = q;
+ }
+ } while ((value !== 0));
+ if (negative) {
+ buf[--cursor] = '-';
+ }
+ return /* valueOf */ (function (str, index, len) { return str.join('').substring(index, index + len); })(buf, cursor, bufLen - cursor);
+ };
+ LongHelper.toString = function (value, intRadix) {
+ if (((typeof value === 'number') || value === null) && ((typeof intRadix === 'number') || intRadix === null)) {
+ return javaemul.internal.LongHelper.toString$long$int(value, intRadix);
+ }
+ else if (((typeof value === 'number') || value === null) && intRadix === undefined) {
+ return javaemul.internal.LongHelper.toString$long(value);
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ LongHelper.valueOf$long = function (i) {
+ if (i > -129 && i < 128) {
+ var rebase = (i | 0) + 128;
+ var result = LongHelper.BoxedValues.boxedValues_$LI$()[rebase];
+ if (result == null) {
+ result = LongHelper.BoxedValues.boxedValues_$LI$()[rebase] = new Number(i);
+ }
+ return result;
+ }
+ return new Number(i);
+ };
+ LongHelper.valueOf$java_lang_String = function (s) {
+ return LongHelper.valueOf$java_lang_String$int(s, 10);
+ };
+ LongHelper.valueOf$java_lang_String$int = function (s, radix) {
+ return LongHelper.valueOf$long(LongHelper.parseLong(s, radix));
+ };
+ LongHelper.valueOf = function (s, radix) {
+ if (((typeof s === 'string') || s === null) && ((typeof radix === 'number') || radix === null)) {
+ return javaemul.internal.LongHelper.valueOf$java_lang_String$int(s, radix);
+ }
+ else if (((typeof s === 'string') || s === null) && radix === undefined) {
+ return javaemul.internal.LongHelper.valueOf$java_lang_String(s);
+ }
+ else if (((typeof s === 'number') || s === null) && radix === undefined) {
+ return javaemul.internal.LongHelper.valueOf$long(s);
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ LongHelper.toPowerOfTwoUnsignedString = function (value, shift) {
+ var radix = 1 << shift;
+ if (javaemul.internal.IntegerHelper.MIN_VALUE <= value && value <= javaemul.internal.IntegerHelper.MAX_VALUE) {
+ return javaemul.internal.IntegerHelper.toString$int$int((value | 0), radix);
+ }
+ var mask = radix - 1;
+ var bufSize = (64 / shift | 0) + 1;
+ var buf = (function (s) { var a = []; while (s-- > 0)
+ a.push(null); return a; })(bufSize);
+ var pos = bufSize;
+ do {
+ {
+ buf[--pos] = javaemul.internal.CharacterHelper.forDigit$int(((value | 0)) & mask);
+ value >>>= shift;
+ }
+ } while ((value !== 0));
+ return /* valueOf */ (function (str, index, len) { return str.join('').substring(index, index + len); })(buf, pos, bufSize - pos);
+ };
+ /**
+ *
+ * @return {number}
+ */
+ LongHelper.prototype.byteValue = function () {
+ return (this.value | 0);
+ };
+ LongHelper.prototype.compareTo$javaemul_internal_LongHelper = function (b) {
+ return LongHelper.compare(this.value, b.value);
+ };
+ /**
+ *
+ * @param {javaemul.internal.LongHelper} b
+ * @return {number}
+ */
+ LongHelper.prototype.compareTo = function (b) {
+ if (((b != null && b instanceof javaemul.internal.LongHelper) || b === null)) {
+ return this.compareTo$javaemul_internal_LongHelper(b);
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ /**
+ *
+ * @return {number}
+ */
+ LongHelper.prototype.doubleValue = function () {
+ return this.value;
+ };
+ /**
+ *
+ * @param {*} o
+ * @return {boolean}
+ */
+ LongHelper.prototype.equals = function (o) {
+ return (o != null && o instanceof javaemul.internal.LongHelper) && (o.value === this.value);
+ };
+ /**
+ *
+ * @return {number}
+ */
+ LongHelper.prototype.floatValue = function () {
+ return this.value;
+ };
+ /**
+ *
+ * @return {number}
+ */
+ LongHelper.prototype.hashCode = function () {
+ return LongHelper.hashCode(this.value);
+ };
+ /**
+ *
+ * @return {number}
+ */
+ LongHelper.prototype.intValue = function () {
+ return (this.value | 0);
+ };
+ /**
+ *
+ * @return {number}
+ */
+ LongHelper.prototype.longValue = function () {
+ return this.value;
+ };
+ /**
+ *
+ * @return {number}
+ */
+ LongHelper.prototype.shortValue = function () {
+ return (this.value | 0);
+ };
+ /**
+ *
+ * @return {string}
+ */
+ LongHelper.prototype.toString = function () {
+ return LongHelper.toString$long(this.value);
+ };
+ LongHelper.MAX_VALUE = 9223372036854775807;
+ LongHelper.MIN_VALUE = -9223372036854775808;
+ LongHelper.SIZE = 64;
+ return LongHelper;
+ }(javaemul.internal.NumberHelper));
+ internal.LongHelper = LongHelper;
+ LongHelper["__class"] = "javaemul.internal.LongHelper";
+ LongHelper["__interfaces"] = ["java.lang.Comparable", "java.io.Serializable"];
+ (function (LongHelper) {
+ /**
+ * Use nested class to avoid clinit on outer.
+ * @class
+ */
+ var BoxedValues = /** @class */ (function () {
+ function BoxedValues() {
+ }
+ BoxedValues.boxedValues_$LI$ = function () { if (BoxedValues.boxedValues == null) {
+ BoxedValues.boxedValues = (function (s) { var a = []; while (s-- > 0)
+ a.push(null); return a; })(256);
+ } return BoxedValues.boxedValues; };
+ ;
+ return BoxedValues;
+ }());
+ LongHelper.BoxedValues = BoxedValues;
+ BoxedValues["__class"] = "javaemul.internal.LongHelper.BoxedValues";
+ })(LongHelper = internal.LongHelper || (internal.LongHelper = {}));
+ })(internal = javaemul.internal || (javaemul.internal = {}));
+})(javaemul || (javaemul = {}));
+(function (java) {
+ var util;
+ (function (util) {
+ var Scanner = /** @class */ (function () {
+ function Scanner(string) {
+ if (((typeof string === 'string') || string === null)) {
+ var __args = arguments;
+ {
+ var __args_16 = arguments;
+ var reader = new java.io.StringReader(string);
+ if (this.reader === undefined) {
+ this.reader = null;
+ }
+ if (this.matcher === undefined) {
+ this.matcher = null;
+ }
+ if (this.nextDelimiterWithPattern === undefined) {
+ this.nextDelimiterWithPattern = null;
+ }
+ this.currentDelimiter = Scanner.whiteSpacePattern_$LI$();
+ this.buf = (function (s) { var a = []; while (s-- > 0)
+ a.push(null); return a; })(1024);
+ this.bufferFilledLength = 0;
+ this.currentPosition = 0;
+ this.nextTokenStart = 0;
+ this.nextDelimiterStart = -1;
+ this.nextDelimiterEnd = -1;
+ this.defaultRadix = 10;
+ this.closed = false;
+ this.reader = reader;
+ }
+ if (this.reader === undefined) {
+ this.reader = null;
+ }
+ if (this.matcher === undefined) {
+ this.matcher = null;
+ }
+ if (this.nextDelimiterWithPattern === undefined) {
+ this.nextDelimiterWithPattern = null;
+ }
+ this.currentDelimiter = Scanner.whiteSpacePattern_$LI$();
+ this.buf = (function (s) { var a = []; while (s-- > 0)
+ a.push(null); return a; })(1024);
+ this.bufferFilledLength = 0;
+ this.currentPosition = 0;
+ this.nextTokenStart = 0;
+ this.nextDelimiterStart = -1;
+ this.nextDelimiterEnd = -1;
+ this.defaultRadix = 10;
+ this.closed = false;
+ }
+ else if (((string != null && string instanceof java.io.InputStream) || string === null)) {
+ var __args = arguments;
+ var inputStream = __args[0];
+ {
+ var __args_17 = arguments;
+ var reader = new java.io.InputStreamReader(inputStream);
+ if (this.reader === undefined) {
+ this.reader = null;
+ }
+ if (this.matcher === undefined) {
+ this.matcher = null;
+ }
+ if (this.nextDelimiterWithPattern === undefined) {
+ this.nextDelimiterWithPattern = null;
+ }
+ this.currentDelimiter = Scanner.whiteSpacePattern_$LI$();
+ this.buf = (function (s) { var a = []; while (s-- > 0)
+ a.push(null); return a; })(1024);
+ this.bufferFilledLength = 0;
+ this.currentPosition = 0;
+ this.nextTokenStart = 0;
+ this.nextDelimiterStart = -1;
+ this.nextDelimiterEnd = -1;
+ this.defaultRadix = 10;
+ this.closed = false;
+ this.reader = reader;
+ }
+ if (this.reader === undefined) {
+ this.reader = null;
+ }
+ if (this.matcher === undefined) {
+ this.matcher = null;
+ }
+ if (this.nextDelimiterWithPattern === undefined) {
+ this.nextDelimiterWithPattern = null;
+ }
+ this.currentDelimiter = Scanner.whiteSpacePattern_$LI$();
+ this.buf = (function (s) { var a = []; while (s-- > 0)
+ a.push(null); return a; })(1024);
+ this.bufferFilledLength = 0;
+ this.currentPosition = 0;
+ this.nextTokenStart = 0;
+ this.nextDelimiterStart = -1;
+ this.nextDelimiterEnd = -1;
+ this.defaultRadix = 10;
+ this.closed = false;
+ }
+ else if (((string != null && string instanceof java.io.Reader) || string === null)) {
+ var __args = arguments;
+ var reader = __args[0];
+ if (this.reader === undefined) {
+ this.reader = null;
+ }
+ if (this.matcher === undefined) {
+ this.matcher = null;
+ }
+ if (this.nextDelimiterWithPattern === undefined) {
+ this.nextDelimiterWithPattern = null;
+ }
+ this.currentDelimiter = Scanner.whiteSpacePattern_$LI$();
+ this.buf = (function (s) { var a = []; while (s-- > 0)
+ a.push(null); return a; })(1024);
+ this.bufferFilledLength = 0;
+ this.currentPosition = 0;
+ this.nextTokenStart = 0;
+ this.nextDelimiterStart = -1;
+ this.nextDelimiterEnd = -1;
+ this.defaultRadix = 10;
+ this.closed = false;
+ this.reader = reader;
+ }
+ else
+ throw new Error('invalid overload');
+ }
+ /* Default method injected from java.util.Iterator */
+ Scanner.prototype.forEachRemaining = function (consumer) {
+ var _this = this;
+ javaemul.internal.InternalPreconditions.checkNotNull((consumer));
+ while ((this.hasNext())) {
+ {
+ (function (target) { return (typeof target === 'function') ? target(_this.next()) : target.accept(_this.next()); })(consumer);
+ }
+ }
+ ;
+ };
+ /* Default method injected from java.util.Iterator */
+ Scanner.prototype.remove = function () {
+ throw new java.lang.UnsupportedOperationException();
+ };
+ Scanner.numeral_$LI$ = function () { if (Scanner.numeral == null) {
+ Scanner.numeral = Scanner.digit + "+";
+ } return Scanner.numeral; };
+ ;
+ Scanner.decimalNumeral_$LI$ = function () { if (Scanner.decimalNumeral == null) {
+ Scanner.decimalNumeral = "(?:" + Scanner.numeral_$LI$() + "|" + Scanner.numeral_$LI$() + Scanner.decimalSeparator + Scanner.digit + "*|" + Scanner.decimalSeparator + Scanner.digit + "+)";
+ } return Scanner.decimalNumeral; };
+ ;
+ Scanner.exponent_$LI$ = function () { if (Scanner.exponent == null) {
+ Scanner.exponent = "(?:[eE][+-]?" + Scanner.digit + "+)";
+ } return Scanner.exponent; };
+ ;
+ Scanner.decimal_$LI$ = function () { if (Scanner.decimal == null) {
+ Scanner.decimal = "(?:[-+]?" + Scanner.decimalNumeral_$LI$() + Scanner.exponent_$LI$() + "?)";
+ } return Scanner.decimal; };
+ ;
+ Scanner.signedNonNumber_$LI$ = function () { if (Scanner.signedNonNumber == null) {
+ Scanner.signedNonNumber = "(?:[-+]?" + Scanner.nonNumber + ")";
+ } return Scanner.signedNonNumber; };
+ ;
+ Scanner.booleanPattern_$LI$ = function () { if (Scanner.booleanPattern == null) {
+ Scanner.booleanPattern = java.util.regex.Pattern.compile("true|TRUE|True|1|false|FALSE|False|0");
+ } return Scanner.booleanPattern; };
+ ;
+ Scanner.integerPattern_$LI$ = function () { if (Scanner.integerPattern == null) {
+ Scanner.integerPattern = java.util.regex.Pattern.compile("[-+]?" + Scanner.numeral_$LI$());
+ } return Scanner.integerPattern; };
+ ;
+ Scanner.floatPattern_$LI$ = function () { if (Scanner.floatPattern == null) {
+ Scanner.floatPattern = java.util.regex.Pattern.compile(Scanner.decimal_$LI$() + "|" + Scanner.hexFloat + "|" + Scanner.signedNonNumber_$LI$());
+ } return Scanner.floatPattern; };
+ ;
+ Scanner.endLinePattern_$LI$ = function () { if (Scanner.endLinePattern == null) {
+ Scanner.endLinePattern = java.util.regex.Pattern.compile("[\\n\\r]+");
+ } return Scanner.endLinePattern; };
+ ;
+ Scanner.whiteSpacePattern_$LI$ = function () { if (Scanner.whiteSpacePattern == null) {
+ Scanner.whiteSpacePattern = java.util.regex.Pattern.compile("\\s+");
+ } return Scanner.whiteSpacePattern; };
+ ;
+ /**
+ *
+ */
+ Scanner.prototype.close = function () {
+ this.closed = true;
+ this.reader.close();
+ };
+ Scanner.prototype.delimiter = function () {
+ return this.currentDelimiter;
+ };
+ Scanner.prototype.useDelimiter$java_lang_String = function (currentDelimiter) {
+ return this.useDelimiter$java_util_regex_Pattern(java.util.regex.Pattern.compile$java_lang_String(currentDelimiter));
+ };
+ Scanner.prototype.useDelimiter = function (currentDelimiter) {
+ if (((typeof currentDelimiter === 'string') || currentDelimiter === null)) {
+ return this.useDelimiter$java_lang_String(currentDelimiter);
+ }
+ else if (((currentDelimiter != null && currentDelimiter instanceof java.util.regex.Pattern) || currentDelimiter === null)) {
+ return this.useDelimiter$java_util_regex_Pattern(currentDelimiter);
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ Scanner.prototype.useDelimiter$java_util_regex_Pattern = function (currentDelimiter) {
+ this.currentDelimiter = currentDelimiter;
+ return this;
+ };
+ Scanner.prototype.hasNext$ = function () {
+ if (this.closed && this.currentPosition === this.bufferFilledLength)
+ return false;
+ if (this.nextDelimiterStart === -1 || this.nextDelimiterWithPattern !== this.currentDelimiter) {
+ this.searchNextTo$java_util_regex_Pattern(this.currentDelimiter);
+ this.nextDelimiterWithPattern = this.currentDelimiter;
+ }
+ return this.currentPosition !== this.bufferFilledLength;
+ };
+ /*private*/ Scanner.prototype.searchNextTo$java_util_regex_Pattern = function (pattern) {
+ this.searchNextTo$java_util_regex_Pattern$boolean(pattern, false);
+ };
+ Scanner.prototype.searchNextTo$java_util_regex_Pattern$boolean = function (pattern, canBeEmpty) {
+ try {
+ this.nextTokenStart = 0;
+ while ((!this.closed || this.bufferFilledLength !== this.currentPosition + this.nextTokenStart)) {
+ {
+ this.matcher = pattern.matcher((function (str, index, len) { return str.substring(index, index + len); })((this.buf).join(''), this.currentPosition + this.nextTokenStart, this.bufferFilledLength - this.currentPosition - this.nextTokenStart));
+ if (this.matcher.find$()) {
+ if (this.matcher.start$() > 0 || canBeEmpty) {
+ this.nextDelimiterStart = this.currentPosition + this.nextTokenStart + this.matcher.start$();
+ this.nextDelimiterEnd = this.currentPosition + this.nextTokenStart + this.matcher.end$();
+ return;
+ }
+ this.nextTokenStart += this.matcher.end$();
+ if (this.currentPosition + this.nextTokenStart < this.bufferFilledLength)
+ continue;
+ }
+ if (this.buf.length === this.bufferFilledLength) {
+ if (this.currentPosition < (this.buf.length / 2 | 0)) {
+ var chars = (function (s) { var a = []; while (s-- > 0)
+ a.push(null); return a; })(this.buf.length * 2);
+ java.lang.System.arraycopy(this.buf, this.currentPosition, chars, 0, this.bufferFilledLength - this.currentPosition);
+ this.buf = chars;
+ }
+ else {
+ java.lang.System.arraycopy(this.buf, this.currentPosition, this.buf, 0, this.bufferFilledLength - this.currentPosition);
+ }
+ this.bufferFilledLength -= this.currentPosition;
+ this.currentPosition = 0;
+ this.nextDelimiterStart = this.nextDelimiterEnd = -1;
+ }
+ if (this.closed)
+ break;
+ var read = this.reader.read$char_A$int$int(this.buf, this.bufferFilledLength, this.buf.length - this.bufferFilledLength);
+ if (read <= 0) {
+ try {
+ this.close();
+ }
+ catch (ignored) {
+ }
+ ;
+ }
+ else {
+ this.bufferFilledLength += read;
+ }
+ }
+ }
+ ;
+ }
+ catch (ignored) {
+ try {
+ this.close();
+ }
+ catch (ignored2) {
+ }
+ ;
+ }
+ ;
+ this.nextDelimiterStart = this.nextDelimiterEnd = this.bufferFilledLength;
+ };
+ Scanner.prototype.searchNextTo = function (pattern, canBeEmpty) {
+ if (((pattern != null && pattern instanceof java.util.regex.Pattern) || pattern === null) && ((typeof canBeEmpty === 'boolean') || canBeEmpty === null)) {
+ return this.searchNextTo$java_util_regex_Pattern$boolean(pattern, canBeEmpty);
+ }
+ else if (((pattern != null && pattern instanceof java.util.regex.Pattern) || pattern === null) && canBeEmpty === undefined) {
+ return this.searchNextTo$java_util_regex_Pattern(pattern);
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ /**
+ *
+ * @return {string}
+ */
+ Scanner.prototype.next = function () {
+ if (!this.hasNext$())
+ throw new java.util.NoSuchElementException("No more token");
+ var result = (function (str, index, len) { return str.substring(index, index + len); })((this.buf).join(''), this.currentPosition + this.nextTokenStart, this.nextDelimiterStart - this.currentPosition - this.nextTokenStart);
+ this.currentPosition = this.nextDelimiterStart;
+ this.nextDelimiterStart = this.nextDelimiterEnd = -1;
+ return result;
+ };
+ Scanner.prototype.hasNext$java_util_regex_Pattern = function (pattern) {
+ return this.hasNext$() && pattern.matcher((function (str, index, len) { return str.substring(index, index + len); })((this.buf).join(''), this.currentPosition + this.nextTokenStart, this.nextDelimiterStart - this.currentPosition - this.nextTokenStart)).matches();
+ };
+ Scanner.prototype.hasNext = function (pattern) {
+ if (((pattern != null && pattern instanceof java.util.regex.Pattern) || pattern === null)) {
+ return this.hasNext$java_util_regex_Pattern(pattern);
+ }
+ else if (((typeof pattern === 'string') || pattern === null)) {
+ return this.hasNext$java_lang_String(pattern);
+ }
+ else if (pattern === undefined) {
+ return this.hasNext$();
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ Scanner.prototype.hasNext$java_lang_String = function (pattern) {
+ return this.hasNext$() && java.util.regex.Pattern.matches(pattern, (function (str, index, len) { return str.substring(index, index + len); })((this.buf).join(''), this.currentPosition + this.nextTokenStart, this.nextDelimiterStart - this.currentPosition - this.nextTokenStart));
+ };
+ Scanner.prototype.radix = function () {
+ return this.defaultRadix;
+ };
+ Scanner.prototype.hasNextBoolean = function () {
+ return this.hasNext$java_util_regex_Pattern(Scanner.booleanPattern_$LI$());
+ };
+ Scanner.prototype.nextBoolean = function () {
+ if (!this.hasNextBoolean())
+ throw new java.util.InputMismatchException("Next token is not a boolean");
+ var firstChar = this.next().charAt(0);
+ return (function (c) { return c.charCodeAt == null ? c : c.charCodeAt(0); })(firstChar) == 't'.charCodeAt(0) || (function (c) { return c.charCodeAt == null ? c : c.charCodeAt(0); })(firstChar) == 'T'.charCodeAt(0) || (function (c) { return c.charCodeAt == null ? c : c.charCodeAt(0); })(firstChar) == '1'.charCodeAt(0);
+ };
+ Scanner.prototype.hasNextByte = function () {
+ return this.hasNext$java_util_regex_Pattern(Scanner.integerPattern_$LI$());
+ };
+ Scanner.prototype.nextByte = function () {
+ if (!this.hasNextByte())
+ throw new java.util.InputMismatchException("Next token is not a byte");
+ return javaemul.internal.ByteHelper.parseByte(this.next());
+ };
+ Scanner.prototype.hasNextDouble = function () {
+ return this.hasNext$java_util_regex_Pattern(Scanner.floatPattern_$LI$());
+ };
+ Scanner.prototype.nextDouble = function () {
+ if (!this.hasNextDouble())
+ throw new java.util.InputMismatchException("Next token is not a double");
+ return javaemul.internal.DoubleHelper.parseDouble(this.next());
+ };
+ Scanner.prototype.hasNextFloat = function () {
+ return this.hasNext$java_util_regex_Pattern(Scanner.floatPattern_$LI$());
+ };
+ Scanner.prototype.nextFloat = function () {
+ if (!this.hasNextFloat())
+ throw new java.util.InputMismatchException("Next token is not a float");
+ return javaemul.internal.FloatHelper.parseFloat(this.next());
+ };
+ Scanner.prototype.hasNextInt = function () {
+ return this.hasNext$java_util_regex_Pattern(Scanner.integerPattern_$LI$());
+ };
+ Scanner.prototype.nextInt = function () {
+ if (!this.hasNextInt())
+ throw new java.util.InputMismatchException("Next token is not a int");
+ return javaemul.internal.IntegerHelper.parseInt(this.next());
+ };
+ Scanner.prototype.hasNextLine = function () {
+ if (this.closed && this.currentPosition === this.bufferFilledLength)
+ return false;
+ if (this.nextDelimiterStart === -1 || this.nextDelimiterWithPattern !== Scanner.endLinePattern_$LI$()) {
+ this.searchNextTo$java_util_regex_Pattern$boolean(Scanner.endLinePattern_$LI$(), true);
+ this.nextDelimiterWithPattern = Scanner.endLinePattern_$LI$();
+ }
+ return this.currentPosition !== this.bufferFilledLength;
+ };
+ Scanner.prototype.nextLine = function () {
+ if (!this.hasNextLine())
+ throw new java.util.InputMismatchException("No new line");
+ var result = (function (str, index, len) { return str.substring(index, index + len); })((this.buf).join(''), this.currentPosition, this.nextDelimiterStart - this.currentPosition);
+ this.currentPosition = this.nextDelimiterEnd;
+ this.nextDelimiterStart = this.nextDelimiterEnd = -1;
+ return result;
+ };
+ Scanner.prototype.hasNextLong = function () {
+ return this.hasNext$java_util_regex_Pattern(Scanner.integerPattern_$LI$());
+ };
+ Scanner.prototype.nextLong = function () {
+ if (!this.hasNextLong())
+ throw new java.util.InputMismatchException("Next token is not a long");
+ return javaemul.internal.LongHelper.parseLong(this.next());
+ };
+ Scanner.prototype.hasNextShort = function () {
+ return this.hasNext$java_util_regex_Pattern(Scanner.integerPattern_$LI$());
+ };
+ Scanner.prototype.nextShort = function () {
+ if (!this.hasNextShort())
+ throw new java.util.InputMismatchException("Next token is not a short");
+ return javaemul.internal.ShortHelper.parseShort(this.next());
+ };
+ Scanner.prototype.reset = function () {
+ return this.useDelimiter$java_util_regex_Pattern(Scanner.whiteSpacePattern_$LI$());
+ };
+ Scanner.prototype.skip$java_lang_String = function (pattern) {
+ return this.skip$java_util_regex_Pattern(java.util.regex.Pattern.compile$java_lang_String(pattern));
+ };
+ Scanner.prototype.skip = function (pattern) {
+ if (((typeof pattern === 'string') || pattern === null)) {
+ return this.skip$java_lang_String(pattern);
+ }
+ else if (((pattern != null && pattern instanceof java.util.regex.Pattern) || pattern === null)) {
+ return this.skip$java_util_regex_Pattern(pattern);
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ Scanner.prototype.skip$java_util_regex_Pattern = function (pattern) {
+ if (this.closed && this.currentPosition === this.bufferFilledLength)
+ throw new java.util.NoSuchElementException("No more token");
+ this.searchNextTo$java_util_regex_Pattern$boolean(pattern, true);
+ if (this.nextDelimiterStart !== this.currentPosition) {
+ throw new java.util.NoSuchElementException("The specified pattern was not found");
+ }
+ this.currentPosition = this.nextDelimiterEnd;
+ this.nextDelimiterStart = this.nextDelimiterEnd = -1;
+ return this;
+ };
+ Scanner.prototype.findInLine$java_lang_String = function (pattern) {
+ return this.findInLine$java_util_regex_Pattern(java.util.regex.Pattern.compile$java_lang_String(pattern));
+ };
+ Scanner.prototype.findInLine = function (pattern) {
+ if (((typeof pattern === 'string') || pattern === null)) {
+ return this.findInLine$java_lang_String(pattern);
+ }
+ else if (((pattern != null && pattern instanceof java.util.regex.Pattern) || pattern === null)) {
+ return this.findInLine$java_util_regex_Pattern(pattern);
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ Scanner.prototype.findInLine$java_util_regex_Pattern = function (pattern) {
+ if (!this.hasNextLine()) {
+ return null;
+ }
+ this.matcher = pattern.matcher((function (str, index, len) { return str.substring(index, index + len); })((this.buf).join(''), this.currentPosition, this.nextDelimiterStart - this.currentPosition));
+ if (this.matcher.find$()) {
+ this.nextLine();
+ return this.matcher.group$();
+ }
+ else {
+ this.nextDelimiterStart = this.nextDelimiterEnd = -1;
+ return null;
+ }
+ };
+ Scanner.prototype.match = function () {
+ if (this.matcher == null)
+ throw new java.lang.IllegalStateException("No match result is available");
+ return this.matcher;
+ };
+ Scanner.digit = "[\\d]";
+ Scanner.decimalSeparator = "[.,]";
+ Scanner.hexFloat = "(?:[-+]?0[xX][0-9a-fA-F]*\\.[0-9a-fA-F]+(?:[pP][-+]?[0-9]+)?)";
+ Scanner.nonNumber = "(?:NaN|Infinity)";
+ return Scanner;
+ }());
+ util.Scanner = Scanner;
+ Scanner["__class"] = "java.util.Scanner";
+ Scanner["__interfaces"] = ["java.util.Iterator", "java.io.Closeable", "java.lang.AutoCloseable"];
+ })(util = java.util || (java.util = {}));
+})(java || (java = {}));
+(function (java) {
+ var util;
+ (function (util) {
+ /**
+ * Skeletal implementation of the Set interface. [Sun
+ * docs]
+ *
+ * @param ListIterator for abstract lists.
+ * @extends java.util.AbstractList.IteratorImpl
+ * @class
+ */
+ var ListIteratorImpl = /** @class */ (function (_super) {
+ __extends(ListIteratorImpl, _super);
+ function ListIteratorImpl(__parent, start) {
+ var _this = this;
+ if (((typeof start === 'number') || start === null)) {
+ var __args = Array.prototype.slice.call(arguments, [1]);
+ _this = _super.call(this, __parent) || this;
+ javaemul.internal.InternalPreconditions.checkPositionIndex(start, __parent.size());
+ _this.i = start;
+ }
+ else if (start === undefined) {
+ var __args = Array.prototype.slice.call(arguments, [1]);
+ _this = _super.call(this, __parent) || this;
+ }
+ else
+ throw new Error('invalid overload');
+ return _this;
+ }
+ /* Default method injected from java.util.Iterator */
+ ListIteratorImpl.prototype.forEachRemaining = function (consumer) {
+ var _this = this;
+ javaemul.internal.InternalPreconditions.checkNotNull((consumer));
+ while ((this.hasNext())) {
+ {
+ (function (target) { return (typeof target === 'function') ? target(_this.next()) : target.accept(_this.next()); })(consumer);
+ }
+ }
+ ;
+ };
+ /**
+ *
+ * @param {*} o
+ */
+ ListIteratorImpl.prototype.add = function (o) {
+ this.__parent.add(this.i, o);
+ this.i++;
+ this.last = -1;
+ };
+ /**
+ *
+ * @return {boolean}
+ */
+ ListIteratorImpl.prototype.hasPrevious = function () {
+ return this.i > 0;
+ };
+ /**
+ *
+ * @return {number}
+ */
+ ListIteratorImpl.prototype.nextIndex = function () {
+ return this.i;
+ };
+ /**
+ *
+ * @return {*}
+ */
+ ListIteratorImpl.prototype.previous = function () {
+ javaemul.internal.InternalPreconditions.checkElement(this.hasPrevious());
+ return this.__parent.get(this.last = --this.i);
+ };
+ /**
+ *
+ * @return {number}
+ */
+ ListIteratorImpl.prototype.previousIndex = function () {
+ return this.i - 1;
+ };
+ /**
+ *
+ * @param {*} o
+ */
+ ListIteratorImpl.prototype.set = function (o) {
+ javaemul.internal.InternalPreconditions.checkState(this.last !== -1);
+ this.__parent.set(this.last, o);
+ };
+ return ListIteratorImpl;
+ }(AbstractList.IteratorImpl));
+ AbstractList.ListIteratorImpl = ListIteratorImpl;
+ ListIteratorImpl["__class"] = "java.util.AbstractList.ListIteratorImpl";
+ ListIteratorImpl["__interfaces"] = ["java.util.Iterator", "java.util.ListIterator"];
+ })(AbstractList = util.AbstractList || (util.AbstractList = {}));
+ })(util = java.util || (java.util = {}));
+})(java || (java = {}));
+(function (java) {
+ var util;
+ (function (util) {
+ /**
+ * Skeletal implementation of the Queue interface. [Sun
+ * docs]
+ *
+ * @param InterruptedException with the
+ * specified detail message.
+ *
+ * @param {string} s the detail message.
+ * @class
+ * @extends java.lang.Exception
+ */
+ var InterruptedException = /** @class */ (function (_super) {
+ __extends(InterruptedException, _super);
+ function InterruptedException(s) {
+ var _this = this;
+ if (((typeof s === 'string') || s === null)) {
+ var __args = arguments;
+ _this = _super.call(this, s) || this;
+ _this.message = s;
+ }
+ else if (s === undefined) {
+ var __args = arguments;
+ _this = _super.call(this) || this;
+ }
+ else
+ throw new Error('invalid overload');
+ return _this;
+ }
+ return InterruptedException;
+ }(Error));
+ lang.InterruptedException = InterruptedException;
+ InterruptedException["__class"] = "java.lang.InterruptedException";
+ InterruptedException["__interfaces"] = ["java.io.Serializable"];
+ })(lang = java.lang || (java.lang = {}));
+})(java || (java = {}));
+(function (java) {
+ var lang;
+ (function (lang) {
+ var ReflectiveOperationException = /** @class */ (function (_super) {
+ __extends(ReflectiveOperationException, _super);
+ function ReflectiveOperationException(s) {
+ var _this = this;
+ if (((typeof s === 'string') || s === null)) {
+ var __args = arguments;
+ _this = _super.call(this, s) || this;
+ _this.message = s;
+ }
+ else if (s === undefined) {
+ var __args = arguments;
+ _this = _super.call(this) || this;
+ }
+ else
+ throw new Error('invalid overload');
+ return _this;
+ }
+ return ReflectiveOperationException;
+ }(Error));
+ lang.ReflectiveOperationException = ReflectiveOperationException;
+ ReflectiveOperationException["__class"] = "java.lang.ReflectiveOperationException";
+ ReflectiveOperationException["__interfaces"] = ["java.io.Serializable"];
+ })(lang = java.lang || (java.lang = {}));
+})(java || (java = {}));
+(function (java) {
+ var lang;
+ (function (lang) {
+ /**
+ * See the
+ * official Java API doc for details.
+ *
+ * This exception is never thrown by GWT or GWT's libraries, as GWT does not support reflection. It
+ * is provided in GWT only for compatibility with user code that explicitly throws or catches it for
+ * non-reflection purposes.
+ * @param {string} message
+ * @class
+ * @extends java.lang.Exception
+ */
+ var NoSuchMethodException = /** @class */ (function (_super) {
+ __extends(NoSuchMethodException, _super);
+ function NoSuchMethodException(message) {
+ var _this = this;
+ if (((typeof message === 'string') || message === null)) {
+ var __args = arguments;
+ _this = _super.call(this, message) || this;
+ _this.message = message;
+ }
+ else if (message === undefined) {
+ var __args = arguments;
+ _this = _super.call(this) || this;
+ }
+ else
+ throw new Error('invalid overload');
+ return _this;
+ }
+ return NoSuchMethodException;
+ }(Error));
+ lang.NoSuchMethodException = NoSuchMethodException;
+ NoSuchMethodException["__class"] = "java.lang.NoSuchMethodException";
+ NoSuchMethodException["__interfaces"] = ["java.io.Serializable"];
+ })(lang = java.lang || (java.lang = {}));
+})(java || (java = {}));
+(function (java) {
+ var text;
+ (function (text) {
+ /**
+ * Emulation of {@code java.text.ParseException}.
+ * @param {string} s
+ * @param {number} errorOffset
+ * @class
+ * @extends java.lang.Exception
+ */
+ var ParseException = /** @class */ (function (_super) {
+ __extends(ParseException, _super);
+ function ParseException(s, errorOffset) {
+ var _this = _super.call(this, s) || this;
+ _this.message = s;
+ Object.setPrototypeOf(_this, ParseException.prototype);
+ if (_this.errorOffset === undefined) {
+ _this.errorOffset = 0;
+ }
+ _this.errorOffset = errorOffset;
+ return _this;
+ }
+ ParseException.prototype.getErrorOffset = function () {
+ return this.errorOffset;
+ };
+ return ParseException;
+ }(Error));
+ text.ParseException = ParseException;
+ ParseException["__class"] = "java.text.ParseException";
+ ParseException["__interfaces"] = ["java.io.Serializable"];
+ })(text = java.text || (java.text = {}));
+})(java || (java = {}));
+(function (java) {
+ var lang;
+ (function (lang) {
+ var InheritableThreadLocal = /** @class */ (function (_super) {
+ __extends(InheritableThreadLocal, _super);
+ function InheritableThreadLocal() {
+ return _super !== null && _super.apply(this, arguments) || this;
+ }
+ InheritableThreadLocal.prototype.childValue = function (parentValue) {
+ return parentValue;
+ };
+ return InheritableThreadLocal;
+ }(java.lang.ThreadLocal));
+ lang.InheritableThreadLocal = InheritableThreadLocal;
+ InheritableThreadLocal["__class"] = "java.lang.InheritableThreadLocal";
+ })(lang = java.lang || (java.lang = {}));
+})(java || (java = {}));
+(function (java) {
+ var lang;
+ (function (lang) {
+ /**
+ * A fast way to create strings using multiple appends.
+ *
+ * This class is an exact clone of {@link StringBuffer} except for the name. Any
+ * change made to one should be mirrored in the other.
+ * @param {*} s
+ * @class
+ * @extends java.lang.AbstractStringBuilder
+ */
+ var StringBuilder = /** @class */ (function (_super) {
+ __extends(StringBuilder, _super);
+ function StringBuilder(s) {
+ var _this = this;
+ if (((typeof s === 'string') || s === null)) {
+ var __args = arguments;
+ _this = _super.call(this, s) || this;
+ }
+ else if (((s != null && (s["__interfaces"] != null && s["__interfaces"].indexOf("java.lang.CharSequence") >= 0 || s.constructor != null && s.constructor["__interfaces"] != null && s.constructor["__interfaces"].indexOf("java.lang.CharSequence") >= 0 || typeof s === "string")) || s === null)) {
+ var __args = arguments;
+ _this = _super.call(this, /* valueOf */ new String(s).toString()) || this;
+ }
+ else if (((typeof s === 'number') || s === null)) {
+ var __args = arguments;
+ var ignoredCapacity = __args[0];
+ _this = _super.call(this, "") || this;
+ }
+ else if (s === undefined) {
+ var __args = arguments;
+ _this = _super.call(this, "") || this;
+ }
+ else
+ throw new Error('invalid overload');
+ return _this;
+ }
+ StringBuilder.prototype.append$boolean = function (x) {
+ this.string += x;
+ return this;
+ };
+ StringBuilder.prototype.append$char = function (x) {
+ this.string += /* valueOf */ new String(x).toString();
+ return this;
+ };
+ StringBuilder.prototype.append$char_A = function (x) {
+ this.string += /* valueOf */ new String(x).toString();
+ return this;
+ };
+ StringBuilder.prototype.append$char_A$int$int = function (x, start, len) {
+ this.string += /* valueOf */ (function (str, index, len) { return str.join('').substring(index, index + len); })(x, start, len);
+ return this;
+ };
+ StringBuilder.prototype.append = function (x, start, len) {
+ if (((x != null && x instanceof Array && (x.length == 0 || x[0] == null || (typeof x[0] === 'string'))) || x === null) && ((typeof start === 'number') || start === null) && ((typeof len === 'number') || len === null)) {
+ return this.append$char_A$int$int(x, start, len);
+ }
+ else if (((x != null && (x["__interfaces"] != null && x["__interfaces"].indexOf("java.lang.CharSequence") >= 0 || x.constructor != null && x.constructor["__interfaces"] != null && x.constructor["__interfaces"].indexOf("java.lang.CharSequence") >= 0 || typeof x === "string")) || x === null) && ((typeof start === 'number') || start === null) && ((typeof len === 'number') || len === null)) {
+ return this.append$java_lang_CharSequence$int$int(x, start, len);
+ }
+ else if (((x != null && x instanceof Array && (x.length == 0 || x[0] == null || (typeof x[0] === 'string'))) || x === null) && start === undefined && len === undefined) {
+ return this.append$char_A(x);
+ }
+ else if (((typeof x === 'string') || x === null) && start === undefined && len === undefined) {
+ return this.append$java_lang_String(x);
+ }
+ else if (((x != null && x instanceof java.lang.StringBuffer) || x === null) && start === undefined && len === undefined) {
+ return this.append$java_lang_StringBuffer(x);
+ }
+ else if (((x != null && (x["__interfaces"] != null && x["__interfaces"].indexOf("java.lang.CharSequence") >= 0 || x.constructor != null && x.constructor["__interfaces"] != null && x.constructor["__interfaces"].indexOf("java.lang.CharSequence") >= 0 || typeof x === "string")) || x === null) && start === undefined && len === undefined) {
+ return this.append$java_lang_CharSequence(x);
+ }
+ else if (((typeof x === 'boolean') || x === null) && start === undefined && len === undefined) {
+ return this.append$boolean(x);
+ }
+ else if (((typeof x === 'string') || x === null) && start === undefined && len === undefined) {
+ return this.append$char(x);
+ }
+ else if (((typeof x === 'number') || x === null) && start === undefined && len === undefined) {
+ return this.append$int(x);
+ }
+ else if (((typeof x === 'number') || x === null) && start === undefined && len === undefined) {
+ return this.append$long(x);
+ }
+ else if (((typeof x === 'number') || x === null) && start === undefined && len === undefined) {
+ return this.append$float(x);
+ }
+ else if (((typeof x === 'number') || x === null) && start === undefined && len === undefined) {
+ return this.append$double(x);
+ }
+ else if (((x != null) || x === null) && start === undefined && len === undefined) {
+ return this.append$java_lang_Object(x);
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ StringBuilder.prototype.append$java_lang_CharSequence = function (x) {
+ this.string += x;
+ return this;
+ };
+ StringBuilder.prototype.append$java_lang_CharSequence$int$int = function (x, start, end) {
+ this.append0(x, start, end);
+ return this;
+ };
+ StringBuilder.prototype.append$double = function (x) {
+ this.string += x;
+ return this;
+ };
+ StringBuilder.prototype.append$float = function (x) {
+ this.string += x;
+ return this;
+ };
+ StringBuilder.prototype.append$int = function (x) {
+ this.string += x;
+ return this;
+ };
+ StringBuilder.prototype.append$long = function (x) {
+ this.string += x;
+ return this;
+ };
+ StringBuilder.prototype.append$java_lang_Object = function (x) {
+ this.string += x;
+ return this;
+ };
+ StringBuilder.prototype.append$java_lang_String = function (x) {
+ this.string += x;
+ return this;
+ };
+ StringBuilder.prototype.append$java_lang_StringBuffer = function (x) {
+ this.string += x;
+ return this;
+ };
+ StringBuilder.prototype.appendCodePoint = function (x) {
+ this.appendCodePoint0(x);
+ return this;
+ };
+ StringBuilder.prototype["delete"] = function (start, end) {
+ this.replace0(start, end, "");
+ return this;
+ };
+ StringBuilder.prototype.deleteCharAt = function (start) {
+ this.replace0(start, start + 1, "");
+ return this;
+ };
+ StringBuilder.prototype.insert$int$boolean = function (index, x) {
+ return this.insert$int$java_lang_String(index, /* valueOf */ new String(x).toString());
+ };
+ StringBuilder.prototype.insert$int$char = function (index, x) {
+ this.replace0(index, index, /* valueOf */ new String(x).toString());
+ return this;
+ };
+ StringBuilder.prototype.insert$int$char_A = function (index, x) {
+ return this.insert$int$java_lang_String(index, /* valueOf */ new String(x).toString());
+ };
+ StringBuilder.prototype.insert$int$char_A$int$int = function (index, x, offset, len) {
+ return this.insert$int$java_lang_String(index, /* valueOf */ (function (str, index, len) { return str.join('').substring(index, index + len); })(x, offset, len));
+ };
+ StringBuilder.prototype.insert = function (index, x, offset, len) {
+ if (((typeof index === 'number') || index === null) && ((x != null && x instanceof Array && (x.length == 0 || x[0] == null || (typeof x[0] === 'string'))) || x === null) && ((typeof offset === 'number') || offset === null) && ((typeof len === 'number') || len === null)) {
+ return this.insert$int$char_A$int$int(index, x, offset, len);
+ }
+ else if (((typeof index === 'number') || index === null) && ((x != null && (x["__interfaces"] != null && x["__interfaces"].indexOf("java.lang.CharSequence") >= 0 || x.constructor != null && x.constructor["__interfaces"] != null && x.constructor["__interfaces"].indexOf("java.lang.CharSequence") >= 0 || typeof x === "string")) || x === null) && ((typeof offset === 'number') || offset === null) && ((typeof len === 'number') || len === null)) {
+ return this.insert$int$java_lang_CharSequence$int$int(index, x, offset, len);
+ }
+ else if (((typeof index === 'number') || index === null) && ((x != null && x instanceof Array && (x.length == 0 || x[0] == null || (typeof x[0] === 'string'))) || x === null) && offset === undefined && len === undefined) {
+ return this.insert$int$char_A(index, x);
+ }
+ else if (((typeof index === 'number') || index === null) && ((typeof x === 'string') || x === null) && offset === undefined && len === undefined) {
+ return this.insert$int$java_lang_String(index, x);
+ }
+ else if (((typeof index === 'number') || index === null) && ((x != null && (x["__interfaces"] != null && x["__interfaces"].indexOf("java.lang.CharSequence") >= 0 || x.constructor != null && x.constructor["__interfaces"] != null && x.constructor["__interfaces"].indexOf("java.lang.CharSequence") >= 0 || typeof x === "string")) || x === null) && offset === undefined && len === undefined) {
+ return this.insert$int$java_lang_CharSequence(index, x);
+ }
+ else if (((typeof index === 'number') || index === null) && ((typeof x === 'boolean') || x === null) && offset === undefined && len === undefined) {
+ return this.insert$int$boolean(index, x);
+ }
+ else if (((typeof index === 'number') || index === null) && ((typeof x === 'string') || x === null) && offset === undefined && len === undefined) {
+ return this.insert$int$char(index, x);
+ }
+ else if (((typeof index === 'number') || index === null) && ((typeof x === 'number') || x === null) && offset === undefined && len === undefined) {
+ return this.insert$int$int(index, x);
+ }
+ else if (((typeof index === 'number') || index === null) && ((typeof x === 'number') || x === null) && offset === undefined && len === undefined) {
+ return this.insert$int$long(index, x);
+ }
+ else if (((typeof index === 'number') || index === null) && ((typeof x === 'number') || x === null) && offset === undefined && len === undefined) {
+ return this.insert$int$float(index, x);
+ }
+ else if (((typeof index === 'number') || index === null) && ((typeof x === 'number') || x === null) && offset === undefined && len === undefined) {
+ return this.insert$int$double(index, x);
+ }
+ else if (((typeof index === 'number') || index === null) && ((x != null) || x === null) && offset === undefined && len === undefined) {
+ return this.insert$int$java_lang_Object(index, x);
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ StringBuilder.prototype.insert$int$java_lang_CharSequence = function (index, chars) {
+ return this.insert$int$java_lang_String(index, chars.toString());
+ };
+ StringBuilder.prototype.insert$int$java_lang_CharSequence$int$int = function (index, chars, start, end) {
+ return this.insert$int$java_lang_String(index, /* subSequence */ chars.substring(start, end).toString());
+ };
+ StringBuilder.prototype.insert$int$double = function (index, x) {
+ return this.insert$int$java_lang_String(index, /* valueOf */ new String(x).toString());
+ };
+ StringBuilder.prototype.insert$int$float = function (index, x) {
+ return this.insert$int$java_lang_String(index, /* valueOf */ new String(x).toString());
+ };
+ StringBuilder.prototype.insert$int$int = function (index, x) {
+ return this.insert$int$java_lang_String(index, /* valueOf */ new String(x).toString());
+ };
+ StringBuilder.prototype.insert$int$long = function (index, x) {
+ return this.insert$int$java_lang_String(index, /* valueOf */ new String(x).toString());
+ };
+ StringBuilder.prototype.insert$int$java_lang_Object = function (index, x) {
+ return this.insert$int$java_lang_String(index, /* valueOf */ new String(x).toString());
+ };
+ StringBuilder.prototype.insert$int$java_lang_String = function (index, x) {
+ this.replace0(index, index, x);
+ return this;
+ };
+ StringBuilder.prototype.replace = function (start, end, toInsert) {
+ this.replace0(start, end, toInsert);
+ return this;
+ };
+ StringBuilder.prototype.reverse = function () {
+ this.reverse0();
+ return this;
+ };
+ return StringBuilder;
+ }(java.lang.AbstractStringBuilder));
+ lang.StringBuilder = StringBuilder;
+ StringBuilder["__class"] = "java.lang.StringBuilder";
+ StringBuilder["__interfaces"] = ["java.lang.CharSequence", "java.lang.Appendable"];
+ })(lang = java.lang || (java.lang = {}));
+})(java || (java = {}));
+(function (java) {
+ var lang;
+ (function (lang) {
+ /**
+ * A fast way to create strings using multiple appends.
+ *
+ * This class is an exact clone of {@link StringBuilder} except for the name.
+ * Any change made to one should be mirrored in the other.
+ * @param {*} s
+ * @class
+ * @extends java.lang.AbstractStringBuilder
+ */
+ var StringBuffer = /** @class */ (function (_super) {
+ __extends(StringBuffer, _super);
+ function StringBuffer(s) {
+ var _this = this;
+ if (((typeof s === 'string') || s === null)) {
+ var __args = arguments;
+ _this = _super.call(this, s) || this;
+ }
+ else if (((s != null && (s["__interfaces"] != null && s["__interfaces"].indexOf("java.lang.CharSequence") >= 0 || s.constructor != null && s.constructor["__interfaces"] != null && s.constructor["__interfaces"].indexOf("java.lang.CharSequence") >= 0 || typeof s === "string")) || s === null)) {
+ var __args = arguments;
+ _this = _super.call(this, /* valueOf */ new String(s).toString()) || this;
+ }
+ else if (((typeof s === 'number') || s === null)) {
+ var __args = arguments;
+ var ignoredCapacity = __args[0];
+ _this = _super.call(this, "") || this;
+ }
+ else if (s === undefined) {
+ var __args = arguments;
+ _this = _super.call(this, "") || this;
+ }
+ else
+ throw new Error('invalid overload');
+ return _this;
+ }
+ StringBuffer.prototype.append$boolean = function (x) {
+ this.string += x;
+ return this;
+ };
+ StringBuffer.prototype.append$char = function (x) {
+ this.string += x;
+ return this;
+ };
+ StringBuffer.prototype.append$char_A = function (x) {
+ this.string += /* valueOf */ new String(x).toString();
+ return this;
+ };
+ StringBuffer.prototype.append$char_A$int$int = function (x, start, len) {
+ this.string += /* valueOf */ (function (str, index, len) { return str.join('').substring(index, index + len); })(x, start, len);
+ return this;
+ };
+ StringBuffer.prototype.append = function (x, start, len) {
+ if (((x != null && x instanceof Array && (x.length == 0 || x[0] == null || (typeof x[0] === 'string'))) || x === null) && ((typeof start === 'number') || start === null) && ((typeof len === 'number') || len === null)) {
+ return this.append$char_A$int$int(x, start, len);
+ }
+ else if (((x != null && (x["__interfaces"] != null && x["__interfaces"].indexOf("java.lang.CharSequence") >= 0 || x.constructor != null && x.constructor["__interfaces"] != null && x.constructor["__interfaces"].indexOf("java.lang.CharSequence") >= 0 || typeof x === "string")) || x === null) && ((typeof start === 'number') || start === null) && ((typeof len === 'number') || len === null)) {
+ return this.append$java_lang_CharSequence$int$int(x, start, len);
+ }
+ else if (((x != null && x instanceof Array && (x.length == 0 || x[0] == null || (typeof x[0] === 'string'))) || x === null) && start === undefined && len === undefined) {
+ return this.append$char_A(x);
+ }
+ else if (((typeof x === 'string') || x === null) && start === undefined && len === undefined) {
+ return this.append$java_lang_String(x);
+ }
+ else if (((x != null && x instanceof java.lang.StringBuffer) || x === null) && start === undefined && len === undefined) {
+ return this.append$java_lang_StringBuffer(x);
+ }
+ else if (((x != null && (x["__interfaces"] != null && x["__interfaces"].indexOf("java.lang.CharSequence") >= 0 || x.constructor != null && x.constructor["__interfaces"] != null && x.constructor["__interfaces"].indexOf("java.lang.CharSequence") >= 0 || typeof x === "string")) || x === null) && start === undefined && len === undefined) {
+ return this.append$java_lang_CharSequence(x);
+ }
+ else if (((typeof x === 'boolean') || x === null) && start === undefined && len === undefined) {
+ return this.append$boolean(x);
+ }
+ else if (((typeof x === 'string') || x === null) && start === undefined && len === undefined) {
+ return this.append$char(x);
+ }
+ else if (((typeof x === 'number') || x === null) && start === undefined && len === undefined) {
+ return this.append$int(x);
+ }
+ else if (((typeof x === 'number') || x === null) && start === undefined && len === undefined) {
+ return this.append$long(x);
+ }
+ else if (((typeof x === 'number') || x === null) && start === undefined && len === undefined) {
+ return this.append$float(x);
+ }
+ else if (((typeof x === 'number') || x === null) && start === undefined && len === undefined) {
+ return this.append$double(x);
+ }
+ else if (((x != null) || x === null) && start === undefined && len === undefined) {
+ return this.append$java_lang_Object(x);
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ StringBuffer.prototype.append$java_lang_CharSequence = function (x) {
+ this.string += x;
+ return this;
+ };
+ StringBuffer.prototype.append$java_lang_CharSequence$int$int = function (x, start, end) {
+ this.append0(x, start, end);
+ return this;
+ };
+ StringBuffer.prototype.append$double = function (x) {
+ this.string += x;
+ return this;
+ };
+ StringBuffer.prototype.append$float = function (x) {
+ this.string += x;
+ return this;
+ };
+ StringBuffer.prototype.append$int = function (x) {
+ this.string += x;
+ return this;
+ };
+ StringBuffer.prototype.append$long = function (x) {
+ this.string += x;
+ return this;
+ };
+ StringBuffer.prototype.append$java_lang_Object = function (x) {
+ this.string += x;
+ return this;
+ };
+ StringBuffer.prototype.append$java_lang_String = function (x) {
+ this.string += x;
+ return this;
+ };
+ StringBuffer.prototype.append$java_lang_StringBuffer = function (x) {
+ this.string += x;
+ return this;
+ };
+ StringBuffer.prototype.appendCodePoint = function (x) {
+ this.appendCodePoint0(x);
+ return this;
+ };
+ StringBuffer.prototype["delete"] = function (start, end) {
+ this.replace0(start, end, "");
+ return this;
+ };
+ StringBuffer.prototype.deleteCharAt = function (start) {
+ this.replace0(start, start + 1, "");
+ return this;
+ };
+ StringBuffer.prototype.insert$int$boolean = function (index, x) {
+ return this.insert$int$java_lang_String(index, /* valueOf */ new String(x).toString());
+ };
+ StringBuffer.prototype.insert$int$char = function (index, x) {
+ return this.insert$int$java_lang_String(index, /* valueOf */ new String(x).toString());
+ };
+ StringBuffer.prototype.insert$int$char_A = function (index, x) {
+ return this.insert$int$java_lang_String(index, /* valueOf */ new String(x).toString());
+ };
+ StringBuffer.prototype.insert$int$char_A$int$int = function (index, x, offset, len) {
+ return this.insert$int$java_lang_String(index, /* valueOf */ (function (str, index, len) { return str.join('').substring(index, index + len); })(x, offset, len));
+ };
+ StringBuffer.prototype.insert = function (index, x, offset, len) {
+ if (((typeof index === 'number') || index === null) && ((x != null && x instanceof Array && (x.length == 0 || x[0] == null || (typeof x[0] === 'string'))) || x === null) && ((typeof offset === 'number') || offset === null) && ((typeof len === 'number') || len === null)) {
+ return this.insert$int$char_A$int$int(index, x, offset, len);
+ }
+ else if (((typeof index === 'number') || index === null) && ((x != null && (x["__interfaces"] != null && x["__interfaces"].indexOf("java.lang.CharSequence") >= 0 || x.constructor != null && x.constructor["__interfaces"] != null && x.constructor["__interfaces"].indexOf("java.lang.CharSequence") >= 0 || typeof x === "string")) || x === null) && ((typeof offset === 'number') || offset === null) && ((typeof len === 'number') || len === null)) {
+ return this.insert$int$java_lang_CharSequence$int$int(index, x, offset, len);
+ }
+ else if (((typeof index === 'number') || index === null) && ((x != null && x instanceof Array && (x.length == 0 || x[0] == null || (typeof x[0] === 'string'))) || x === null) && offset === undefined && len === undefined) {
+ return this.insert$int$char_A(index, x);
+ }
+ else if (((typeof index === 'number') || index === null) && ((typeof x === 'string') || x === null) && offset === undefined && len === undefined) {
+ return this.insert$int$java_lang_String(index, x);
+ }
+ else if (((typeof index === 'number') || index === null) && ((x != null && (x["__interfaces"] != null && x["__interfaces"].indexOf("java.lang.CharSequence") >= 0 || x.constructor != null && x.constructor["__interfaces"] != null && x.constructor["__interfaces"].indexOf("java.lang.CharSequence") >= 0 || typeof x === "string")) || x === null) && offset === undefined && len === undefined) {
+ return this.insert$int$java_lang_CharSequence(index, x);
+ }
+ else if (((typeof index === 'number') || index === null) && ((typeof x === 'boolean') || x === null) && offset === undefined && len === undefined) {
+ return this.insert$int$boolean(index, x);
+ }
+ else if (((typeof index === 'number') || index === null) && ((typeof x === 'string') || x === null) && offset === undefined && len === undefined) {
+ return this.insert$int$char(index, x);
+ }
+ else if (((typeof index === 'number') || index === null) && ((typeof x === 'number') || x === null) && offset === undefined && len === undefined) {
+ return this.insert$int$int(index, x);
+ }
+ else if (((typeof index === 'number') || index === null) && ((typeof x === 'number') || x === null) && offset === undefined && len === undefined) {
+ return this.insert$int$long(index, x);
+ }
+ else if (((typeof index === 'number') || index === null) && ((typeof x === 'number') || x === null) && offset === undefined && len === undefined) {
+ return this.insert$int$float(index, x);
+ }
+ else if (((typeof index === 'number') || index === null) && ((typeof x === 'number') || x === null) && offset === undefined && len === undefined) {
+ return this.insert$int$double(index, x);
+ }
+ else if (((typeof index === 'number') || index === null) && ((x != null) || x === null) && offset === undefined && len === undefined) {
+ return this.insert$int$java_lang_Object(index, x);
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ StringBuffer.prototype.insert$int$java_lang_CharSequence = function (index, chars) {
+ return this.insert$int$java_lang_String(index, chars.toString());
+ };
+ StringBuffer.prototype.insert$int$java_lang_CharSequence$int$int = function (index, chars, start, end) {
+ return this.insert$int$java_lang_String(index, /* subSequence */ chars.substring(start, end).toString());
+ };
+ StringBuffer.prototype.insert$int$double = function (index, x) {
+ return this.insert$int$java_lang_String(index, /* valueOf */ new String(x).toString());
+ };
+ StringBuffer.prototype.insert$int$float = function (index, x) {
+ return this.insert$int$java_lang_String(index, /* valueOf */ new String(x).toString());
+ };
+ StringBuffer.prototype.insert$int$int = function (index, x) {
+ return this.insert$int$java_lang_String(index, /* valueOf */ new String(x).toString());
+ };
+ StringBuffer.prototype.insert$int$long = function (index, x) {
+ return this.insert$int$java_lang_String(index, /* valueOf */ new String(x).toString());
+ };
+ StringBuffer.prototype.insert$int$java_lang_Object = function (index, x) {
+ return this.insert$int$java_lang_String(index, /* valueOf */ new String(x).toString());
+ };
+ StringBuffer.prototype.insert$int$java_lang_String = function (index, x) {
+ this.replace0(index, index, x);
+ return this;
+ };
+ StringBuffer.prototype.replace = function (start, end, toInsert) {
+ this.replace0(start, end, toInsert);
+ return this;
+ };
+ StringBuffer.prototype.reverse = function () {
+ this.reverse0();
+ return this;
+ };
+ return StringBuffer;
+ }(java.lang.AbstractStringBuilder));
+ lang.StringBuffer = StringBuffer;
+ StringBuffer["__class"] = "java.lang.StringBuffer";
+ StringBuffer["__interfaces"] = ["java.lang.CharSequence", "java.lang.Appendable"];
+ })(lang = java.lang || (java.lang = {}));
+})(java || (java = {}));
+(function (java) {
+ var nio;
+ (function (nio) {
+ var ByteBuffer = /** @class */ (function (_super) {
+ __extends(ByteBuffer, _super);
+ function ByteBuffer(_buffer, readOnly) {
+ var _this = _super.call(this, (_buffer.byteLength | 0), readOnly) || this;
+ if (_this._buffer === undefined) {
+ _this._buffer = null;
+ }
+ if (_this._array === undefined) {
+ _this._array = null;
+ }
+ if (_this._data === undefined) {
+ _this._data = null;
+ }
+ _this._order = java.nio.ByteOrder.BIG_ENDIAN_$LI$();
+ _this._buffer = _buffer;
+ _this._array = new Int8Array(_buffer);
+ _this._data = new DataView(_buffer);
+ return _this;
+ }
+ ByteBuffer.allocate = function (capacity) {
+ return new ByteBuffer(new ArrayBuffer(capacity), false);
+ };
+ /**
+ *
+ * @return {Array}
+ */
+ ByteBuffer.prototype.array = function () {
+ return this._array;
+ };
+ ByteBuffer.prototype.asReadOnlyBuffer = function () {
+ var byteBuffer = new ByteBuffer(this._buffer, true);
+ byteBuffer.limit$int(this.limit$());
+ byteBuffer.position$int(this.position$());
+ byteBuffer._mark = this._mark;
+ return byteBuffer;
+ };
+ ByteBuffer.prototype.compact = function () {
+ if (this.isReadOnly())
+ throw new java.nio.ReadOnlyBufferException();
+ var current = this.position$();
+ for (var i = current; i < this.limit$(); ++i) {
+ {
+ this.put$int$byte(i - current, this.get$int(i));
+ }
+ ;
+ }
+ this.position$int(this.limit$() - this.position$());
+ this.limit$int(this.capacity());
+ this._mark = -1;
+ return this;
+ };
+ ByteBuffer.prototype.compareTo$java_nio_ByteBuffer = function (byteBuffer) {
+ return /* compareTo */ this._array.toString().localeCompare(byteBuffer.toString());
+ };
+ /**
+ *
+ * @param {java.nio.ByteBuffer} byteBuffer
+ * @return {number}
+ */
+ ByteBuffer.prototype.compareTo = function (byteBuffer) {
+ if (((byteBuffer != null && byteBuffer instanceof java.nio.ByteBuffer) || byteBuffer === null)) {
+ return this.compareTo$java_nio_ByteBuffer(byteBuffer);
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ ByteBuffer.prototype.duplicate = function () {
+ var byteBuffer = new ByteBuffer(this._buffer, this.isReadOnly());
+ byteBuffer.limit$int(this.limit$());
+ byteBuffer.position$int(this.position$());
+ byteBuffer._mark = this._mark;
+ return byteBuffer;
+ };
+ /**
+ *
+ * @param {*} o
+ * @return {boolean}
+ */
+ ByteBuffer.prototype.equals = function (o) {
+ return this === o || (o != null && o instanceof java.nio.ByteBuffer) && java.util.Objects.equals(this._array, o._array);
+ };
+ ByteBuffer.prototype.get$ = function () {
+ if (this.position$() === this.limit$())
+ throw new java.nio.BufferUnderflowException();
+ var b = this._array[this.position$()];
+ this.position$int(this.position$() + 1);
+ return b;
+ };
+ ByteBuffer.prototype.get$byte_A = function (dest) {
+ return this.get$byte_A$int$int(dest, 0, dest.length);
+ };
+ ByteBuffer.prototype.get$byte_A$int$int = function (dest, offset, length) {
+ if (this.remaining() < length)
+ throw new java.nio.BufferUnderflowException();
+ for (var i = offset; i < offset + length; i++) {
+ dest[i] = this.get$();
+ }
+ return this;
+ };
+ ByteBuffer.prototype.get = function (dest, offset, length) {
+ if (((dest != null && dest instanceof Array && (dest.length == 0 || dest[0] == null || (typeof dest[0] === 'number'))) || dest === null) && ((typeof offset === 'number') || offset === null) && ((typeof length === 'number') || length === null)) {
+ return this.get$byte_A$int$int(dest, offset, length);
+ }
+ else if (((dest != null && dest instanceof Array && (dest.length == 0 || dest[0] == null || (typeof dest[0] === 'number'))) || dest === null) && offset === undefined && length === undefined) {
+ return this.get$byte_A(dest);
+ }
+ else if (((typeof dest === 'number') || dest === null) && offset === undefined && length === undefined) {
+ return this.get$int(dest);
+ }
+ else if (dest === undefined && offset === undefined && length === undefined) {
+ return this.get$();
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ ByteBuffer.prototype.get$int = function (from) {
+ if (from < 0 || from > this.limit$())
+ throw new java.lang.IndexOutOfBoundsException();
+ return this._array[from];
+ };
+ ByteBuffer.prototype.getChar$ = function () {
+ if (this.remaining() < 2)
+ throw new java.nio.BufferUnderflowException();
+ var res = (String.fromCharCode((this._data.getInt16(this.position$(), this._order === java.nio.ByteOrder.LITTLE_ENDIAN_$LI$()) | 0))).charAt(0);
+ this.position$int(this.position$() + 2);
+ return res;
+ };
+ ByteBuffer.prototype.getChar$int = function (from) {
+ if (from < 0 || from > this.limit$() - 1)
+ throw new java.lang.IndexOutOfBoundsException();
+ return (String.fromCharCode((this._data.getInt16(from, this._order === java.nio.ByteOrder.LITTLE_ENDIAN_$LI$()) | 0))).charAt(0);
+ };
+ ByteBuffer.prototype.getChar = function (from) {
+ if (((typeof from === 'number') || from === null)) {
+ return this.getChar$int(from);
+ }
+ else if (from === undefined) {
+ return this.getChar$();
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ ByteBuffer.prototype.getDouble$ = function () {
+ if (this.remaining() < 8)
+ throw new java.nio.BufferUnderflowException();
+ var res = this._data.getFloat64(this.position$(), this._order === java.nio.ByteOrder.LITTLE_ENDIAN_$LI$());
+ this.position$int(this.position$() + 8);
+ return res;
+ };
+ ByteBuffer.prototype.getDouble$int = function (from) {
+ if (from < 0 || from > this.limit$() - 7)
+ throw new java.lang.IndexOutOfBoundsException();
+ return this._data.getFloat64(from, this._order === java.nio.ByteOrder.LITTLE_ENDIAN_$LI$());
+ };
+ ByteBuffer.prototype.getDouble = function (from) {
+ if (((typeof from === 'number') || from === null)) {
+ return this.getDouble$int(from);
+ }
+ else if (from === undefined) {
+ return this.getDouble$();
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ ByteBuffer.prototype.getFloat$ = function () {
+ if (this.remaining() < 4)
+ throw new java.nio.BufferUnderflowException();
+ var res = this._data.getFloat32(this.position$(), this._order === java.nio.ByteOrder.LITTLE_ENDIAN_$LI$());
+ this.position$int(this.position$() + 4);
+ return res;
+ };
+ ByteBuffer.prototype.getFloat$int = function (from) {
+ if (from < 0 || from > this.limit$() - 3)
+ throw new java.lang.IndexOutOfBoundsException();
+ return this._data.getFloat32(from, this._order === java.nio.ByteOrder.LITTLE_ENDIAN_$LI$());
+ };
+ ByteBuffer.prototype.getFloat = function (from) {
+ if (((typeof from === 'number') || from === null)) {
+ return this.getFloat$int(from);
+ }
+ else if (from === undefined) {
+ return this.getFloat$();
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ ByteBuffer.prototype.getInt$ = function () {
+ if (this.remaining() < 4)
+ throw new java.nio.BufferUnderflowException();
+ var res = this._data.getInt32(this.position$(), this._order === java.nio.ByteOrder.LITTLE_ENDIAN_$LI$());
+ this.position$int(this.position$() + 4);
+ return res;
+ };
+ ByteBuffer.prototype.getInt$int = function (from) {
+ if (from < 0 || from > this.limit$() - 3)
+ throw new java.lang.IndexOutOfBoundsException();
+ return this._data.getInt32(from, this._order === java.nio.ByteOrder.LITTLE_ENDIAN_$LI$());
+ };
+ ByteBuffer.prototype.getInt = function (from) {
+ if (((typeof from === 'number') || from === null)) {
+ return this.getInt$int(from);
+ }
+ else if (from === undefined) {
+ return this.getInt$();
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ ByteBuffer.prototype.getLong$ = function () {
+ if (this.remaining() < 8)
+ throw new java.nio.BufferUnderflowException();
+ var res1 = this._data.getInt32(this.position$(), this._order === java.nio.ByteOrder.LITTLE_ENDIAN_$LI$());
+ var res2 = this._data.getInt32(this.position$() + 4, this._order === java.nio.ByteOrder.LITTLE_ENDIAN_$LI$());
+ if (this._order === java.nio.ByteOrder.LITTLE_ENDIAN_$LI$()) {
+ var tmp = res1;
+ res1 = res2;
+ res2 = tmp;
+ }
+ this.position$int(this.position$() + 8);
+ return res1 * 4294967296 + res2;
+ };
+ ByteBuffer.prototype.getLong$int = function (from) {
+ if (from < 0 || from > this.limit$() - 7)
+ throw new java.lang.IndexOutOfBoundsException();
+ var res1 = this._data.getInt32(from, this._order === java.nio.ByteOrder.LITTLE_ENDIAN_$LI$());
+ var res2 = this._data.getInt32(from + 4, this._order === java.nio.ByteOrder.LITTLE_ENDIAN_$LI$());
+ if (this._order === java.nio.ByteOrder.LITTLE_ENDIAN_$LI$()) {
+ var tmp = res1;
+ res1 = res2;
+ res2 = tmp;
+ }
+ return res1 * 4294967296 + res2;
+ };
+ ByteBuffer.prototype.getLong = function (from) {
+ if (((typeof from === 'number') || from === null)) {
+ return this.getLong$int(from);
+ }
+ else if (from === undefined) {
+ return this.getLong$();
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ ByteBuffer.prototype.getShort$ = function () {
+ if (this.remaining() < 2)
+ throw new java.nio.BufferUnderflowException();
+ var res = this._data.getInt16(this.position$(), this._order === java.nio.ByteOrder.LITTLE_ENDIAN_$LI$());
+ this.position$int(this.position$() + 2);
+ return res;
+ };
+ ByteBuffer.prototype.getShort$int = function (from) {
+ if (from < 0 || from > this.limit$() - 1)
+ throw new java.lang.IndexOutOfBoundsException();
+ return this._data.getInt16(from, this._order === java.nio.ByteOrder.LITTLE_ENDIAN_$LI$());
+ };
+ ByteBuffer.prototype.getShort = function (from) {
+ if (((typeof from === 'number') || from === null)) {
+ return this.getShort$int(from);
+ }
+ else if (from === undefined) {
+ return this.getShort$();
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ ByteBuffer.prototype.order$ = function () {
+ return this._order;
+ };
+ ByteBuffer.prototype.order$java_nio_ByteOrder = function (newOrder) {
+ this._order = newOrder;
+ return this;
+ };
+ ByteBuffer.prototype.order = function (newOrder) {
+ if (((newOrder != null && newOrder instanceof java.nio.ByteOrder) || newOrder === null)) {
+ return this.order$java_nio_ByteOrder(newOrder);
+ }
+ else if (newOrder === undefined) {
+ return this.order$();
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ ByteBuffer.prototype.put$byte = function (b) {
+ if (this.isReadOnly())
+ throw new java.nio.ReadOnlyBufferException();
+ if (this.position$() === this.limit$())
+ throw new java.nio.BufferOverflowException();
+ this._array[this.position$()] = b;
+ this.position$int(this.position$() + 1);
+ return this;
+ };
+ ByteBuffer.prototype.put$byte_A = function (src) {
+ return this.put$byte_A$int$int(src, 0, src.length);
+ };
+ ByteBuffer.prototype.put$byte_A$int$int = function (src, offset, length) {
+ if (this.isReadOnly())
+ throw new java.nio.ReadOnlyBufferException();
+ if (this.remaining() < length)
+ throw new java.nio.BufferOverflowException();
+ for (var i = offset; i < offset + length; i++) {
+ this.put$byte(src[i]);
+ }
+ return this;
+ };
+ ByteBuffer.prototype.put = function (src, offset, length) {
+ if (((src != null && src instanceof Array && (src.length == 0 || src[0] == null || (typeof src[0] === 'number'))) || src === null) && ((typeof offset === 'number') || offset === null) && ((typeof length === 'number') || length === null)) {
+ return this.put$byte_A$int$int(src, offset, length);
+ }
+ else if (((typeof src === 'number') || src === null) && ((typeof offset === 'number') || offset === null) && length === undefined) {
+ return this.put$int$byte(src, offset);
+ }
+ else if (((src != null && src instanceof Array && (src.length == 0 || src[0] == null || (typeof src[0] === 'number'))) || src === null) && offset === undefined && length === undefined) {
+ return this.put$byte_A(src);
+ }
+ else if (((typeof src === 'number') || src === null) && offset === undefined && length === undefined) {
+ return this.put$byte(src);
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ ByteBuffer.prototype.put$int$byte = function (to, b) {
+ if (this.isReadOnly())
+ throw new java.nio.ReadOnlyBufferException();
+ if (to < 0 || to > this.limit$())
+ throw new java.lang.IndexOutOfBoundsException();
+ this._array[to] = b;
+ return this;
+ };
+ ByteBuffer.prototype.putChar$char = function (value) {
+ if (this.isReadOnly())
+ throw new java.nio.ReadOnlyBufferException();
+ if (this.remaining() < 2)
+ throw new java.nio.BufferOverflowException();
+ this._data.setInt16(this.position$(), (value).charCodeAt(0), this._order === java.nio.ByteOrder.LITTLE_ENDIAN_$LI$());
+ this.position$int(this.position$() + 2);
+ return this;
+ };
+ ByteBuffer.prototype.putChar$int$char = function (to, value) {
+ if (this.isReadOnly())
+ throw new java.nio.ReadOnlyBufferException();
+ if (to < 0 || to > this.limit$() - 1)
+ throw new java.lang.IndexOutOfBoundsException();
+ this._data.setInt16(to, (value).charCodeAt(0), this._order === java.nio.ByteOrder.LITTLE_ENDIAN_$LI$());
+ return this;
+ };
+ ByteBuffer.prototype.putChar = function (to, value) {
+ if (((typeof to === 'number') || to === null) && ((typeof value === 'string') || value === null)) {
+ return this.putChar$int$char(to, value);
+ }
+ else if (((typeof to === 'string') || to === null) && value === undefined) {
+ return this.putChar$char(to);
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ ByteBuffer.prototype.putDouble$double = function (value) {
+ if (this.isReadOnly())
+ throw new java.nio.ReadOnlyBufferException();
+ if (this.remaining() < 8)
+ throw new java.nio.BufferOverflowException();
+ this._data.setFloat64(this.position$(), value, this._order === java.nio.ByteOrder.LITTLE_ENDIAN_$LI$());
+ this.position$int(this.position$() + 8);
+ return this;
+ };
+ ByteBuffer.prototype.putDouble$int$double = function (to, value) {
+ if (this.isReadOnly())
+ throw new java.nio.ReadOnlyBufferException();
+ if (to < 0 || to > this.limit$() - 7)
+ throw new java.lang.IndexOutOfBoundsException();
+ this._data.setFloat64(to, value, this._order === java.nio.ByteOrder.LITTLE_ENDIAN_$LI$());
+ return this;
+ };
+ ByteBuffer.prototype.putDouble = function (to, value) {
+ if (((typeof to === 'number') || to === null) && ((typeof value === 'number') || value === null)) {
+ return this.putDouble$int$double(to, value);
+ }
+ else if (((typeof to === 'number') || to === null) && value === undefined) {
+ return this.putDouble$double(to);
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ ByteBuffer.prototype.putFloat$float = function (value) {
+ if (this.isReadOnly())
+ throw new java.nio.ReadOnlyBufferException();
+ if (this.remaining() < 4)
+ throw new java.nio.BufferOverflowException();
+ this._data.setFloat32(this.position$(), value, this._order === java.nio.ByteOrder.LITTLE_ENDIAN_$LI$());
+ this.position$int(this.position$() + 4);
+ return this;
+ };
+ ByteBuffer.prototype.putFloat$int$float = function (to, value) {
+ if (this.isReadOnly())
+ throw new java.nio.ReadOnlyBufferException();
+ if (to < 0 || to > this.limit$() - 3)
+ throw new java.lang.IndexOutOfBoundsException();
+ this._data.setFloat32(to, value, this._order === java.nio.ByteOrder.LITTLE_ENDIAN_$LI$());
+ return this;
+ };
+ ByteBuffer.prototype.putFloat = function (to, value) {
+ if (((typeof to === 'number') || to === null) && ((typeof value === 'number') || value === null)) {
+ return this.putFloat$int$float(to, value);
+ }
+ else if (((typeof to === 'number') || to === null) && value === undefined) {
+ return this.putFloat$float(to);
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ ByteBuffer.prototype.putInt$int = function (value) {
+ if (this.isReadOnly())
+ throw new java.nio.ReadOnlyBufferException();
+ if (this.remaining() < 4)
+ throw new java.nio.BufferOverflowException();
+ this._data.setInt32(this.position$(), value, this._order === java.nio.ByteOrder.LITTLE_ENDIAN_$LI$());
+ this.position$int(this.position$() + 4);
+ return this;
+ };
+ ByteBuffer.prototype.putInt$int$int = function (to, value) {
+ if (this.isReadOnly())
+ throw new java.nio.ReadOnlyBufferException();
+ if (to < 0 || to > this.limit$() - 3)
+ throw new java.lang.IndexOutOfBoundsException();
+ this._data.setInt32(to, value, this._order === java.nio.ByteOrder.LITTLE_ENDIAN_$LI$());
+ return this;
+ };
+ ByteBuffer.prototype.putInt = function (to, value) {
+ if (((typeof to === 'number') || to === null) && ((typeof value === 'number') || value === null)) {
+ return this.putInt$int$int(to, value);
+ }
+ else if (((typeof to === 'number') || to === null) && value === undefined) {
+ return this.putInt$int(to);
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ ByteBuffer.prototype.putLong$long = function (value) {
+ if (this.isReadOnly())
+ throw new java.nio.ReadOnlyBufferException();
+ if (this.remaining() < 8)
+ throw new java.nio.BufferOverflowException();
+ var big = (((function (n) { return n < 0 ? Math.ceil(n) : Math.floor(n); })(value / 4294967296)) | 0);
+ var small = ((value % 4294967296) | 0);
+ if (this._order === java.nio.ByteOrder.LITTLE_ENDIAN_$LI$()) {
+ var tmp = big;
+ big = small;
+ small = tmp;
+ }
+ this._data.setInt32(this.position$(), big, this._order === java.nio.ByteOrder.LITTLE_ENDIAN_$LI$());
+ this._data.setInt32(this.position$() + 4, small, this._order === java.nio.ByteOrder.LITTLE_ENDIAN_$LI$());
+ this.position$int(this.position$() + 8);
+ return this;
+ };
+ ByteBuffer.prototype.putLong$int$long = function (to, value) {
+ if (this.isReadOnly())
+ throw new java.nio.ReadOnlyBufferException();
+ if (to < 0 || to > this.limit$() - 7)
+ throw new java.lang.IndexOutOfBoundsException();
+ var big = (((function (n) { return n < 0 ? Math.ceil(n) : Math.floor(n); })(value / 4294967296)) | 0);
+ var small = ((value % 4294967296) | 0);
+ if (this._order === java.nio.ByteOrder.LITTLE_ENDIAN_$LI$()) {
+ var tmp = big;
+ big = small;
+ small = tmp;
+ }
+ this._data.setInt32(to, big, this._order === java.nio.ByteOrder.LITTLE_ENDIAN_$LI$());
+ this._data.setInt32(to + 4, small, this._order === java.nio.ByteOrder.LITTLE_ENDIAN_$LI$());
+ return this;
+ };
+ ByteBuffer.prototype.putLong = function (to, value) {
+ if (((typeof to === 'number') || to === null) && ((typeof value === 'number') || value === null)) {
+ return this.putLong$int$long(to, value);
+ }
+ else if (((typeof to === 'number') || to === null) && value === undefined) {
+ return this.putLong$long(to);
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ ByteBuffer.prototype.putShort$short = function (value) {
+ if (this.isReadOnly())
+ throw new java.nio.ReadOnlyBufferException();
+ if (this.remaining() < 2)
+ throw new java.nio.BufferOverflowException();
+ this._data.setInt16(this.position$(), value, this._order === java.nio.ByteOrder.LITTLE_ENDIAN_$LI$());
+ this.position$int(this.position$() + 2);
+ return this;
+ };
+ ByteBuffer.prototype.putShort$int$short = function (to, value) {
+ if (this.isReadOnly())
+ throw new java.nio.ReadOnlyBufferException();
+ if (to < 0 || to > this.limit$() - 1)
+ throw new java.lang.IndexOutOfBoundsException();
+ this._data.setInt16(to, value, this._order === java.nio.ByteOrder.LITTLE_ENDIAN_$LI$());
+ return this;
+ };
+ ByteBuffer.prototype.putShort = function (to, value) {
+ if (((typeof to === 'number') || to === null) && ((typeof value === 'number') || value === null)) {
+ return this.putShort$int$short(to, value);
+ }
+ else if (((typeof to === 'number') || to === null) && value === undefined) {
+ return this.putShort$short(to);
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ ByteBuffer.prototype.slice = function () {
+ return new ByteBuffer(this._buffer, this.isReadOnly());
+ };
+ /**
+ *
+ * @return {number}
+ */
+ ByteBuffer.prototype.hashCode = function () {
+ return java.util.Objects.hash(this._array);
+ };
+ ByteBuffer.wrap$byte_A = function (array) {
+ return ByteBuffer.wrap$byte_A$int$int(array, 0, array.length);
+ };
+ ByteBuffer.wrap$byte_A$int$int = function (array, offset, length) {
+ var buffer = new ArrayBuffer(length);
+ var bytes = new Int8Array(buffer);
+ bytes.set(Int8Array.from((array).slice(offset, offset + length)));
+ return new ByteBuffer(buffer, true);
+ };
+ ByteBuffer.wrap = function (array, offset, length) {
+ if (((array != null && array instanceof Array && (array.length == 0 || array[0] == null || (typeof array[0] === 'number'))) || array === null) && ((typeof offset === 'number') || offset === null) && ((typeof length === 'number') || length === null)) {
+ return java.nio.ByteBuffer.wrap$byte_A$int$int(array, offset, length);
+ }
+ else if (((array != null && array instanceof ArrayBuffer) || array === null) && ((typeof offset === 'number') || offset === null) && ((typeof length === 'number') || length === null)) {
+ return java.nio.ByteBuffer.wrap$def_js_ArrayBuffer$int$double(array, offset, length);
+ }
+ else if (((array != null && array instanceof Array && (array.length == 0 || array[0] == null || (typeof array[0] === 'number'))) || array === null) && offset === undefined && length === undefined) {
+ return java.nio.ByteBuffer.wrap$byte_A(array);
+ }
+ else if (((array != null && array instanceof ArrayBuffer) || array === null) && offset === undefined && length === undefined) {
+ return java.nio.ByteBuffer.wrap$def_js_ArrayBuffer(array);
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ ByteBuffer.wrap$def_js_ArrayBuffer = function (array) {
+ return ByteBuffer.wrap$def_js_ArrayBuffer$int$double(array, 0, array.byteLength);
+ };
+ /*private*/ ByteBuffer.wrap$def_js_ArrayBuffer$int$double = function (array, offset, length) {
+ return new ByteBuffer(array.slice(offset, offset + length), false);
+ };
+ return ByteBuffer;
+ }(java.nio.Buffer));
+ nio.ByteBuffer = ByteBuffer;
+ ByteBuffer["__class"] = "java.nio.ByteBuffer";
+ ByteBuffer["__interfaces"] = ["java.lang.Comparable"];
+ })(nio = java.nio || (java.nio = {}));
+})(java || (java = {}));
+(function (javaemul) {
+ var internal;
+ (function (internal) {
+ /**
+ * Provides Charset implementations.
+ * @param {string} name
+ * @class
+ * @extends java.nio.charset.Charset
+ */
+ var EmulatedCharset = /** @class */ (function (_super) {
+ __extends(EmulatedCharset, _super);
+ function EmulatedCharset(name) {
+ return _super.call(this, name, null) || this;
+ }
+ EmulatedCharset.UTF_8_$LI$ = function () { if (EmulatedCharset.UTF_8 == null) {
+ EmulatedCharset.UTF_8 = new EmulatedCharset.UtfCharset("UTF-8");
+ } return EmulatedCharset.UTF_8; };
+ ;
+ EmulatedCharset.ISO_LATIN_1_$LI$ = function () { if (EmulatedCharset.ISO_LATIN_1 == null) {
+ EmulatedCharset.ISO_LATIN_1 = new EmulatedCharset.LatinCharset("ISO-LATIN-1");
+ } return EmulatedCharset.ISO_LATIN_1; };
+ ;
+ EmulatedCharset.ISO_8859_1_$LI$ = function () { if (EmulatedCharset.ISO_8859_1 == null) {
+ EmulatedCharset.ISO_8859_1 = new EmulatedCharset.LatinCharset("ISO-8859-1");
+ } return EmulatedCharset.ISO_8859_1; };
+ ;
+ return EmulatedCharset;
+ }(java.nio.charset.Charset));
+ internal.EmulatedCharset = EmulatedCharset;
+ EmulatedCharset["__class"] = "javaemul.internal.EmulatedCharset";
+ EmulatedCharset["__interfaces"] = ["java.lang.Comparable"];
+ (function (EmulatedCharset) {
+ var LatinCharset = /** @class */ (function (_super) {
+ __extends(LatinCharset, _super);
+ function LatinCharset(name) {
+ return _super.call(this, name) || this;
+ }
+ /**
+ *
+ * @param {string} str
+ * @return {Array}
+ */
+ LatinCharset.prototype.getBytes = function (str) {
+ var n = str.length;
+ var bytes = (function (s) { var a = []; while (s-- > 0)
+ a.push(0); return a; })(n);
+ for (var i = 0; i < n; ++i) {
+ {
+ bytes[i] = (((function (c) { return c.charCodeAt == null ? c : c.charCodeAt(0); })(str.charAt(i)) & 255) | 0);
+ }
+ ;
+ }
+ return bytes;
+ };
+ /**
+ *
+ * @param {Array} bytes
+ * @param {number} ofs
+ * @param {number} len
+ * @return {Array}
+ */
+ LatinCharset.prototype.decodeString = function (bytes, ofs, len) {
+ var chars = (function (s) { var a = []; while (s-- > 0)
+ a.push(null); return a; })(len);
+ for (var i = 0; i < len; ++i) {
+ {
+ chars[i] = String.fromCharCode((bytes[ofs + i] & 255));
+ }
+ ;
+ }
+ return chars;
+ };
+ return LatinCharset;
+ }(javaemul.internal.EmulatedCharset));
+ EmulatedCharset.LatinCharset = LatinCharset;
+ LatinCharset["__class"] = "javaemul.internal.EmulatedCharset.LatinCharset";
+ LatinCharset["__interfaces"] = ["java.lang.Comparable"];
+ var UtfCharset = /** @class */ (function (_super) {
+ __extends(UtfCharset, _super);
+ function UtfCharset(name) {
+ return _super.call(this, name) || this;
+ }
+ /**
+ *
+ * @param {Array} bytes
+ * @param {number} ofs
+ * @param {number} len
+ * @return {Array}
+ */
+ UtfCharset.prototype.decodeString = function (bytes, ofs, len) {
+ var charCount = 0;
+ for (var i = 0; i < len;) {
+ {
+ ++charCount;
+ var ch = bytes[ofs + i];
+ if ((ch & 192) === 128) {
+ throw new java.lang.IllegalArgumentException("Invalid UTF8 sequence");
+ }
+ else if ((ch & 128) === 0) {
+ ++i;
+ }
+ else if ((ch & 224) === 192) {
+ i += 2;
+ }
+ else if ((ch & 240) === 224) {
+ i += 3;
+ }
+ else if ((ch & 248) === 240) {
+ i += 4;
+ }
+ else {
+ throw new java.lang.IllegalArgumentException("Invalid UTF8 sequence");
+ }
+ if (i > len) {
+ throw new java.lang.IndexOutOfBoundsException("Invalid UTF8 sequence");
+ }
+ }
+ ;
+ }
+ var chars = (function (s) { var a = []; while (s-- > 0)
+ a.push(null); return a; })(charCount);
+ var outIdx = 0;
+ var count = 0;
+ for (var i = 0; i < len;) {
+ {
+ var ch = bytes[ofs + i++];
+ if ((ch & 128) === 0) {
+ count = 1;
+ ch &= 127;
+ }
+ else if ((ch & 224) === 192) {
+ count = 2;
+ ch &= 31;
+ }
+ else if ((ch & 240) === 224) {
+ count = 3;
+ ch &= 15;
+ }
+ else if ((ch & 248) === 240) {
+ count = 4;
+ ch &= 7;
+ }
+ else if ((ch & 252) === 248) {
+ count = 5;
+ ch &= 3;
+ }
+ while ((--count > 0)) {
+ {
+ var b = bytes[ofs + i++];
+ if ((b & 192) !== 128) {
+ throw new java.lang.IllegalArgumentException("Invalid UTF8 sequence at " + (ofs + i - 1) + ", byte=" + javaemul.internal.IntegerHelper.toHexString(b));
+ }
+ ch = (ch << 6) | (b & 63);
+ }
+ }
+ ;
+ outIdx += javaemul.internal.CharacterHelper.toChars$int$char_A$int(ch, chars, outIdx);
+ }
+ ;
+ }
+ return chars;
+ };
+ /**
+ *
+ * @param {string} str
+ * @return {Array}
+ */
+ UtfCharset.prototype.getBytes = function (str) {
+ var n = str.length;
+ var byteCount = 0;
+ for (var i = 0; i < n;) {
+ {
+ var ch = str.charCodeAt(i);
+ i += javaemul.internal.CharacterHelper.charCount(ch);
+ if (ch < (1 << 7)) {
+ byteCount++;
+ }
+ else if (ch < (1 << 11)) {
+ byteCount += 2;
+ }
+ else if (ch < (1 << 16)) {
+ byteCount += 3;
+ }
+ else if (ch < (1 << 21)) {
+ byteCount += 4;
+ }
+ else if (ch < (1 << 26)) {
+ byteCount += 5;
+ }
+ }
+ ;
+ }
+ var bytes = (function (s) { var a = []; while (s-- > 0)
+ a.push(0); return a; })(byteCount);
+ var out = 0;
+ for (var i = 0; i < n;) {
+ {
+ var ch = str.charCodeAt(i);
+ i += javaemul.internal.CharacterHelper.charCount(ch);
+ out += this.encodeUtf8(bytes, out, ch);
+ }
+ ;
+ }
+ return bytes;
+ };
+ /**
+ * Encode a single character in UTF8.
+ *
+ * @param {Array} bytes byte array to store character in
+ * @param {number} ofs offset into byte array to store first byte
+ * @param {number} codePoint character to encode
+ * @return {number} number of bytes consumed by encoding the character
+ * @throws IllegalArgumentException if codepoint >= 2^26
+ * @private
+ */
+ UtfCharset.prototype.encodeUtf8 = function (bytes, ofs, codePoint) {
+ if (codePoint < (1 << 7)) {
+ bytes[ofs] = ((codePoint & 127) | 0);
+ return 1;
+ }
+ else if (codePoint < (1 << 11)) {
+ bytes[ofs++] = ((((codePoint >> 6) & 31) | 192) | 0);
+ bytes[ofs] = (((codePoint & 63) | 128) | 0);
+ return 2;
+ }
+ else if (codePoint < (1 << 16)) {
+ bytes[ofs++] = ((((codePoint >> 12) & 15) | 224) | 0);
+ bytes[ofs++] = ((((codePoint >> 6) & 63) | 128) | 0);
+ bytes[ofs] = (((codePoint & 63) | 128) | 0);
+ return 3;
+ }
+ else if (codePoint < (1 << 21)) {
+ bytes[ofs++] = ((((codePoint >> 18) & 7) | 240) | 0);
+ bytes[ofs++] = ((((codePoint >> 12) & 63) | 128) | 0);
+ bytes[ofs++] = ((((codePoint >> 6) & 63) | 128) | 0);
+ bytes[ofs] = (((codePoint & 63) | 128) | 0);
+ return 4;
+ }
+ else if (codePoint < (1 << 26)) {
+ bytes[ofs++] = ((((codePoint >> 24) & 3) | 248) | 0);
+ bytes[ofs++] = ((((codePoint >> 18) & 63) | 128) | 0);
+ bytes[ofs++] = ((((codePoint >> 12) & 63) | 128) | 0);
+ bytes[ofs++] = ((((codePoint >> 6) & 63) | 128) | 0);
+ bytes[ofs] = (((codePoint & 63) | 128) | 0);
+ return 5;
+ }
+ throw new java.lang.IllegalArgumentException("Character out of range: " + codePoint);
+ };
+ return UtfCharset;
+ }(javaemul.internal.EmulatedCharset));
+ EmulatedCharset.UtfCharset = UtfCharset;
+ UtfCharset["__class"] = "javaemul.internal.EmulatedCharset.UtfCharset";
+ UtfCharset["__interfaces"] = ["java.lang.Comparable"];
+ })(EmulatedCharset = internal.EmulatedCharset || (internal.EmulatedCharset = {}));
+ })(internal = javaemul.internal || (javaemul.internal = {}));
+})(javaemul || (javaemul = {}));
+(function (javaemul) {
+ var internal;
+ (function (internal) {
+ var stream;
+ (function (stream) {
+ var StreamRowSortingCollector = /** @class */ (function (_super) {
+ __extends(StreamRowSortingCollector, _super);
+ function StreamRowSortingCollector(collection, comparator) {
+ var _this = _super.call(this, collection) || this;
+ if (_this.comparator === undefined) {
+ _this.comparator = null;
+ }
+ _this.comparator = (comparator);
+ return _this;
+ }
+ /**
+ *
+ */
+ StreamRowSortingCollector.prototype.end = function () {
+ java.util.Collections.sort$java_util_List$java_util_Comparator(this.collection, (this.comparator));
+ _super.prototype.end.call(this);
+ };
+ return StreamRowSortingCollector;
+ }(javaemul.internal.stream.StreamRowCollector));
+ stream.StreamRowSortingCollector = StreamRowSortingCollector;
+ StreamRowSortingCollector["__class"] = "javaemul.internal.stream.StreamRowSortingCollector";
+ StreamRowSortingCollector["__interfaces"] = ["javaemul.internal.stream.StreamRow"];
+ })(stream = internal.stream || (internal.stream = {}));
+ })(internal = javaemul.internal || (javaemul.internal = {}));
+})(javaemul || (javaemul = {}));
+(function (java) {
+ var util;
+ (function (util) {
+ /**
+ * Skeletal implementation of the Map interface.
+ *
+ * [Sun docs]
+ *
+ * @param ArrayList in terms of
+ * capacity management. There is no speed advantage to pre-allocating array
+ * sizes in JavaScript, so this implementation does not include any of the
+ * capacity and "growth increment" concepts in the standard ArrayList class.
+ * Although ArrayList(int) accepts a value for the initial
+ * capacity of the array, this constructor simply delegates to
+ * ArrayList(). It is only present for compatibility with JDK
+ * 1.5's API.
+ * null indicates
+ * natural ordering should be used.
+ * @return {number} the index of an element with a matching value, or a negative number
+ * which is the index of the next larger value (or just past the end
+ * of the array if the searched value is larger than all elements in
+ * the array) minus 1 (to ensure error returns are negative)
+ * @throws ClassCastException if key and
+ * sortedArray's elements cannot be compared by
+ * comparator.
+ */
+ Arrays.binarySearch = function (sortedArray, key, comparator) {
+ if (((sortedArray != null && sortedArray instanceof Array && (sortedArray.length == 0 || sortedArray[0] == null || (sortedArray[0] != null))) || sortedArray === null) && ((key != null) || key === null) && ((typeof comparator === 'function' && comparator.length === 2) || comparator === null)) {
+ return java.util.Arrays.binarySearch$java_lang_Object_A$java_lang_Object$java_util_Comparator(sortedArray, key, comparator);
+ }
+ else if (((sortedArray != null && sortedArray instanceof Array && (sortedArray.length == 0 || sortedArray[0] == null || (typeof sortedArray[0] === 'number'))) || sortedArray === null) && ((typeof key === 'number') || key === null) && comparator === undefined) {
+ return java.util.Arrays.binarySearch$byte_A$byte(sortedArray, key);
+ }
+ else if (((sortedArray != null && sortedArray instanceof Array && (sortedArray.length == 0 || sortedArray[0] == null || (typeof sortedArray[0] === 'string'))) || sortedArray === null) && ((typeof key === 'string') || key === null) && comparator === undefined) {
+ return java.util.Arrays.binarySearch$char_A$char(sortedArray, key);
+ }
+ else if (((sortedArray != null && sortedArray instanceof Array && (sortedArray.length == 0 || sortedArray[0] == null || (typeof sortedArray[0] === 'number'))) || sortedArray === null) && ((typeof key === 'number') || key === null) && comparator === undefined) {
+ return java.util.Arrays.binarySearch$short_A$short(sortedArray, key);
+ }
+ else if (((sortedArray != null && sortedArray instanceof Array && (sortedArray.length == 0 || sortedArray[0] == null || (typeof sortedArray[0] === 'number'))) || sortedArray === null) && ((typeof key === 'number') || key === null) && comparator === undefined) {
+ return java.util.Arrays.binarySearch$int_A$int(sortedArray, key);
+ }
+ else if (((sortedArray != null && sortedArray instanceof Array && (sortedArray.length == 0 || sortedArray[0] == null || (typeof sortedArray[0] === 'number'))) || sortedArray === null) && ((typeof key === 'number') || key === null) && comparator === undefined) {
+ return java.util.Arrays.binarySearch$long_A$long(sortedArray, key);
+ }
+ else if (((sortedArray != null && sortedArray instanceof Array && (sortedArray.length == 0 || sortedArray[0] == null || (typeof sortedArray[0] === 'number'))) || sortedArray === null) && ((typeof key === 'number') || key === null) && comparator === undefined) {
+ return java.util.Arrays.binarySearch$float_A$float(sortedArray, key);
+ }
+ else if (((sortedArray != null && sortedArray instanceof Array && (sortedArray.length == 0 || sortedArray[0] == null || (typeof sortedArray[0] === 'number'))) || sortedArray === null) && ((typeof key === 'number') || key === null) && comparator === undefined) {
+ return java.util.Arrays.binarySearch$double_A$double(sortedArray, key);
+ }
+ else if (((sortedArray != null && sortedArray instanceof Array && (sortedArray.length == 0 || sortedArray[0] == null || (sortedArray[0] != null))) || sortedArray === null) && ((key != null) || key === null) && comparator === undefined) {
+ return java.util.Arrays.binarySearch$java_lang_Object_A$java_lang_Object(sortedArray, key);
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ Arrays.copyOf$boolean_A$int = function (original, newLength) {
+ javaemul.internal.InternalPreconditions.checkArraySize(newLength);
+ return Arrays.copyOfRange$boolean_A$int$int(original, 0, newLength);
+ };
+ Arrays.copyOf = function (original, newLength) {
+ if (((original != null && original instanceof Array && (original.length == 0 || original[0] == null || (typeof original[0] === 'boolean'))) || original === null) && ((typeof newLength === 'number') || newLength === null)) {
+ return java.util.Arrays.copyOf$boolean_A$int(original, newLength);
+ }
+ else if (((original != null && original instanceof Array && (original.length == 0 || original[0] == null || (typeof original[0] === 'number'))) || original === null) && ((typeof newLength === 'number') || newLength === null)) {
+ return java.util.Arrays.copyOf$byte_A$int(original, newLength);
+ }
+ else if (((original != null && original instanceof Array && (original.length == 0 || original[0] == null || (typeof original[0] === 'string'))) || original === null) && ((typeof newLength === 'number') || newLength === null)) {
+ return java.util.Arrays.copyOf$char_A$int(original, newLength);
+ }
+ else if (((original != null && original instanceof Array && (original.length == 0 || original[0] == null || (typeof original[0] === 'number'))) || original === null) && ((typeof newLength === 'number') || newLength === null)) {
+ return java.util.Arrays.copyOf$double_A$int(original, newLength);
+ }
+ else if (((original != null && original instanceof Array && (original.length == 0 || original[0] == null || (typeof original[0] === 'number'))) || original === null) && ((typeof newLength === 'number') || newLength === null)) {
+ return java.util.Arrays.copyOf$float_A$int(original, newLength);
+ }
+ else if (((original != null && original instanceof Array && (original.length == 0 || original[0] == null || (typeof original[0] === 'number'))) || original === null) && ((typeof newLength === 'number') || newLength === null)) {
+ return java.util.Arrays.copyOf$int_A$int(original, newLength);
+ }
+ else if (((original != null && original instanceof Array && (original.length == 0 || original[0] == null || (typeof original[0] === 'number'))) || original === null) && ((typeof newLength === 'number') || newLength === null)) {
+ return java.util.Arrays.copyOf$long_A$int(original, newLength);
+ }
+ else if (((original != null && original instanceof Array && (original.length == 0 || original[0] == null || (typeof original[0] === 'number'))) || original === null) && ((typeof newLength === 'number') || newLength === null)) {
+ return java.util.Arrays.copyOf$short_A$int(original, newLength);
+ }
+ else if (((original != null && original instanceof Array && (original.length == 0 || original[0] == null || (original[0] != null))) || original === null) && ((typeof newLength === 'number') || newLength === null)) {
+ return java.util.Arrays.copyOf$java_lang_Object_A$int(original, newLength);
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ Arrays.copyOf$byte_A$int = function (original, newLength) {
+ javaemul.internal.InternalPreconditions.checkArraySize(newLength);
+ return Arrays.copyOfRange$byte_A$int$int(original, 0, newLength);
+ };
+ Arrays.copyOf$char_A$int = function (original, newLength) {
+ javaemul.internal.InternalPreconditions.checkArraySize(newLength);
+ return Arrays.copyOfRange$char_A$int$int(original, 0, newLength);
+ };
+ Arrays.copyOf$double_A$int = function (original, newLength) {
+ javaemul.internal.InternalPreconditions.checkArraySize(newLength);
+ return Arrays.copyOfRange$double_A$int$int(original, 0, newLength);
+ };
+ Arrays.copyOf$float_A$int = function (original, newLength) {
+ javaemul.internal.InternalPreconditions.checkArraySize(newLength);
+ return Arrays.copyOfRange$float_A$int$int(original, 0, newLength);
+ };
+ Arrays.copyOf$int_A$int = function (original, newLength) {
+ javaemul.internal.InternalPreconditions.checkArraySize(newLength);
+ return Arrays.copyOfRange$int_A$int$int(original, 0, newLength);
+ };
+ Arrays.copyOf$long_A$int = function (original, newLength) {
+ javaemul.internal.InternalPreconditions.checkArraySize(newLength);
+ return Arrays.copyOfRange$long_A$int$int(original, 0, newLength);
+ };
+ Arrays.copyOf$short_A$int = function (original, newLength) {
+ javaemul.internal.InternalPreconditions.checkArraySize(newLength);
+ return Arrays.copyOfRange$short_A$int$int(original, 0, newLength);
+ };
+ Arrays.copyOf$java_lang_Object_A$int = function (original, newLength) {
+ javaemul.internal.InternalPreconditions.checkArraySize(newLength);
+ javaemul.internal.InternalPreconditions.checkNotNull(original, "original");
+ var clone = javaemul.internal.ArrayHelper.clone(original, 0, newLength);
+ javaemul.internal.ArrayHelper.setLength(clone, newLength);
+ return clone;
+ };
+ Arrays.copyOfRange$boolean_A$int$int = function (original, from, to) {
+ var len = Arrays.getCopyLength(original, from, to);
+ var copy = (function (s) { var a = []; while (s-- > 0)
+ a.push(false); return a; })(to - from);
+ javaemul.internal.ArrayHelper.copy$java_lang_Object$int$java_lang_Object$int$int(original, from, copy, 0, len);
+ return copy;
+ };
+ Arrays.copyOfRange = function (original, from, to) {
+ if (((original != null && original instanceof Array && (original.length == 0 || original[0] == null || (typeof original[0] === 'boolean'))) || original === null) && ((typeof from === 'number') || from === null) && ((typeof to === 'number') || to === null)) {
+ return java.util.Arrays.copyOfRange$boolean_A$int$int(original, from, to);
+ }
+ else if (((original != null && original instanceof Array && (original.length == 0 || original[0] == null || (typeof original[0] === 'number'))) || original === null) && ((typeof from === 'number') || from === null) && ((typeof to === 'number') || to === null)) {
+ return java.util.Arrays.copyOfRange$byte_A$int$int(original, from, to);
+ }
+ else if (((original != null && original instanceof Array && (original.length == 0 || original[0] == null || (typeof original[0] === 'string'))) || original === null) && ((typeof from === 'number') || from === null) && ((typeof to === 'number') || to === null)) {
+ return java.util.Arrays.copyOfRange$char_A$int$int(original, from, to);
+ }
+ else if (((original != null && original instanceof Array && (original.length == 0 || original[0] == null || (typeof original[0] === 'number'))) || original === null) && ((typeof from === 'number') || from === null) && ((typeof to === 'number') || to === null)) {
+ return java.util.Arrays.copyOfRange$double_A$int$int(original, from, to);
+ }
+ else if (((original != null && original instanceof Array && (original.length == 0 || original[0] == null || (typeof original[0] === 'number'))) || original === null) && ((typeof from === 'number') || from === null) && ((typeof to === 'number') || to === null)) {
+ return java.util.Arrays.copyOfRange$float_A$int$int(original, from, to);
+ }
+ else if (((original != null && original instanceof Array && (original.length == 0 || original[0] == null || (typeof original[0] === 'number'))) || original === null) && ((typeof from === 'number') || from === null) && ((typeof to === 'number') || to === null)) {
+ return java.util.Arrays.copyOfRange$int_A$int$int(original, from, to);
+ }
+ else if (((original != null && original instanceof Array && (original.length == 0 || original[0] == null || (typeof original[0] === 'number'))) || original === null) && ((typeof from === 'number') || from === null) && ((typeof to === 'number') || to === null)) {
+ return java.util.Arrays.copyOfRange$long_A$int$int(original, from, to);
+ }
+ else if (((original != null && original instanceof Array && (original.length == 0 || original[0] == null || (typeof original[0] === 'number'))) || original === null) && ((typeof from === 'number') || from === null) && ((typeof to === 'number') || to === null)) {
+ return java.util.Arrays.copyOfRange$short_A$int$int(original, from, to);
+ }
+ else if (((original != null && original instanceof Array && (original.length == 0 || original[0] == null || (original[0] != null))) || original === null) && ((typeof from === 'number') || from === null) && ((typeof to === 'number') || to === null)) {
+ return java.util.Arrays.copyOfRange$java_lang_Object_A$int$int(original, from, to);
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ Arrays.copyOfRange$byte_A$int$int = function (original, from, to) {
+ var len = Arrays.getCopyLength(original, from, to);
+ var copy = (function (s) { var a = []; while (s-- > 0)
+ a.push(0); return a; })(to - from);
+ javaemul.internal.ArrayHelper.copy$java_lang_Object$int$java_lang_Object$int$int(original, from, copy, 0, len);
+ return copy;
+ };
+ Arrays.copyOfRange$char_A$int$int = function (original, from, to) {
+ var len = Arrays.getCopyLength(original, from, to);
+ var copy = (function (s) { var a = []; while (s-- > 0)
+ a.push(null); return a; })(to - from);
+ javaemul.internal.ArrayHelper.copy$java_lang_Object$int$java_lang_Object$int$int(original, from, copy, 0, len);
+ return copy;
+ };
+ Arrays.copyOfRange$double_A$int$int = function (original, from, to) {
+ var len = Arrays.getCopyLength(original, from, to);
+ var copy = (function (s) { var a = []; while (s-- > 0)
+ a.push(0); return a; })(to - from);
+ javaemul.internal.ArrayHelper.copy$java_lang_Object$int$java_lang_Object$int$int(original, from, copy, 0, len);
+ return copy;
+ };
+ Arrays.copyOfRange$float_A$int$int = function (original, from, to) {
+ var len = Arrays.getCopyLength(original, from, to);
+ var copy = (function (s) { var a = []; while (s-- > 0)
+ a.push(0); return a; })(to - from);
+ javaemul.internal.ArrayHelper.copy$java_lang_Object$int$java_lang_Object$int$int(original, from, copy, 0, len);
+ return copy;
+ };
+ Arrays.copyOfRange$int_A$int$int = function (original, from, to) {
+ var len = Arrays.getCopyLength(original, from, to);
+ var copy = (function (s) { var a = []; while (s-- > 0)
+ a.push(0); return a; })(to - from);
+ javaemul.internal.ArrayHelper.copy$java_lang_Object$int$java_lang_Object$int$int(original, from, copy, 0, len);
+ return copy;
+ };
+ Arrays.copyOfRange$long_A$int$int = function (original, from, to) {
+ var len = Arrays.getCopyLength(original, from, to);
+ var copy = (function (s) { var a = []; while (s-- > 0)
+ a.push(0); return a; })(to - from);
+ javaemul.internal.ArrayHelper.copy$java_lang_Object$int$java_lang_Object$int$int(original, from, copy, 0, len);
+ return copy;
+ };
+ Arrays.copyOfRange$short_A$int$int = function (original, from, to) {
+ var len = Arrays.getCopyLength(original, from, to);
+ var copy = (function (s) { var a = []; while (s-- > 0)
+ a.push(0); return a; })(to - from);
+ javaemul.internal.ArrayHelper.copy$java_lang_Object$int$java_lang_Object$int$int(original, from, copy, 0, len);
+ return copy;
+ };
+ Arrays.copyOfRange$java_lang_Object_A$int$int = function (original, from, to) {
+ var len = Arrays.getCopyLength(original, from, to);
+ var copy = javaemul.internal.ArrayHelper.createFrom(original, to - from);
+ javaemul.internal.ArrayHelper.copy$java_lang_Object$int$java_lang_Object$int$int(original, from, copy, 0, len);
+ return copy;
+ };
+ Arrays.deepEquals = function (a1, a2) {
+ if (a1 === a2) {
+ return true;
+ }
+ if (a1 == null || a2 == null) {
+ return false;
+ }
+ if (a1.length !== a2.length) {
+ return false;
+ }
+ for (var i = 0, n = a1.length; i < n; ++i) {
+ {
+ if (!java.util.Objects.deepEquals(a1[i], a2[i])) {
+ return false;
+ }
+ }
+ ;
+ }
+ return true;
+ };
+ Arrays.deepHashCode = function (a) {
+ if (a == null) {
+ return 0;
+ }
+ var hashCode = 1;
+ for (var index154 = 0; index154 < a.length; index154++) {
+ var obj = a[index154];
+ {
+ var hash = void 0;
+ if (obj != null && obj instanceof Array && (obj.length == 0 || obj[0] == null || obj[0] != null)) {
+ hash = Arrays.deepHashCode(obj);
+ }
+ else if (obj != null && obj instanceof Array && (obj.length == 0 || obj[0] == null || typeof obj[0] === 'boolean')) {
+ hash = Arrays.hashCode$boolean_A(obj);
+ }
+ else if (obj != null && obj instanceof Array && (obj.length == 0 || obj[0] == null || typeof obj[0] === 'number')) {
+ hash = Arrays.hashCode$byte_A(obj);
+ }
+ else if (obj != null && obj instanceof Array && (obj.length == 0 || obj[0] == null || typeof obj[0] === 'string')) {
+ hash = Arrays.hashCode$char_A(obj);
+ }
+ else if (obj != null && obj instanceof Array && (obj.length == 0 || obj[0] == null || typeof obj[0] === 'number')) {
+ hash = Arrays.hashCode$short_A(obj);
+ }
+ else if (obj != null && obj instanceof Array && (obj.length == 0 || obj[0] == null || typeof obj[0] === 'number')) {
+ hash = Arrays.hashCode$int_A(obj);
+ }
+ else if (obj != null && obj instanceof Array && (obj.length == 0 || obj[0] == null || typeof obj[0] === 'number')) {
+ hash = Arrays.hashCode$long_A(obj);
+ }
+ else if (obj != null && obj instanceof Array && (obj.length == 0 || obj[0] == null || typeof obj[0] === 'number')) {
+ hash = Arrays.hashCode$float_A(obj);
+ }
+ else if (obj != null && obj instanceof Array && (obj.length == 0 || obj[0] == null || typeof obj[0] === 'number')) {
+ hash = Arrays.hashCode$double_A(obj);
+ }
+ else {
+ hash = java.util.Objects.hashCode(obj);
+ }
+ hashCode = 31 * hashCode + hash;
+ hashCode = javaemul.internal.Coercions.ensureInt(hashCode);
+ }
+ }
+ return hashCode;
+ };
+ Arrays.deepToString$java_lang_Object_A = function (a) {
+ return Arrays.deepToString$java_lang_Object_A$java_util_Set(a, (new java.util.HashSet()));
+ };
+ Arrays.equals$boolean_A$boolean_A = function (array1, array2) {
+ if (array1 === array2) {
+ return true;
+ }
+ if (array1 == null || array2 == null) {
+ return false;
+ }
+ if (array1.length !== array2.length) {
+ return false;
+ }
+ for (var i = 0; i < array1.length; ++i) {
+ {
+ if (array1[i] !== array2[i]) {
+ return false;
+ }
+ }
+ ;
+ }
+ return true;
+ };
+ Arrays.equals = function (array1, array2) {
+ if (((array1 != null && array1 instanceof Array && (array1.length == 0 || array1[0] == null || (typeof array1[0] === 'boolean'))) || array1 === null) && ((array2 != null && array2 instanceof Array && (array2.length == 0 || array2[0] == null || (typeof array2[0] === 'boolean'))) || array2 === null)) {
+ return java.util.Arrays.equals$boolean_A$boolean_A(array1, array2);
+ }
+ else if (((array1 != null && array1 instanceof Array && (array1.length == 0 || array1[0] == null || (typeof array1[0] === 'number'))) || array1 === null) && ((array2 != null && array2 instanceof Array && (array2.length == 0 || array2[0] == null || (typeof array2[0] === 'number'))) || array2 === null)) {
+ return java.util.Arrays.equals$byte_A$byte_A(array1, array2);
+ }
+ else if (((array1 != null && array1 instanceof Array && (array1.length == 0 || array1[0] == null || (typeof array1[0] === 'string'))) || array1 === null) && ((array2 != null && array2 instanceof Array && (array2.length == 0 || array2[0] == null || (typeof array2[0] === 'string'))) || array2 === null)) {
+ return java.util.Arrays.equals$char_A$char_A(array1, array2);
+ }
+ else if (((array1 != null && array1 instanceof Array && (array1.length == 0 || array1[0] == null || (typeof array1[0] === 'number'))) || array1 === null) && ((array2 != null && array2 instanceof Array && (array2.length == 0 || array2[0] == null || (typeof array2[0] === 'number'))) || array2 === null)) {
+ return java.util.Arrays.equals$double_A$double_A(array1, array2);
+ }
+ else if (((array1 != null && array1 instanceof Array && (array1.length == 0 || array1[0] == null || (typeof array1[0] === 'number'))) || array1 === null) && ((array2 != null && array2 instanceof Array && (array2.length == 0 || array2[0] == null || (typeof array2[0] === 'number'))) || array2 === null)) {
+ return java.util.Arrays.equals$float_A$float_A(array1, array2);
+ }
+ else if (((array1 != null && array1 instanceof Array && (array1.length == 0 || array1[0] == null || (typeof array1[0] === 'number'))) || array1 === null) && ((array2 != null && array2 instanceof Array && (array2.length == 0 || array2[0] == null || (typeof array2[0] === 'number'))) || array2 === null)) {
+ return java.util.Arrays.equals$int_A$int_A(array1, array2);
+ }
+ else if (((array1 != null && array1 instanceof Array && (array1.length == 0 || array1[0] == null || (typeof array1[0] === 'number'))) || array1 === null) && ((array2 != null && array2 instanceof Array && (array2.length == 0 || array2[0] == null || (typeof array2[0] === 'number'))) || array2 === null)) {
+ return java.util.Arrays.equals$long_A$long_A(array1, array2);
+ }
+ else if (((array1 != null && array1 instanceof Array && (array1.length == 0 || array1[0] == null || (array1[0] != null))) || array1 === null) && ((array2 != null && array2 instanceof Array && (array2.length == 0 || array2[0] == null || (array2[0] != null))) || array2 === null)) {
+ return java.util.Arrays.equals$java_lang_Object_A$java_lang_Object_A(array1, array2);
+ }
+ else if (((array1 != null && array1 instanceof Array && (array1.length == 0 || array1[0] == null || (typeof array1[0] === 'number'))) || array1 === null) && ((array2 != null && array2 instanceof Array && (array2.length == 0 || array2[0] == null || (typeof array2[0] === 'number'))) || array2 === null)) {
+ return java.util.Arrays.equals$short_A$short_A(array1, array2);
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ Arrays.equals$byte_A$byte_A = function (array1, array2) {
+ if (array1 === array2) {
+ return true;
+ }
+ if (array1 == null || array2 == null) {
+ return false;
+ }
+ if (array1.length !== array2.length) {
+ return false;
+ }
+ for (var i = 0; i < array1.length; ++i) {
+ {
+ if (array1[i] !== array2[i]) {
+ return false;
+ }
+ }
+ ;
+ }
+ return true;
+ };
+ Arrays.equals$char_A$char_A = function (array1, array2) {
+ if (array1 === array2) {
+ return true;
+ }
+ if (array1 == null || array2 == null) {
+ return false;
+ }
+ if (array1.length !== array2.length) {
+ return false;
+ }
+ for (var i = 0; i < array1.length; ++i) {
+ {
+ if ((function (c) { return c.charCodeAt == null ? c : c.charCodeAt(0); })(array1[i]) != (function (c) { return c.charCodeAt == null ? c : c.charCodeAt(0); })(array2[i])) {
+ return false;
+ }
+ }
+ ;
+ }
+ return true;
+ };
+ Arrays.equals$double_A$double_A = function (array1, array2) {
+ if (array1 === array2) {
+ return true;
+ }
+ if (array1 == null || array2 == null) {
+ return false;
+ }
+ if (array1.length !== array2.length) {
+ return false;
+ }
+ for (var i = 0; i < array1.length; ++i) {
+ {
+ if (array1[i] !== array2[i]) {
+ return false;
+ }
+ }
+ ;
+ }
+ return true;
+ };
+ Arrays.equals$float_A$float_A = function (array1, array2) {
+ if (array1 === array2) {
+ return true;
+ }
+ if (array1 == null || array2 == null) {
+ return false;
+ }
+ if (array1.length !== array2.length) {
+ return false;
+ }
+ for (var i = 0; i < array1.length; ++i) {
+ {
+ if (array1[i] !== array2[i]) {
+ return false;
+ }
+ }
+ ;
+ }
+ return true;
+ };
+ Arrays.equals$int_A$int_A = function (array1, array2) {
+ if (array1 === array2) {
+ return true;
+ }
+ if (array1 == null || array2 == null) {
+ return false;
+ }
+ if (array1.length !== array2.length) {
+ return false;
+ }
+ for (var i = 0; i < array1.length; ++i) {
+ {
+ if (array1[i] !== array2[i]) {
+ return false;
+ }
+ }
+ ;
+ }
+ return true;
+ };
+ Arrays.equals$long_A$long_A = function (array1, array2) {
+ if (array1 === array2) {
+ return true;
+ }
+ if (array1 == null || array2 == null) {
+ return false;
+ }
+ if (array1.length !== array2.length) {
+ return false;
+ }
+ for (var i = 0; i < array1.length; ++i) {
+ {
+ if (array1[i] !== array2[i]) {
+ return false;
+ }
+ }
+ ;
+ }
+ return true;
+ };
+ Arrays.equals$java_lang_Object_A$java_lang_Object_A = function (array1, array2) {
+ if (array1 === array2) {
+ return true;
+ }
+ if (array1 == null || array2 == null) {
+ return false;
+ }
+ if (array1.length !== array2.length) {
+ return false;
+ }
+ for (var i = 0; i < array1.length; ++i) {
+ {
+ var val1 = array1[i];
+ var val2 = array2[i];
+ if (!java.util.Objects.equals(val1, val2)) {
+ return false;
+ }
+ }
+ ;
+ }
+ return true;
+ };
+ Arrays.equals$short_A$short_A = function (array1, array2) {
+ if (array1 === array2) {
+ return true;
+ }
+ if (array1 == null || array2 == null) {
+ return false;
+ }
+ if (array1.length !== array2.length) {
+ return false;
+ }
+ for (var i = 0; i < array1.length; ++i) {
+ {
+ if (array1[i] !== array2[i]) {
+ return false;
+ }
+ }
+ ;
+ }
+ return true;
+ };
+ Arrays.fill$boolean_A$boolean = function (a, val) {
+ Arrays.fill$boolean_A$int$int$boolean(a, 0, a.length, val);
+ };
+ Arrays.fill$boolean_A$int$int$boolean = function (a, fromIndex, toIndex, val) {
+ for (var i = fromIndex; i < toIndex; ++i) {
+ {
+ a[i] = val;
+ }
+ ;
+ }
+ };
+ Arrays.fill = function (a, fromIndex, toIndex, val) {
+ if (((a != null && a instanceof Array && (a.length == 0 || a[0] == null || (typeof a[0] === 'boolean'))) || a === null) && ((typeof fromIndex === 'number') || fromIndex === null) && ((typeof toIndex === 'number') || toIndex === null) && ((typeof val === 'boolean') || val === null)) {
+ return java.util.Arrays.fill$boolean_A$int$int$boolean(a, fromIndex, toIndex, val);
+ }
+ else if (((a != null && a instanceof Array && (a.length == 0 || a[0] == null || (typeof a[0] === 'number'))) || a === null) && ((typeof fromIndex === 'number') || fromIndex === null) && ((typeof toIndex === 'number') || toIndex === null) && ((typeof val === 'number') || val === null)) {
+ return java.util.Arrays.fill$byte_A$int$int$byte(a, fromIndex, toIndex, val);
+ }
+ else if (((a != null && a instanceof Array && (a.length == 0 || a[0] == null || (typeof a[0] === 'string'))) || a === null) && ((typeof fromIndex === 'number') || fromIndex === null) && ((typeof toIndex === 'number') || toIndex === null) && ((typeof val === 'string') || val === null)) {
+ return java.util.Arrays.fill$char_A$int$int$char(a, fromIndex, toIndex, val);
+ }
+ else if (((a != null && a instanceof Array && (a.length == 0 || a[0] == null || (typeof a[0] === 'number'))) || a === null) && ((typeof fromIndex === 'number') || fromIndex === null) && ((typeof toIndex === 'number') || toIndex === null) && ((typeof val === 'number') || val === null)) {
+ return java.util.Arrays.fill$short_A$int$int$short(a, fromIndex, toIndex, val);
+ }
+ else if (((a != null && a instanceof Array && (a.length == 0 || a[0] == null || (typeof a[0] === 'number'))) || a === null) && ((typeof fromIndex === 'number') || fromIndex === null) && ((typeof toIndex === 'number') || toIndex === null) && ((typeof val === 'number') || val === null)) {
+ return java.util.Arrays.fill$int_A$int$int$int(a, fromIndex, toIndex, val);
+ }
+ else if (((a != null && a instanceof Array && (a.length == 0 || a[0] == null || (typeof a[0] === 'number'))) || a === null) && ((typeof fromIndex === 'number') || fromIndex === null) && ((typeof toIndex === 'number') || toIndex === null) && ((typeof val === 'number') || val === null)) {
+ return java.util.Arrays.fill$long_A$int$int$long(a, fromIndex, toIndex, val);
+ }
+ else if (((a != null && a instanceof Array && (a.length == 0 || a[0] == null || (typeof a[0] === 'number'))) || a === null) && ((typeof fromIndex === 'number') || fromIndex === null) && ((typeof toIndex === 'number') || toIndex === null) && ((typeof val === 'number') || val === null)) {
+ return java.util.Arrays.fill$float_A$int$int$float(a, fromIndex, toIndex, val);
+ }
+ else if (((a != null && a instanceof Array && (a.length == 0 || a[0] == null || (typeof a[0] === 'number'))) || a === null) && ((typeof fromIndex === 'number') || fromIndex === null) && ((typeof toIndex === 'number') || toIndex === null) && ((typeof val === 'number') || val === null)) {
+ return java.util.Arrays.fill$double_A$int$int$double(a, fromIndex, toIndex, val);
+ }
+ else if (((a != null && a instanceof Array && (a.length == 0 || a[0] == null || (a[0] != null))) || a === null) && ((typeof fromIndex === 'number') || fromIndex === null) && ((typeof toIndex === 'number') || toIndex === null) && ((val != null) || val === null)) {
+ return java.util.Arrays.fill$java_lang_Object_A$int$int$java_lang_Object(a, fromIndex, toIndex, val);
+ }
+ else if (((a != null && a instanceof Array && (a.length == 0 || a[0] == null || (typeof a[0] === 'boolean'))) || a === null) && ((typeof fromIndex === 'boolean') || fromIndex === null) && toIndex === undefined && val === undefined) {
+ return java.util.Arrays.fill$boolean_A$boolean(a, fromIndex);
+ }
+ else if (((a != null && a instanceof Array && (a.length == 0 || a[0] == null || (typeof a[0] === 'number'))) || a === null) && ((typeof fromIndex === 'number') || fromIndex === null) && toIndex === undefined && val === undefined) {
+ return java.util.Arrays.fill$byte_A$byte(a, fromIndex);
+ }
+ else if (((a != null && a instanceof Array && (a.length == 0 || a[0] == null || (typeof a[0] === 'string'))) || a === null) && ((typeof fromIndex === 'string') || fromIndex === null) && toIndex === undefined && val === undefined) {
+ return java.util.Arrays.fill$char_A$char(a, fromIndex);
+ }
+ else if (((a != null && a instanceof Array && (a.length == 0 || a[0] == null || (typeof a[0] === 'number'))) || a === null) && ((typeof fromIndex === 'number') || fromIndex === null) && toIndex === undefined && val === undefined) {
+ return java.util.Arrays.fill$short_A$short(a, fromIndex);
+ }
+ else if (((a != null && a instanceof Array && (a.length == 0 || a[0] == null || (typeof a[0] === 'number'))) || a === null) && ((typeof fromIndex === 'number') || fromIndex === null) && toIndex === undefined && val === undefined) {
+ return java.util.Arrays.fill$int_A$int(a, fromIndex);
+ }
+ else if (((a != null && a instanceof Array && (a.length == 0 || a[0] == null || (typeof a[0] === 'number'))) || a === null) && ((typeof fromIndex === 'number') || fromIndex === null) && toIndex === undefined && val === undefined) {
+ return java.util.Arrays.fill$long_A$long(a, fromIndex);
+ }
+ else if (((a != null && a instanceof Array && (a.length == 0 || a[0] == null || (typeof a[0] === 'number'))) || a === null) && ((typeof fromIndex === 'number') || fromIndex === null) && toIndex === undefined && val === undefined) {
+ return java.util.Arrays.fill$float_A$float(a, fromIndex);
+ }
+ else if (((a != null && a instanceof Array && (a.length == 0 || a[0] == null || (typeof a[0] === 'number'))) || a === null) && ((typeof fromIndex === 'number') || fromIndex === null) && toIndex === undefined && val === undefined) {
+ return java.util.Arrays.fill$double_A$double(a, fromIndex);
+ }
+ else if (((a != null && a instanceof Array && (a.length == 0 || a[0] == null || (a[0] != null))) || a === null) && ((fromIndex != null) || fromIndex === null) && toIndex === undefined && val === undefined) {
+ return java.util.Arrays.fill$java_lang_Object_A$java_lang_Object(a, fromIndex);
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ Arrays.fill$byte_A$byte = function (a, val) {
+ Arrays.fill$byte_A$int$int$byte(a, 0, a.length, val);
+ };
+ Arrays.fill$byte_A$int$int$byte = function (a, fromIndex, toIndex, val) {
+ for (var i = fromIndex; i < toIndex; ++i) {
+ {
+ a[i] = val;
+ }
+ ;
+ }
+ };
+ Arrays.fill$char_A$char = function (a, val) {
+ Arrays.fill$char_A$int$int$char(a, 0, a.length, val);
+ };
+ Arrays.fill$char_A$int$int$char = function (a, fromIndex, toIndex, val) {
+ for (var i = fromIndex; i < toIndex; ++i) {
+ {
+ a[i] = val;
+ }
+ ;
+ }
+ };
+ Arrays.fill$double_A$double = function (a, val) {
+ Arrays.fill$double_A$int$int$double(a, 0, a.length, val);
+ };
+ Arrays.fill$double_A$int$int$double = function (a, fromIndex, toIndex, val) {
+ for (var i = fromIndex; i < toIndex; ++i) {
+ {
+ a[i] = val;
+ }
+ ;
+ }
+ };
+ Arrays.fill$float_A$float = function (a, val) {
+ Arrays.fill$float_A$int$int$float(a, 0, a.length, val);
+ };
+ Arrays.fill$float_A$int$int$float = function (a, fromIndex, toIndex, val) {
+ for (var i = fromIndex; i < toIndex; ++i) {
+ {
+ a[i] = val;
+ }
+ ;
+ }
+ };
+ Arrays.fill$int_A$int = function (a, val) {
+ Arrays.fill$int_A$int$int$int(a, 0, a.length, val);
+ };
+ Arrays.fill$int_A$int$int$int = function (a, fromIndex, toIndex, val) {
+ for (var i = fromIndex; i < toIndex; ++i) {
+ {
+ a[i] = val;
+ }
+ ;
+ }
+ };
+ Arrays.fill$long_A$int$int$long = function (a, fromIndex, toIndex, val) {
+ for (var i = fromIndex; i < toIndex; ++i) {
+ {
+ a[i] = val;
+ }
+ ;
+ }
+ };
+ Arrays.fill$long_A$long = function (a, val) {
+ Arrays.fill$long_A$int$int$long(a, 0, a.length, val);
+ };
+ Arrays.fill$java_lang_Object_A$int$int$java_lang_Object = function (a, fromIndex, toIndex, val) {
+ for (var i = fromIndex; i < toIndex; ++i) {
+ {
+ a[i] = val;
+ }
+ ;
+ }
+ };
+ Arrays.fill$java_lang_Object_A$java_lang_Object = function (a, val) {
+ Arrays.fill$java_lang_Object_A$int$int$java_lang_Object(a, 0, a.length, val);
+ };
+ Arrays.fill$short_A$int$int$short = function (a, fromIndex, toIndex, val) {
+ for (var i = fromIndex; i < toIndex; ++i) {
+ {
+ a[i] = val;
+ }
+ ;
+ }
+ };
+ Arrays.fill$short_A$short = function (a, val) {
+ Arrays.fill$short_A$int$int$short(a, 0, a.length, val);
+ };
+ Arrays.hashCode$boolean_A = function (a) {
+ if (a == null) {
+ return 0;
+ }
+ var hashCode = 1;
+ for (var index155 = 0; index155 < a.length; index155++) {
+ var e = a[index155];
+ {
+ hashCode = 31 * hashCode + javaemul.internal.BooleanHelper.hashCode(e);
+ hashCode = javaemul.internal.Coercions.ensureInt(hashCode);
+ }
+ }
+ return hashCode;
+ };
+ Arrays.hashCode = function (a) {
+ if (((a != null && a instanceof Array && (a.length == 0 || a[0] == null || (typeof a[0] === 'boolean'))) || a === null)) {
+ return java.util.Arrays.hashCode$boolean_A(a);
+ }
+ else if (((a != null && a instanceof Array && (a.length == 0 || a[0] == null || (typeof a[0] === 'number'))) || a === null)) {
+ return java.util.Arrays.hashCode$byte_A(a);
+ }
+ else if (((a != null && a instanceof Array && (a.length == 0 || a[0] == null || (typeof a[0] === 'string'))) || a === null)) {
+ return java.util.Arrays.hashCode$char_A(a);
+ }
+ else if (((a != null && a instanceof Array && (a.length == 0 || a[0] == null || (typeof a[0] === 'number'))) || a === null)) {
+ return java.util.Arrays.hashCode$double_A(a);
+ }
+ else if (((a != null && a instanceof Array && (a.length == 0 || a[0] == null || (typeof a[0] === 'number'))) || a === null)) {
+ return java.util.Arrays.hashCode$float_A(a);
+ }
+ else if (((a != null && a instanceof Array && (a.length == 0 || a[0] == null || (typeof a[0] === 'number'))) || a === null)) {
+ return java.util.Arrays.hashCode$int_A(a);
+ }
+ else if (((a != null && a instanceof Array && (a.length == 0 || a[0] == null || (typeof a[0] === 'number'))) || a === null)) {
+ return java.util.Arrays.hashCode$long_A(a);
+ }
+ else if (((a != null && a instanceof Array && (a.length == 0 || a[0] == null || (a[0] != null))) || a === null)) {
+ return java.util.Arrays.hashCode$java_lang_Object_A(a);
+ }
+ else if (((a != null && a instanceof Array && (a.length == 0 || a[0] == null || (typeof a[0] === 'number'))) || a === null)) {
+ return java.util.Arrays.hashCode$short_A(a);
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ Arrays.hashCode$byte_A = function (a) {
+ if (a == null) {
+ return 0;
+ }
+ var hashCode = 1;
+ for (var index156 = 0; index156 < a.length; index156++) {
+ var e = a[index156];
+ {
+ hashCode = 31 * hashCode + javaemul.internal.ByteHelper.hashCode(e);
+ hashCode = javaemul.internal.Coercions.ensureInt(hashCode);
+ }
+ }
+ return hashCode;
+ };
+ Arrays.hashCode$char_A = function (a) {
+ if (a == null) {
+ return 0;
+ }
+ var hashCode = 1;
+ for (var index157 = 0; index157 < a.length; index157++) {
+ var e = a[index157];
+ {
+ hashCode = 31 * hashCode + javaemul.internal.CharacterHelper.hashCode(e);
+ hashCode = javaemul.internal.Coercions.ensureInt(hashCode);
+ }
+ }
+ return hashCode;
+ };
+ Arrays.hashCode$double_A = function (a) {
+ if (a == null) {
+ return 0;
+ }
+ var hashCode = 1;
+ for (var index158 = 0; index158 < a.length; index158++) {
+ var e = a[index158];
+ {
+ hashCode = 31 * hashCode + javaemul.internal.DoubleHelper.hashCode(e);
+ hashCode = javaemul.internal.Coercions.ensureInt(hashCode);
+ }
+ }
+ return hashCode;
+ };
+ Arrays.hashCode$float_A = function (a) {
+ if (a == null) {
+ return 0;
+ }
+ var hashCode = 1;
+ for (var index159 = 0; index159 < a.length; index159++) {
+ var e = a[index159];
+ {
+ hashCode = 31 * hashCode + javaemul.internal.FloatHelper.hashCode(e);
+ hashCode = javaemul.internal.Coercions.ensureInt(hashCode);
+ }
+ }
+ return hashCode;
+ };
+ Arrays.hashCode$int_A = function (a) {
+ if (a == null) {
+ return 0;
+ }
+ var hashCode = 1;
+ for (var index160 = 0; index160 < a.length; index160++) {
+ var e = a[index160];
+ {
+ hashCode = 31 * hashCode + javaemul.internal.IntegerHelper.hashCode(e);
+ hashCode = javaemul.internal.Coercions.ensureInt(hashCode);
+ }
+ }
+ return hashCode;
+ };
+ Arrays.hashCode$long_A = function (a) {
+ if (a == null) {
+ return 0;
+ }
+ var hashCode = 1;
+ for (var index161 = 0; index161 < a.length; index161++) {
+ var e = a[index161];
+ {
+ hashCode = 31 * hashCode + javaemul.internal.LongHelper.hashCode(e);
+ hashCode = javaemul.internal.Coercions.ensureInt(hashCode);
+ }
+ }
+ return hashCode;
+ };
+ Arrays.hashCode$java_lang_Object_A = function (a) {
+ if (a == null) {
+ return 0;
+ }
+ var hashCode = 1;
+ for (var index162 = 0; index162 < a.length; index162++) {
+ var e = a[index162];
+ {
+ hashCode = 31 * hashCode + java.util.Objects.hashCode(e);
+ hashCode = javaemul.internal.Coercions.ensureInt(hashCode);
+ }
+ }
+ return hashCode;
+ };
+ Arrays.hashCode$short_A = function (a) {
+ if (a == null) {
+ return 0;
+ }
+ var hashCode = 1;
+ for (var index163 = 0; index163 < a.length; index163++) {
+ var e = a[index163];
+ {
+ hashCode = 31 * hashCode + javaemul.internal.ShortHelper.hashCode(e);
+ hashCode = javaemul.internal.Coercions.ensureInt(hashCode);
+ }
+ }
+ return hashCode;
+ };
+ Arrays.sort$byte_A = function (array) {
+ Arrays.nativeNumberSort$java_lang_Object(array);
+ };
+ Arrays.sort$byte_A$int$int = function (array, fromIndex, toIndex) {
+ javaemul.internal.InternalPreconditions.checkPositionIndexes(fromIndex, toIndex, array.length);
+ Arrays.nativeNumberSort$java_lang_Object$int$int(array, fromIndex, toIndex);
+ };
+ Arrays.sort$char_A = function (array) {
+ Arrays.nativeNumberSort$java_lang_Object(array);
+ };
+ Arrays.sort$char_A$int$int = function (array, fromIndex, toIndex) {
+ javaemul.internal.InternalPreconditions.checkPositionIndexes(fromIndex, toIndex, array.length);
+ Arrays.nativeNumberSort$java_lang_Object$int$int(array, fromIndex, toIndex);
+ };
+ Arrays.sort$double_A = function (array) {
+ Arrays.nativeNumberSort$java_lang_Object(array);
+ };
+ Arrays.sort$double_A$int$int = function (array, fromIndex, toIndex) {
+ javaemul.internal.InternalPreconditions.checkPositionIndexes(fromIndex, toIndex, array.length);
+ Arrays.nativeNumberSort$java_lang_Object$int$int(array, fromIndex, toIndex);
+ };
+ Arrays.sort$float_A = function (array) {
+ Arrays.nativeNumberSort$java_lang_Object(array);
+ };
+ Arrays.sort$float_A$int$int = function (array, fromIndex, toIndex) {
+ javaemul.internal.InternalPreconditions.checkPositionIndexes(fromIndex, toIndex, array.length);
+ Arrays.nativeNumberSort$java_lang_Object$int$int(array, fromIndex, toIndex);
+ };
+ Arrays.sort$int_A = function (array) {
+ Arrays.nativeNumberSort$java_lang_Object(array);
+ };
+ Arrays.sort$int_A$int$int = function (array, fromIndex, toIndex) {
+ javaemul.internal.InternalPreconditions.checkPositionIndexes(fromIndex, toIndex, array.length);
+ Arrays.nativeNumberSort$java_lang_Object$int$int(array, fromIndex, toIndex);
+ };
+ Arrays.sort$long_A = function (array) {
+ Arrays.nativeLongSort$java_lang_Object$java_lang_Object(array, javaemul.internal.LongCompareHolder.getLongComparator());
+ };
+ Arrays.sort$long_A$int$int = function (array, fromIndex, toIndex) {
+ javaemul.internal.InternalPreconditions.checkPositionIndexes(fromIndex, toIndex, array.length);
+ Arrays.nativeLongSort$java_lang_Object$int$int(array, fromIndex, toIndex);
+ };
+ Arrays.sort$java_lang_Object_A = function (array) {
+ Arrays.mergeSort$java_lang_Object_A$int$int$java_util_Comparator(array, 0, array.length, (java.util.Comparators.natural()));
+ };
+ Arrays.sort$java_lang_Object_A$int$int = function (x, fromIndex, toIndex) {
+ Arrays.mergeSort$java_lang_Object_A$int$int$java_util_Comparator(x, fromIndex, toIndex, (java.util.Comparators.natural()));
+ };
+ Arrays.sort$short_A = function (array) {
+ Arrays.nativeNumberSort$java_lang_Object(array);
+ };
+ Arrays.sort$short_A$int$int = function (array, fromIndex, toIndex) {
+ javaemul.internal.InternalPreconditions.checkPositionIndexes(fromIndex, toIndex, array.length);
+ Arrays.nativeNumberSort$java_lang_Object$int$int(array, fromIndex, toIndex);
+ };
+ Arrays.sort$java_lang_Object_A$java_util_Comparator = function (x, c) {
+ Arrays.mergeSort$java_lang_Object_A$int$int$java_util_Comparator(x, 0, x.length, (c));
+ };
+ Arrays.sort$java_lang_Object_A$int$int$java_util_Comparator = function (x, fromIndex, toIndex, c) {
+ javaemul.internal.InternalPreconditions.checkPositionIndexes(fromIndex, toIndex, x.length);
+ Arrays.mergeSort$java_lang_Object_A$int$int$java_util_Comparator(x, fromIndex, toIndex, (c));
+ };
+ Arrays.sort = function (x, fromIndex, toIndex, c) {
+ if (((x != null && x instanceof Array && (x.length == 0 || x[0] == null || (x[0] != null))) || x === null) && ((typeof fromIndex === 'number') || fromIndex === null) && ((typeof toIndex === 'number') || toIndex === null) && ((typeof c === 'function' && c.length === 2) || c === null)) {
+ return java.util.Arrays.sort$java_lang_Object_A$int$int$java_util_Comparator(x, fromIndex, toIndex, c);
+ }
+ else if (((x != null && x instanceof Array && (x.length == 0 || x[0] == null || (typeof x[0] === 'number'))) || x === null) && ((typeof fromIndex === 'number') || fromIndex === null) && ((typeof toIndex === 'number') || toIndex === null) && c === undefined) {
+ return java.util.Arrays.sort$byte_A$int$int(x, fromIndex, toIndex);
+ }
+ else if (((x != null && x instanceof Array && (x.length == 0 || x[0] == null || (typeof x[0] === 'string'))) || x === null) && ((typeof fromIndex === 'number') || fromIndex === null) && ((typeof toIndex === 'number') || toIndex === null) && c === undefined) {
+ return java.util.Arrays.sort$char_A$int$int(x, fromIndex, toIndex);
+ }
+ else if (((x != null && x instanceof Array && (x.length == 0 || x[0] == null || (typeof x[0] === 'number'))) || x === null) && ((typeof fromIndex === 'number') || fromIndex === null) && ((typeof toIndex === 'number') || toIndex === null) && c === undefined) {
+ return java.util.Arrays.sort$double_A$int$int(x, fromIndex, toIndex);
+ }
+ else if (((x != null && x instanceof Array && (x.length == 0 || x[0] == null || (typeof x[0] === 'number'))) || x === null) && ((typeof fromIndex === 'number') || fromIndex === null) && ((typeof toIndex === 'number') || toIndex === null) && c === undefined) {
+ return java.util.Arrays.sort$float_A$int$int(x, fromIndex, toIndex);
+ }
+ else if (((x != null && x instanceof Array && (x.length == 0 || x[0] == null || (typeof x[0] === 'number'))) || x === null) && ((typeof fromIndex === 'number') || fromIndex === null) && ((typeof toIndex === 'number') || toIndex === null) && c === undefined) {
+ return java.util.Arrays.sort$int_A$int$int(x, fromIndex, toIndex);
+ }
+ else if (((x != null && x instanceof Array && (x.length == 0 || x[0] == null || (typeof x[0] === 'number'))) || x === null) && ((typeof fromIndex === 'number') || fromIndex === null) && ((typeof toIndex === 'number') || toIndex === null) && c === undefined) {
+ return java.util.Arrays.sort$long_A$int$int(x, fromIndex, toIndex);
+ }
+ else if (((x != null && x instanceof Array && (x.length == 0 || x[0] == null || (x[0] != null))) || x === null) && ((typeof fromIndex === 'number') || fromIndex === null) && ((typeof toIndex === 'number') || toIndex === null) && c === undefined) {
+ return java.util.Arrays.sort$java_lang_Object_A$int$int(x, fromIndex, toIndex);
+ }
+ else if (((x != null && x instanceof Array && (x.length == 0 || x[0] == null || (typeof x[0] === 'number'))) || x === null) && ((typeof fromIndex === 'number') || fromIndex === null) && ((typeof toIndex === 'number') || toIndex === null) && c === undefined) {
+ return java.util.Arrays.sort$short_A$int$int(x, fromIndex, toIndex);
+ }
+ else if (((x != null && x instanceof Array && (x.length == 0 || x[0] == null || (x[0] != null))) || x === null) && ((typeof fromIndex === 'function' && fromIndex.length === 2) || fromIndex === null) && toIndex === undefined && c === undefined) {
+ return java.util.Arrays.sort$java_lang_Object_A$java_util_Comparator(x, fromIndex);
+ }
+ else if (((x != null && x instanceof Array && (x.length == 0 || x[0] == null || (typeof x[0] === 'number'))) || x === null) && fromIndex === undefined && toIndex === undefined && c === undefined) {
+ return java.util.Arrays.sort$byte_A(x);
+ }
+ else if (((x != null && x instanceof Array && (x.length == 0 || x[0] == null || (typeof x[0] === 'string'))) || x === null) && fromIndex === undefined && toIndex === undefined && c === undefined) {
+ return java.util.Arrays.sort$char_A(x);
+ }
+ else if (((x != null && x instanceof Array && (x.length == 0 || x[0] == null || (typeof x[0] === 'number'))) || x === null) && fromIndex === undefined && toIndex === undefined && c === undefined) {
+ return java.util.Arrays.sort$double_A(x);
+ }
+ else if (((x != null && x instanceof Array && (x.length == 0 || x[0] == null || (typeof x[0] === 'number'))) || x === null) && fromIndex === undefined && toIndex === undefined && c === undefined) {
+ return java.util.Arrays.sort$float_A(x);
+ }
+ else if (((x != null && x instanceof Array && (x.length == 0 || x[0] == null || (typeof x[0] === 'number'))) || x === null) && fromIndex === undefined && toIndex === undefined && c === undefined) {
+ return java.util.Arrays.sort$int_A(x);
+ }
+ else if (((x != null && x instanceof Array && (x.length == 0 || x[0] == null || (typeof x[0] === 'number'))) || x === null) && fromIndex === undefined && toIndex === undefined && c === undefined) {
+ return java.util.Arrays.sort$long_A(x);
+ }
+ else if (((x != null && x instanceof Array && (x.length == 0 || x[0] == null || (x[0] != null))) || x === null) && fromIndex === undefined && toIndex === undefined && c === undefined) {
+ return java.util.Arrays.sort$java_lang_Object_A(x);
+ }
+ else if (((x != null && x instanceof Array && (x.length == 0 || x[0] == null || (typeof x[0] === 'number'))) || x === null) && fromIndex === undefined && toIndex === undefined && c === undefined) {
+ return java.util.Arrays.sort$short_A(x);
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ Arrays.toString$boolean_A = function (a) {
+ if (a == null) {
+ return "null";
+ }
+ var joiner = new java.util.StringJoiner(", ", "[", "]");
+ for (var index164 = 0; index164 < a.length; index164++) {
+ var element = a[index164];
+ {
+ joiner.add(/* valueOf */ new String(element).toString());
+ }
+ }
+ return joiner.toString();
+ };
+ Arrays.toString = function (a) {
+ if (((a != null && a instanceof Array && (a.length == 0 || a[0] == null || (typeof a[0] === 'boolean'))) || a === null)) {
+ return java.util.Arrays.toString$boolean_A(a);
+ }
+ else if (((a != null && a instanceof Array && (a.length == 0 || a[0] == null || (typeof a[0] === 'number'))) || a === null)) {
+ return java.util.Arrays.toString$byte_A(a);
+ }
+ else if (((a != null && a instanceof Array && (a.length == 0 || a[0] == null || (typeof a[0] === 'string'))) || a === null)) {
+ return java.util.Arrays.toString$char_A(a);
+ }
+ else if (((a != null && a instanceof Array && (a.length == 0 || a[0] == null || (typeof a[0] === 'number'))) || a === null)) {
+ return java.util.Arrays.toString$double_A(a);
+ }
+ else if (((a != null && a instanceof Array && (a.length == 0 || a[0] == null || (typeof a[0] === 'number'))) || a === null)) {
+ return java.util.Arrays.toString$float_A(a);
+ }
+ else if (((a != null && a instanceof Array && (a.length == 0 || a[0] == null || (typeof a[0] === 'number'))) || a === null)) {
+ return java.util.Arrays.toString$int_A(a);
+ }
+ else if (((a != null && a instanceof Array && (a.length == 0 || a[0] == null || (typeof a[0] === 'number'))) || a === null)) {
+ return java.util.Arrays.toString$long_A(a);
+ }
+ else if (((a != null && a instanceof Array && (a.length == 0 || a[0] == null || (a[0] != null))) || a === null)) {
+ return java.util.Arrays.toString$java_lang_Object_A(a);
+ }
+ else if (((a != null && a instanceof Array && (a.length == 0 || a[0] == null || (typeof a[0] === 'number'))) || a === null)) {
+ return java.util.Arrays.toString$short_A(a);
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ Arrays.toString$byte_A = function (a) {
+ if (a == null) {
+ return "null";
+ }
+ var joiner = new java.util.StringJoiner(", ", "[", "]");
+ for (var index165 = 0; index165 < a.length; index165++) {
+ var element = a[index165];
+ {
+ joiner.add(/* valueOf */ new String(element).toString());
+ }
+ }
+ return joiner.toString();
+ };
+ Arrays.toString$char_A = function (a) {
+ if (a == null) {
+ return "null";
+ }
+ var joiner = new java.util.StringJoiner(", ", "[", "]");
+ for (var index166 = 0; index166 < a.length; index166++) {
+ var element = a[index166];
+ {
+ joiner.add(/* valueOf */ new String(element).toString());
+ }
+ }
+ return joiner.toString();
+ };
+ Arrays.toString$double_A = function (a) {
+ if (a == null) {
+ return "null";
+ }
+ var joiner = new java.util.StringJoiner(", ", "[", "]");
+ for (var index167 = 0; index167 < a.length; index167++) {
+ var element = a[index167];
+ {
+ joiner.add(/* valueOf */ new String(element).toString());
+ }
+ }
+ return joiner.toString();
+ };
+ Arrays.toString$float_A = function (a) {
+ if (a == null) {
+ return "null";
+ }
+ var joiner = new java.util.StringJoiner(", ", "[", "]");
+ for (var index168 = 0; index168 < a.length; index168++) {
+ var element = a[index168];
+ {
+ joiner.add(/* valueOf */ new String(element).toString());
+ }
+ }
+ return joiner.toString();
+ };
+ Arrays.toString$int_A = function (a) {
+ if (a == null) {
+ return "null";
+ }
+ var joiner = new java.util.StringJoiner(", ", "[", "]");
+ for (var index169 = 0; index169 < a.length; index169++) {
+ var element = a[index169];
+ {
+ joiner.add(/* valueOf */ new String(element).toString());
+ }
+ }
+ return joiner.toString();
+ };
+ Arrays.toString$long_A = function (a) {
+ if (a == null) {
+ return "null";
+ }
+ var joiner = new java.util.StringJoiner(", ", "[", "]");
+ for (var index170 = 0; index170 < a.length; index170++) {
+ var element = a[index170];
+ {
+ joiner.add(/* valueOf */ new String(element).toString());
+ }
+ }
+ return joiner.toString();
+ };
+ Arrays.toString$java_lang_Object_A = function (x) {
+ if (x == null) {
+ return "null";
+ }
+ return Arrays.asList.apply(null, x).toString();
+ };
+ Arrays.toString$short_A = function (a) {
+ if (a == null) {
+ return "null";
+ }
+ var joiner = new java.util.StringJoiner(", ", "[", "]");
+ for (var index171 = 0; index171 < a.length; index171++) {
+ var element = a[index171];
+ {
+ joiner.add(/* valueOf */ new String(element).toString());
+ }
+ }
+ return joiner.toString();
+ };
+ Arrays.deepToString$java_lang_Object_A$java_util_Set = function (a, arraysIveSeen) {
+ if (a == null) {
+ return "null";
+ }
+ if (!arraysIveSeen.add(a)) {
+ return "[...]";
+ }
+ var joiner = new java.util.StringJoiner(", ", "[", "]");
+ for (var index172 = 0; index172 < a.length; index172++) {
+ var obj = a[index172];
+ {
+ if (obj != null && obj.constructor.isArray()) {
+ if (obj != null && obj instanceof Array && (obj.length == 0 || obj[0] == null || obj[0] != null)) {
+ if (arraysIveSeen.contains(obj)) {
+ joiner.add("[...]");
+ }
+ else {
+ var objArray = obj;
+ var tempSet = (new java.util.HashSet(arraysIveSeen));
+ joiner.add(Arrays.deepToString$java_lang_Object_A$java_util_Set(objArray, tempSet));
+ }
+ }
+ else if (obj != null && obj instanceof Array && (obj.length == 0 || obj[0] == null || typeof obj[0] === 'boolean')) {
+ joiner.add(Arrays.toString$boolean_A(obj));
+ }
+ else if (obj != null && obj instanceof Array && (obj.length == 0 || obj[0] == null || typeof obj[0] === 'number')) {
+ joiner.add(Arrays.toString$byte_A(obj));
+ }
+ else if (obj != null && obj instanceof Array && (obj.length == 0 || obj[0] == null || typeof obj[0] === 'string')) {
+ joiner.add(Arrays.toString$char_A(obj));
+ }
+ else if (obj != null && obj instanceof Array && (obj.length == 0 || obj[0] == null || typeof obj[0] === 'number')) {
+ joiner.add(Arrays.toString$short_A(obj));
+ }
+ else if (obj != null && obj instanceof Array && (obj.length == 0 || obj[0] == null || typeof obj[0] === 'number')) {
+ joiner.add(Arrays.toString$int_A(obj));
+ }
+ else if (obj != null && obj instanceof Array && (obj.length == 0 || obj[0] == null || typeof obj[0] === 'number')) {
+ joiner.add(Arrays.toString$long_A(obj));
+ }
+ else if (obj != null && obj instanceof Array && (obj.length == 0 || obj[0] == null || typeof obj[0] === 'number')) {
+ joiner.add(Arrays.toString$float_A(obj));
+ }
+ else if (obj != null && obj instanceof Array && (obj.length == 0 || obj[0] == null || typeof obj[0] === 'number')) {
+ joiner.add(Arrays.toString$double_A(obj));
+ }
+ else {
+ }
+ }
+ else {
+ joiner.add(/* valueOf */ new String(obj).toString());
+ }
+ }
+ }
+ return joiner.toString();
+ };
+ /**
+ * Recursive helper function for {@link Arrays#deepToString(Object[])}.
+ * @param {Array} a
+ * @param {*} arraysIveSeen
+ * @return {string}
+ * @private
+ */
+ Arrays.deepToString = function (a, arraysIveSeen) {
+ if (((a != null && a instanceof Array && (a.length == 0 || a[0] == null || (a[0] != null))) || a === null) && ((arraysIveSeen != null && (arraysIveSeen["__interfaces"] != null && arraysIveSeen["__interfaces"].indexOf("java.util.Set") >= 0 || arraysIveSeen.constructor != null && arraysIveSeen.constructor["__interfaces"] != null && arraysIveSeen.constructor["__interfaces"].indexOf("java.util.Set") >= 0)) || arraysIveSeen === null)) {
+ return java.util.Arrays.deepToString$java_lang_Object_A$java_util_Set(a, arraysIveSeen);
+ }
+ else if (((a != null && a instanceof Array && (a.length == 0 || a[0] == null || (a[0] != null))) || a === null) && arraysIveSeen === undefined) {
+ return java.util.Arrays.deepToString$java_lang_Object_A(a);
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ Arrays.getCopyLength = function (array, from, to) {
+ javaemul.internal.InternalPreconditions.checkArgument(from <= to, "%s > %s", from, to);
+ var len = javaemul.internal.ArrayHelper.getLength(array);
+ to = Math.min(to, len);
+ javaemul.internal.InternalPreconditions.checkCriticalPositionIndexes(from, to, len);
+ return to - from;
+ };
+ /**
+ * Sort a small subsection of an array by insertion sort.
+ *
+ * @param {Array} array array to sort
+ * @param {number} low lower bound of range to sort
+ * @param {number} high upper bound of range to sort
+ * @param {*} comp comparator to use
+ * @private
+ */
+ Arrays.insertionSort = function (array, low, high, comp) {
+ for (var i = low + 1; i < high; ++i) {
+ {
+ for (var j = i; j > low && ((function (target) { return (target['compare'] === undefined) ? target : target['compare']; })(comp))(array[j - 1], array[j]) > 0; --j) {
+ {
+ var t = array[j];
+ array[j] = array[j - 1];
+ array[j - 1] = t;
+ }
+ ;
+ }
+ }
+ ;
+ }
+ };
+ /**
+ * Merge the two sorted subarrays (srcLow,srcMid] and (srcMid,srcHigh] into
+ * dest.
+ *
+ * @param {Array} src source array for merge
+ * @param {number} srcLow lower bound of bottom sorted half
+ * @param {number} srcMid upper bound of bottom sorted half & lower bound of top sorted
+ * half
+ * @param {number} srcHigh upper bound of top sorted half
+ * @param {Array} dest destination array for merge
+ * @param {number} destLow lower bound of destination
+ * @param {number} destHigh upper bound of destination
+ * @param {*} comp comparator to use
+ * @private
+ */
+ Arrays.merge = function (src, srcLow, srcMid, srcHigh, dest, destLow, destHigh, comp) {
+ var topIdx = srcMid;
+ while ((destLow < destHigh)) {
+ {
+ if (topIdx >= srcHigh || (srcLow < srcMid && ((function (target) { return (target['compare'] === undefined) ? target : target['compare']; })(comp))(src[srcLow], src[topIdx]) <= 0)) {
+ dest[destLow++] = src[srcLow++];
+ }
+ else {
+ dest[destLow++] = src[topIdx++];
+ }
+ }
+ }
+ ;
+ };
+ Arrays.mergeSort$java_lang_Object_A$int$int$java_util_Comparator = function (x, fromIndex, toIndex, comp) {
+ if (comp == null) {
+ comp = (java.util.Comparators.natural());
+ }
+ var temp = Arrays.copyOfRange$java_lang_Object_A$int$int(x, fromIndex, toIndex);
+ Arrays.mergeSort$java_lang_Object_A$java_lang_Object_A$int$int$int$java_util_Comparator(temp, x, fromIndex, toIndex, -fromIndex, (comp));
+ };
+ Arrays.mergeSort$java_lang_Object_A$java_lang_Object_A$int$int$int$java_util_Comparator = function (temp, array, low, high, ofs, comp) {
+ var length = high - low;
+ if (length < 7) {
+ Arrays.insertionSort(array, low, high, (comp));
+ return;
+ }
+ var tempLow = low + ofs;
+ var tempHigh = high + ofs;
+ var tempMid = tempLow + ((tempHigh - tempLow) >> 1);
+ Arrays.mergeSort$java_lang_Object_A$java_lang_Object_A$int$int$int$java_util_Comparator(array, temp, tempLow, tempMid, -ofs, (comp));
+ Arrays.mergeSort$java_lang_Object_A$java_lang_Object_A$int$int$int$java_util_Comparator(array, temp, tempMid, tempHigh, -ofs, (comp));
+ if (((function (target) { return (target['compare'] === undefined) ? target : target['compare']; })(comp))(temp[tempMid - 1], temp[tempMid]) <= 0) {
+ while ((low < high)) {
+ {
+ array[low++] = temp[tempLow++];
+ }
+ }
+ ;
+ return;
+ }
+ Arrays.merge(temp, tempLow, tempMid, tempHigh, array, low, high, (comp));
+ };
+ /**
+ * Recursive helper function for
+ * {@link Arrays#mergeSort(Object[], int, int, Comparator)}.
+ *
+ * @param {Array} temp temporary space, as large as the range of elements being
+ * sorted. On entry, temp should contain a copy of the sort range
+ * from array.
+ * @param {Array} array array to sort
+ * @param {number} low lower bound of range to sort
+ * @param {number} high upper bound of range to sort
+ * @param {number} ofs offset to convert an array index into a temp index
+ * @param {*} comp comparison function
+ * @private
+ */
+ Arrays.mergeSort = function (temp, array, low, high, ofs, comp) {
+ if (((temp != null && temp instanceof Array && (temp.length == 0 || temp[0] == null || (temp[0] != null))) || temp === null) && ((array != null && array instanceof Array && (array.length == 0 || array[0] == null || (array[0] != null))) || array === null) && ((typeof low === 'number') || low === null) && ((typeof high === 'number') || high === null) && ((typeof ofs === 'number') || ofs === null) && ((typeof comp === 'function' && comp.length === 2) || comp === null)) {
+ return java.util.Arrays.mergeSort$java_lang_Object_A$java_lang_Object_A$int$int$int$java_util_Comparator(temp, array, low, high, ofs, comp);
+ }
+ else if (((temp != null && temp instanceof Array && (temp.length == 0 || temp[0] == null || (temp[0] != null))) || temp === null) && ((typeof array === 'number') || array === null) && ((typeof low === 'number') || low === null) && ((typeof high === 'function' && high.length === 2) || high === null) && ofs === undefined && comp === undefined) {
+ return java.util.Arrays.mergeSort$java_lang_Object_A$int$int$java_util_Comparator(temp, array, low, high);
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ Arrays.nativeLongSort$java_lang_Object$java_lang_Object = function (array, compareFunction) {
+ array.sort(compareFunction);
+ };
+ Arrays.nativeLongSort$java_lang_Object$int$int = function (array, fromIndex, toIndex) {
+ var temp = javaemul.internal.ArrayHelper.unsafeClone(array, fromIndex, toIndex);
+ Arrays.nativeLongSort$java_lang_Object$java_lang_Object(temp, javaemul.internal.LongCompareHolder.getLongComparator());
+ javaemul.internal.ArrayHelper.copy$java_lang_Object$int$java_lang_Object$int$int(temp, 0, array, fromIndex, toIndex - fromIndex);
+ };
+ /**
+ * Sort a subset of an array of number primitives.
+ * @param {*} array
+ * @param {number} fromIndex
+ * @param {number} toIndex
+ * @private
+ */
+ Arrays.nativeLongSort = function (array, fromIndex, toIndex) {
+ if (((array != null) || array === null) && ((typeof fromIndex === 'number') || fromIndex === null) && ((typeof toIndex === 'number') || toIndex === null)) {
+ return java.util.Arrays.nativeLongSort$java_lang_Object$int$int(array, fromIndex, toIndex);
+ }
+ else if (((array != null) || array === null) && ((fromIndex != null) || fromIndex === null) && toIndex === undefined) {
+ return java.util.Arrays.nativeLongSort$java_lang_Object$java_lang_Object(array, fromIndex);
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ Arrays.nativeNumberSort$java_lang_Object = function (array) {
+ array.sort(function (a, b) { return a - b; });
+ };
+ Arrays.nativeNumberSort$java_lang_Object$int$int = function (array, fromIndex, toIndex) {
+ var temp = javaemul.internal.ArrayHelper.unsafeClone(array, fromIndex, toIndex);
+ Arrays.nativeNumberSort$java_lang_Object(temp);
+ javaemul.internal.ArrayHelper.copy$java_lang_Object$int$java_lang_Object$int$int(temp, 0, array, fromIndex, toIndex - fromIndex);
+ };
+ /**
+ * Sort a subset of an array of number primitives.
+ * @param {*} array
+ * @param {number} fromIndex
+ * @param {number} toIndex
+ * @private
+ */
+ Arrays.nativeNumberSort = function (array, fromIndex, toIndex) {
+ if (((array != null) || array === null) && ((typeof fromIndex === 'number') || fromIndex === null) && ((typeof toIndex === 'number') || toIndex === null)) {
+ return java.util.Arrays.nativeNumberSort$java_lang_Object$int$int(array, fromIndex, toIndex);
+ }
+ else if (((array != null) || array === null) && fromIndex === undefined && toIndex === undefined) {
+ return java.util.Arrays.nativeNumberSort$java_lang_Object(array);
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ return Arrays;
+ }());
+ util.Arrays = Arrays;
+ Arrays["__class"] = "java.util.Arrays";
+ (function (Arrays) {
+ var ArrayList = /** @class */ (function (_super) {
+ __extends(ArrayList, _super);
+ function ArrayList(array) {
+ var _this = _super.call(this) || this;
+ if (_this.array === undefined) {
+ _this.array = null;
+ }
+ _this.array = array;
+ return _this;
+ }
+ /**
+ *
+ * @param {*} o
+ * @return {boolean}
+ */
+ ArrayList.prototype.contains = function (o) {
+ return (this.indexOf(o) !== -1);
+ };
+ /**
+ *
+ * @param {number} index
+ * @return {*}
+ */
+ ArrayList.prototype.get = function (index) {
+ javaemul.internal.InternalPreconditions.checkElementIndex(index, this.size());
+ return this.array[index];
+ };
+ /**
+ *
+ * @param {number} index
+ * @param {*} value
+ * @return {*}
+ */
+ ArrayList.prototype.set = function (index, value) {
+ var was = this.get(index);
+ this.array[index] = value;
+ return was;
+ };
+ /**
+ *
+ * @return {number}
+ */
+ ArrayList.prototype.size = function () {
+ return this.array.length;
+ };
+ ArrayList.prototype.toArray$ = function () {
+ return this.toArray$java_lang_Object_A((function (s) { var a = []; while (s-- > 0)
+ a.push(null); return a; })(this.array.length));
+ };
+ ArrayList.prototype.toArray$java_lang_Object_A = function (out) {
+ var size = this.size();
+ if (out.length < size) {
+ out = javaemul.internal.ArrayHelper.createFrom(out, size);
+ }
+ for (var i = 0; i < size; ++i) {
+ {
+ out[i] = this.array[i];
+ }
+ ;
+ }
+ if (out.length > size) {
+ out[size] = null;
+ }
+ return out;
+ };
+ /**
+ *
+ * @param {Array} out
+ * @return {Array}
+ */
+ ArrayList.prototype.toArray = function (out) {
+ if (((out != null && out instanceof Array && (out.length == 0 || out[0] == null || (out[0] != null))) || out === null)) {
+ return this.toArray$java_lang_Object_A(out);
+ }
+ else if (out === undefined) {
+ return this.toArray$();
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ return ArrayList;
+ }(java.util.AbstractList));
+ Arrays.ArrayList = ArrayList;
+ ArrayList["__class"] = "java.util.Arrays.ArrayList";
+ ArrayList["__interfaces"] = ["java.util.RandomAccess", "java.util.List", "java.util.Collection", "java.lang.Iterable", "java.io.Serializable"];
+ })(Arrays = util.Arrays || (util.Arrays = {}));
+ })(util = java.util || (java.util = {}));
+})(java || (java = {}));
+(function (java) {
+ var util;
+ (function (util) {
+ /**
+ * An unbounded priority queue based on a priority heap. [Sun
+ * docs]
+ *
+ * @param node a valid heap. O(n) time
+ *
+ * @param {number} node
+ */
+ PriorityQueue.prototype.makeHeap = function (node) {
+ if (this.isLeaf(node)) {
+ return;
+ }
+ this.makeHeap(PriorityQueue.getLeftChild(node));
+ var rightChild = PriorityQueue.getRightChild(node);
+ if (rightChild < this.heap.size()) {
+ this.makeHeap(rightChild);
+ }
+ this.mergeHeaps(node);
+ };
+ /**
+ * Merge two subheaps into a single heap. O(log n) time
+ *
+ * PRECONDITION: both children of node are heaps
+ *
+ * @param {number} node the parent of the two subtrees to merge
+ */
+ PriorityQueue.prototype.mergeHeaps = function (node) {
+ var heapSize = this.heap.size();
+ var value = this.heap.get(node);
+ while ((!PriorityQueue.isLeaf(node, heapSize))) {
+ {
+ var smallestChild = this.getSmallestChild(node, heapSize);
+ if (((function (target) { return (target['compare'] === undefined) ? target : target['compare']; })(this.cmp))(value, this.heap.get(smallestChild)) < 0) {
+ break;
+ }
+ this.heap.set(node, this.heap.get(smallestChild));
+ node = smallestChild;
+ }
+ }
+ ;
+ this.heap.set(node, value);
+ };
+ /*private*/ PriorityQueue.prototype.getSmallestChild = function (node, heapSize) {
+ var smallestChild;
+ var leftChild = PriorityQueue.getLeftChild(node);
+ var rightChild = leftChild + 1;
+ smallestChild = leftChild;
+ if ((rightChild < heapSize) && (((function (target) { return (target['compare'] === undefined) ? target : target['compare']; })(this.cmp))(this.heap.get(rightChild), this.heap.get(leftChild)) < 0)) {
+ smallestChild = rightChild;
+ }
+ return smallestChild;
+ };
+ /*private*/ PriorityQueue.prototype.isLeaf = function (node) {
+ return PriorityQueue.isLeaf(node, this.heap.size());
+ };
+ /*private*/ PriorityQueue.prototype.removeAtIndex = function (index) {
+ var lastValue = this.heap.remove$int(this.heap.size() - 1);
+ if (index < this.heap.size()) {
+ this.heap.set(index, lastValue);
+ this.mergeHeaps(index);
+ }
+ };
+ PriorityQueue.INITIAL_CAPACITY = 11;
+ return PriorityQueue;
+ }(java.util.AbstractQueue));
+ util.PriorityQueue = PriorityQueue;
+ PriorityQueue["__class"] = "java.util.PriorityQueue";
+ PriorityQueue["__interfaces"] = ["java.util.Collection", "java.util.Queue", "java.lang.Iterable"];
+ })(util = java.util || (java.util = {}));
+})(java || (java = {}));
+(function (java) {
+ var io;
+ (function (io) {
+ /**
+ * @skip
+ * @param {java.io.OutputStream} out
+ * @class
+ * @extends java.io.FilterOutputStream
+ */
+ var PrintStream = /** @class */ (function (_super) {
+ __extends(PrintStream, _super);
+ function PrintStream(out) {
+ return _super.call(this, out) || this;
+ }
+ PrintStream.prototype.print$java_lang_String = function (s) {
+ try {
+ this.write$byte_A(/* getBytes */ (s).split('').map(function (s) { return s.charCodeAt(0); }));
+ }
+ catch (e) {
+ console.error(e.message, e);
+ }
+ ;
+ };
+ PrintStream.prototype.print = function (s) {
+ if (((typeof s === 'string') || s === null)) {
+ return this.print$java_lang_String(s);
+ }
+ else if (((s != null && s instanceof Array && (s.length == 0 || s[0] == null || (typeof s[0] === 'string'))) || s === null)) {
+ return this.print$char_A(s);
+ }
+ else if (((typeof s === 'boolean') || s === null)) {
+ return this.print$boolean(s);
+ }
+ else if (((typeof s === 'string') || s === null)) {
+ return this.print$char(s);
+ }
+ else if (((typeof s === 'number') || s === null)) {
+ return this.print$int(s);
+ }
+ else if (((typeof s === 'number') || s === null)) {
+ return this.print$long(s);
+ }
+ else if (((typeof s === 'number') || s === null)) {
+ return this.print$float(s);
+ }
+ else if (((typeof s === 'number') || s === null)) {
+ return this.print$double(s);
+ }
+ else if (((s != null) || s === null)) {
+ return this.print$java_lang_Object(s);
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ PrintStream.prototype.println$java_lang_String = function (s) {
+ this.print$java_lang_String(s + java.lang.System.lineSeparator());
+ };
+ PrintStream.prototype.println = function (s) {
+ if (((typeof s === 'string') || s === null)) {
+ return this.println$java_lang_String(s);
+ }
+ else if (((s != null && s instanceof Array && (s.length == 0 || s[0] == null || (typeof s[0] === 'string'))) || s === null)) {
+ return this.println$char_A(s);
+ }
+ else if (((typeof s === 'boolean') || s === null)) {
+ return this.println$boolean(s);
+ }
+ else if (((typeof s === 'string') || s === null)) {
+ return this.println$char(s);
+ }
+ else if (((typeof s === 'number') || s === null)) {
+ return this.println$int(s);
+ }
+ else if (((typeof s === 'number') || s === null)) {
+ return this.println$long(s);
+ }
+ else if (((typeof s === 'number') || s === null)) {
+ return this.println$float(s);
+ }
+ else if (((typeof s === 'number') || s === null)) {
+ return this.println$double(s);
+ }
+ else if (((s != null) || s === null)) {
+ return this.println$java_lang_Object(s);
+ }
+ else if (s === undefined) {
+ return this.println$();
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ PrintStream.prototype.print$boolean = function (x) {
+ this.print$java_lang_String(/* valueOf */ new String(x).toString());
+ };
+ PrintStream.prototype.print$char = function (x) {
+ this.print$java_lang_String(/* valueOf */ new String(x).toString());
+ };
+ PrintStream.prototype.print$char_A = function (x) {
+ this.println$java_lang_String(/* valueOf */ new String(x).toString());
+ };
+ PrintStream.prototype.print$double = function (x) {
+ this.print$java_lang_String(/* valueOf */ new String(x).toString());
+ };
+ PrintStream.prototype.print$float = function (x) {
+ this.print$java_lang_String(/* valueOf */ new String(x).toString());
+ };
+ PrintStream.prototype.print$int = function (x) {
+ this.print$java_lang_String(/* valueOf */ new String(x).toString());
+ };
+ PrintStream.prototype.print$long = function (x) {
+ this.print$java_lang_String(/* valueOf */ new String(x).toString());
+ };
+ PrintStream.prototype.print$java_lang_Object = function (x) {
+ this.print$java_lang_String(/* valueOf */ new String(x).toString());
+ };
+ PrintStream.prototype.println$ = function () {
+ this.println$java_lang_String("");
+ };
+ PrintStream.prototype.println$boolean = function (x) {
+ this.println$java_lang_String(/* valueOf */ new String(x).toString());
+ };
+ PrintStream.prototype.println$char = function (x) {
+ this.println$java_lang_String(/* valueOf */ new String(x).toString());
+ };
+ PrintStream.prototype.println$char_A = function (x) {
+ this.println$java_lang_String(/* valueOf */ new String(x).toString());
+ };
+ PrintStream.prototype.println$double = function (x) {
+ this.println$java_lang_String(/* valueOf */ new String(x).toString());
+ };
+ PrintStream.prototype.println$float = function (x) {
+ this.println$java_lang_String(/* valueOf */ new String(x).toString());
+ };
+ PrintStream.prototype.println$int = function (x) {
+ this.println$java_lang_String(/* valueOf */ new String(x).toString());
+ };
+ PrintStream.prototype.println$long = function (x) {
+ this.println$java_lang_String(/* valueOf */ new String(x).toString());
+ };
+ PrintStream.prototype.println$java_lang_Object = function (x) {
+ this.println$java_lang_String(/* valueOf */ new String(x).toString());
+ };
+ return PrintStream;
+ }(java.io.FilterOutputStream));
+ io.PrintStream = PrintStream;
+ PrintStream["__class"] = "java.io.PrintStream";
+ PrintStream["__interfaces"] = ["java.io.Closeable", "java.lang.AutoCloseable", "java.io.Flushable"];
+ })(io = java.io || (java.io = {}));
+})(java || (java = {}));
+(function (java) {
+ var security;
+ (function (security) {
+ /**
+ * A generic security exception type - [Sun's
+ * docs].
+ * @param {string} msg
+ * @class
+ * @extends java.security.GeneralSecurityException
+ */
+ var DigestException = /** @class */ (function (_super) {
+ __extends(DigestException, _super);
+ function DigestException(msg) {
+ var _this = this;
+ if (((typeof msg === 'string') || msg === null)) {
+ var __args = arguments;
+ _this = _super.call(this, msg) || this;
+ }
+ else if (msg === undefined) {
+ var __args = arguments;
+ _this = _super.call(this) || this;
+ }
+ else
+ throw new Error('invalid overload');
+ return _this;
+ }
+ return DigestException;
+ }(java.security.GeneralSecurityException));
+ security.DigestException = DigestException;
+ DigestException["__class"] = "java.security.DigestException";
+ DigestException["__interfaces"] = ["java.io.Serializable"];
+ })(security = java.security || (java.security = {}));
+})(java || (java = {}));
+(function (java) {
+ var security;
+ (function (security) {
+ /**
+ * A generic security exception type - [Sun's
+ * docs].
+ * @param {string} msg
+ * @class
+ * @extends java.security.GeneralSecurityException
+ */
+ var NoSuchAlgorithmException = /** @class */ (function (_super) {
+ __extends(NoSuchAlgorithmException, _super);
+ function NoSuchAlgorithmException(msg) {
+ var _this = this;
+ if (((typeof msg === 'string') || msg === null)) {
+ var __args = arguments;
+ _this = _super.call(this, msg) || this;
+ }
+ else if (msg === undefined) {
+ var __args = arguments;
+ _this = _super.call(this) || this;
+ }
+ else
+ throw new Error('invalid overload');
+ return _this;
+ }
+ return NoSuchAlgorithmException;
+ }(java.security.GeneralSecurityException));
+ security.NoSuchAlgorithmException = NoSuchAlgorithmException;
+ NoSuchAlgorithmException["__class"] = "java.security.NoSuchAlgorithmException";
+ NoSuchAlgorithmException["__interfaces"] = ["java.io.Serializable"];
+ })(security = java.security || (java.security = {}));
+})(java || (java = {}));
+(function (java) {
+ var io;
+ (function (io) {
+ /**
+ * A character encoding is not supported - [Sun's
+ * docs].
+ * @param {string} msg
+ * @class
+ * @extends java.io.IOException
+ */
+ var UnsupportedEncodingException = /** @class */ (function (_super) {
+ __extends(UnsupportedEncodingException, _super);
+ function UnsupportedEncodingException(msg) {
+ var _this = this;
+ if (((typeof msg === 'string') || msg === null)) {
+ var __args = arguments;
+ _this = _super.call(this, msg) || this;
+ }
+ else if (msg === undefined) {
+ var __args = arguments;
+ _this = _super.call(this) || this;
+ }
+ else
+ throw new Error('invalid overload');
+ return _this;
+ }
+ return UnsupportedEncodingException;
+ }(java.io.IOException));
+ io.UnsupportedEncodingException = UnsupportedEncodingException;
+ UnsupportedEncodingException["__class"] = "java.io.UnsupportedEncodingException";
+ UnsupportedEncodingException["__interfaces"] = ["java.io.Serializable"];
+ })(io = java.io || (java.io = {}));
+})(java || (java = {}));
+(function (javaemul) {
+ var internal;
+ (function (internal) {
+ var stream;
+ (function (stream) {
+ var StopException = /** @class */ (function (_super) {
+ __extends(StopException, _super);
+ function StopException() {
+ var _this = _super.call(this) || this;
+ Object.setPrototypeOf(_this, StopException.prototype);
+ return _this;
+ }
+ return StopException;
+ }(java.lang.RuntimeException));
+ stream.StopException = StopException;
+ StopException["__class"] = "javaemul.internal.stream.StopException";
+ StopException["__interfaces"] = ["java.io.Serializable"];
+ })(stream = internal.stream || (internal.stream = {}));
+ })(internal = javaemul.internal || (javaemul.internal = {}));
+})(javaemul || (javaemul = {}));
+(function (java) {
+ var util;
+ (function (util) {
+ /**
+ * See the
+ * official Java API doc for details.
+ * @param {string} s
+ * @param {string} className
+ * @param {string} key
+ * @class
+ * @extends java.lang.RuntimeException
+ */
+ var MissingResourceException = /** @class */ (function (_super) {
+ __extends(MissingResourceException, _super);
+ function MissingResourceException(s, className, key) {
+ var _this = _super.call(this, s) || this;
+ Object.setPrototypeOf(_this, MissingResourceException.prototype);
+ if (_this.className === undefined) {
+ _this.className = null;
+ }
+ if (_this.key === undefined) {
+ _this.key = null;
+ }
+ _this.key = key;
+ _this.className = className;
+ return _this;
+ }
+ MissingResourceException.prototype.getClassName = function () {
+ return this.className;
+ };
+ MissingResourceException.prototype.getKey = function () {
+ return this.key;
+ };
+ return MissingResourceException;
+ }(java.lang.RuntimeException));
+ util.MissingResourceException = MissingResourceException;
+ MissingResourceException["__class"] = "java.util.MissingResourceException";
+ MissingResourceException["__interfaces"] = ["java.io.Serializable"];
+ })(util = java.util || (java.util = {}));
+})(java || (java = {}));
+(function (java) {
+ var util;
+ (function (util) {
+ /**
+ * See the
+ * official Java API doc for details.
+ * @param {string} message
+ * @class
+ * @extends java.lang.RuntimeException
+ */
+ var ConcurrentModificationException = /** @class */ (function (_super) {
+ __extends(ConcurrentModificationException, _super);
+ function ConcurrentModificationException(message) {
+ var _this = this;
+ if (((typeof message === 'string') || message === null)) {
+ var __args = arguments;
+ _this = _super.call(this, message) || this;
+ }
+ else if (message === undefined) {
+ var __args = arguments;
+ _this = _super.call(this) || this;
+ }
+ else
+ throw new Error('invalid overload');
+ return _this;
+ }
+ return ConcurrentModificationException;
+ }(java.lang.RuntimeException));
+ util.ConcurrentModificationException = ConcurrentModificationException;
+ ConcurrentModificationException["__class"] = "java.util.ConcurrentModificationException";
+ ConcurrentModificationException["__interfaces"] = ["java.io.Serializable"];
+ })(util = java.util || (java.util = {}));
+})(java || (java = {}));
+(function (java) {
+ var util;
+ (function (util) {
+ /**
+ * See the
+ * official Java API doc for details.
+ * @param {string} s
+ * @class
+ * @extends java.lang.RuntimeException
+ */
+ var NoSuchElementException = /** @class */ (function (_super) {
+ __extends(NoSuchElementException, _super);
+ function NoSuchElementException(s) {
+ var _this = this;
+ if (((typeof s === 'string') || s === null)) {
+ var __args = arguments;
+ _this = _super.call(this, s) || this;
+ }
+ else if (s === undefined) {
+ var __args = arguments;
+ _this = _super.call(this) || this;
+ }
+ else
+ throw new Error('invalid overload');
+ return _this;
+ }
+ return NoSuchElementException;
+ }(java.lang.RuntimeException));
+ util.NoSuchElementException = NoSuchElementException;
+ NoSuchElementException["__class"] = "java.util.NoSuchElementException";
+ NoSuchElementException["__interfaces"] = ["java.io.Serializable"];
+ })(util = java.util || (java.util = {}));
+})(java || (java = {}));
+(function (java) {
+ var util;
+ (function (util) {
+ /**
+ * See the
+ * official Java API doc for details.
+ * @class
+ * @extends java.lang.RuntimeException
+ */
+ var EmptyStackException = /** @class */ (function (_super) {
+ __extends(EmptyStackException, _super);
+ function EmptyStackException() {
+ var _this = _super.call(this) || this;
+ Object.setPrototypeOf(_this, EmptyStackException.prototype);
+ return _this;
+ }
+ return EmptyStackException;
+ }(java.lang.RuntimeException));
+ util.EmptyStackException = EmptyStackException;
+ EmptyStackException["__class"] = "java.util.EmptyStackException";
+ EmptyStackException["__interfaces"] = ["java.io.Serializable"];
+ })(util = java.util || (java.util = {}));
+})(java || (java = {}));
+(function (java) {
+ var io;
+ (function (io) {
+ /**
+ * See the
+ * official Java API doc for details.
+ * @param {string} message
+ * @param {java.io.IOException} cause
+ * @class
+ * @extends java.lang.RuntimeException
+ */
+ var UncheckedIOException = /** @class */ (function (_super) {
+ __extends(UncheckedIOException, _super);
+ function UncheckedIOException(message, cause) {
+ var _this = this;
+ if (((typeof message === 'string') || message === null) && ((cause != null && cause instanceof java.io.IOException) || cause === null)) {
+ var __args = arguments;
+ _this = _super.call(this, message, (javaemul.internal.InternalPreconditions.checkNotNull(cause))) || this;
+ }
+ else if (((message != null && message instanceof java.io.IOException) || message === null) && cause === undefined) {
+ var __args = arguments;
+ var cause_7 = __args[0];
+ _this = _super.call(this, (javaemul.internal.InternalPreconditions.checkNotNull(cause_7))) || this;
+ }
+ else
+ throw new Error('invalid overload');
+ return _this;
+ }
+ /**
+ *
+ * @return {java.io.IOException}
+ */
+ UncheckedIOException.prototype.getCause = function () {
+ return null;
+ };
+ return UncheckedIOException;
+ }(java.lang.RuntimeException));
+ io.UncheckedIOException = UncheckedIOException;
+ UncheckedIOException["__class"] = "java.io.UncheckedIOException";
+ UncheckedIOException["__interfaces"] = ["java.io.Serializable"];
+ })(io = java.io || (java.io = {}));
+})(java || (java = {}));
+(function (java) {
+ var lang;
+ (function (lang) {
+ /**
+ * Indicates that an objet was in an invalid state during an attempted
+ * operation.
+ * @param {string} message
+ * @param {java.lang.Throwable} cause
+ * @class
+ * @extends java.lang.RuntimeException
+ */
+ var IllegalStateException = /** @class */ (function (_super) {
+ __extends(IllegalStateException, _super);
+ function IllegalStateException(message, cause) {
+ var _this = this;
+ if (((typeof message === 'string') || message === null) && ((cause != null && cause instanceof Error) || cause === null)) {
+ var __args = arguments;
+ _this = _super.call(this, message, cause) || this;
+ }
+ else if (((typeof message === 'string') || message === null) && cause === undefined) {
+ var __args = arguments;
+ var s = __args[0];
+ _this = _super.call(this, s) || this;
+ }
+ else if (((message != null && message instanceof Error) || message === null) && cause === undefined) {
+ var __args = arguments;
+ var cause_8 = __args[0];
+ _this = _super.call(this, cause_8) || this;
+ }
+ else if (message === undefined && cause === undefined) {
+ var __args = arguments;
+ _this = _super.call(this) || this;
+ }
+ else
+ throw new Error('invalid overload');
+ return _this;
+ }
+ return IllegalStateException;
+ }(java.lang.RuntimeException));
+ lang.IllegalStateException = IllegalStateException;
+ IllegalStateException["__class"] = "java.lang.IllegalStateException";
+ IllegalStateException["__interfaces"] = ["java.io.Serializable"];
+ })(lang = java.lang || (java.lang = {}));
+})(java || (java = {}));
+(function (java) {
+ var lang;
+ (function (lang) {
+ /**
+ * See the
+ * official Java API doc for details.
+ * @param {string} message
+ * @class
+ * @extends java.lang.RuntimeException
+ */
+ var NullPointerException = /** @class */ (function (_super) {
+ __extends(NullPointerException, _super);
+ function NullPointerException(message) {
+ var _this = this;
+ if (((typeof message === 'string') || message === null)) {
+ var __args = arguments;
+ _this = _super.call(this, message) || this;
+ }
+ else if (message === undefined) {
+ var __args = arguments;
+ _this = _super.call(this) || this;
+ }
+ else
+ throw new Error('invalid overload');
+ return _this;
+ }
+ NullPointerException.prototype.createError = function (msg) {
+ return (new TypeError(msg));
+ };
+ return NullPointerException;
+ }(java.lang.RuntimeException));
+ lang.NullPointerException = NullPointerException;
+ NullPointerException["__class"] = "java.lang.NullPointerException";
+ NullPointerException["__interfaces"] = ["java.io.Serializable"];
+ })(lang = java.lang || (java.lang = {}));
+})(java || (java = {}));
+(function (java) {
+ var lang;
+ (function (lang) {
+ var IllegalAccessException = /** @class */ (function (_super) {
+ __extends(IllegalAccessException, _super);
+ function IllegalAccessException(message, cause) {
+ var _this = this;
+ if (((typeof message === 'string') || message === null) && ((cause != null && cause instanceof Error) || cause === null)) {
+ var __args = arguments;
+ _this = _super.call(this, message, cause) || this;
+ }
+ else if (((typeof message === 'string') || message === null) && cause === undefined) {
+ var __args = arguments;
+ var s = __args[0];
+ _this = _super.call(this, s) || this;
+ }
+ else if (((message != null && message instanceof Error) || message === null) && cause === undefined) {
+ var __args = arguments;
+ var cause_9 = __args[0];
+ _this = _super.call(this, cause_9) || this;
+ }
+ else if (message === undefined && cause === undefined) {
+ var __args = arguments;
+ _this = _super.call(this) || this;
+ }
+ else
+ throw new Error('invalid overload');
+ return _this;
+ }
+ return IllegalAccessException;
+ }(java.lang.RuntimeException));
+ lang.IllegalAccessException = IllegalAccessException;
+ IllegalAccessException["__class"] = "java.lang.IllegalAccessException";
+ IllegalAccessException["__interfaces"] = ["java.io.Serializable"];
+ })(lang = java.lang || (java.lang = {}));
+})(java || (java = {}));
+(function (java) {
+ var lang;
+ (function (lang) {
+ /**
+ * See the
+ * official Java API doc for details.
+ * @param {string} message
+ * @param {java.lang.Throwable} cause
+ * @class
+ * @extends java.lang.RuntimeException
+ */
+ var IllegalArgumentException = /** @class */ (function (_super) {
+ __extends(IllegalArgumentException, _super);
+ function IllegalArgumentException(message, cause) {
+ var _this = this;
+ if (((typeof message === 'string') || message === null) && ((cause != null && cause instanceof Error) || cause === null)) {
+ var __args = arguments;
+ _this = _super.call(this, message, cause) || this;
+ }
+ else if (((typeof message === 'string') || message === null) && cause === undefined) {
+ var __args = arguments;
+ _this = _super.call(this, message) || this;
+ }
+ else if (((message != null && message instanceof Error) || message === null) && cause === undefined) {
+ var __args = arguments;
+ var cause_10 = __args[0];
+ _this = _super.call(this, cause_10) || this;
+ }
+ else if (message === undefined && cause === undefined) {
+ var __args = arguments;
+ _this = _super.call(this) || this;
+ }
+ else
+ throw new Error('invalid overload');
+ return _this;
+ }
+ return IllegalArgumentException;
+ }(java.lang.RuntimeException));
+ lang.IllegalArgumentException = IllegalArgumentException;
+ IllegalArgumentException["__class"] = "java.lang.IllegalArgumentException";
+ IllegalArgumentException["__interfaces"] = ["java.io.Serializable"];
+ })(lang = java.lang || (java.lang = {}));
+})(java || (java = {}));
+(function (java) {
+ var lang;
+ (function (lang) {
+ var annotation;
+ (function (annotation) {
+ /**
+ * Indicates an attempt to access an element of an annotation that has changed
+ * since it was compiled or serialized [Sun
+ * docs].
+ * @class
+ * @extends java.lang.RuntimeException
+ */
+ var AnnotationTypeMismatchException = /** @class */ (function (_super) {
+ __extends(AnnotationTypeMismatchException, _super);
+ function AnnotationTypeMismatchException() {
+ var _this = _super.call(this) || this;
+ Object.setPrototypeOf(_this, AnnotationTypeMismatchException.prototype);
+ return _this;
+ }
+ return AnnotationTypeMismatchException;
+ }(java.lang.RuntimeException));
+ annotation.AnnotationTypeMismatchException = AnnotationTypeMismatchException;
+ AnnotationTypeMismatchException["__class"] = "java.lang.annotation.AnnotationTypeMismatchException";
+ AnnotationTypeMismatchException["__interfaces"] = ["java.io.Serializable"];
+ })(annotation = lang.annotation || (lang.annotation = {}));
+ })(lang = java.lang || (java.lang = {}));
+})(java || (java = {}));
+(function (java) {
+ var lang;
+ (function (lang) {
+ var annotation;
+ (function (annotation) {
+ /**
+ * Indicates an attempt to access an element of an annotation that was added
+ * since it was compiled or serialized [Sun
+ * docs].
+ * @param {java.lang.Class} annotationType
+ * @param {string} elementName
+ * @class
+ * @extends java.lang.RuntimeException
+ */
+ var IncompleteAnnotationException = /** @class */ (function (_super) {
+ __extends(IncompleteAnnotationException, _super);
+ function IncompleteAnnotationException(annotationType, elementName) {
+ var _this = _super.call(this, "Incomplete annotation: trying to access " + elementName + " on " + annotationType) || this;
+ Object.setPrototypeOf(_this, IncompleteAnnotationException.prototype);
+ if (_this.__annotationType === undefined) {
+ _this.__annotationType = null;
+ }
+ if (_this.__elementName === undefined) {
+ _this.__elementName = null;
+ }
+ _this.__annotationType = annotationType;
+ _this.__elementName = elementName;
+ return _this;
+ }
+ IncompleteAnnotationException.prototype.annotationType = function () {
+ return this.__annotationType;
+ };
+ IncompleteAnnotationException.prototype.elementName = function () {
+ return this.__elementName;
+ };
+ return IncompleteAnnotationException;
+ }(java.lang.RuntimeException));
+ annotation.IncompleteAnnotationException = IncompleteAnnotationException;
+ IncompleteAnnotationException["__class"] = "java.lang.annotation.IncompleteAnnotationException";
+ IncompleteAnnotationException["__interfaces"] = ["java.io.Serializable"];
+ })(annotation = lang.annotation || (lang.annotation = {}));
+ })(lang = java.lang || (java.lang = {}));
+})(java || (java = {}));
+(function (java) {
+ var lang;
+ (function (lang) {
+ /**
+ * Indicates failure to cast one type into another.
+ * @param {string} message
+ * @class
+ * @extends java.lang.RuntimeException
+ */
+ var ClassCastException = /** @class */ (function (_super) {
+ __extends(ClassCastException, _super);
+ function ClassCastException(message) {
+ var _this = this;
+ if (((typeof message === 'string') || message === null)) {
+ var __args = arguments;
+ _this = _super.call(this, message) || this;
+ }
+ else if (message === undefined) {
+ var __args = arguments;
+ _this = _super.call(this) || this;
+ }
+ else
+ throw new Error('invalid overload');
+ return _this;
+ }
+ return ClassCastException;
+ }(java.lang.RuntimeException));
+ lang.ClassCastException = ClassCastException;
+ ClassCastException["__class"] = "java.lang.ClassCastException";
+ ClassCastException["__interfaces"] = ["java.io.Serializable"];
+ })(lang = java.lang || (java.lang = {}));
+})(java || (java = {}));
+(function (java) {
+ var lang;
+ (function (lang) {
+ /**
+ * See the
+ * official Java API doc for details.
+ * @param {string} message
+ * @class
+ * @extends java.lang.RuntimeException
+ */
+ var NegativeArraySizeException = /** @class */ (function (_super) {
+ __extends(NegativeArraySizeException, _super);
+ function NegativeArraySizeException(message) {
+ var _this = this;
+ if (((typeof message === 'string') || message === null)) {
+ var __args = arguments;
+ _this = _super.call(this, message) || this;
+ }
+ else if (message === undefined) {
+ var __args = arguments;
+ _this = _super.call(this) || this;
+ }
+ else
+ throw new Error('invalid overload');
+ return _this;
+ }
+ return NegativeArraySizeException;
+ }(java.lang.RuntimeException));
+ lang.NegativeArraySizeException = NegativeArraySizeException;
+ NegativeArraySizeException["__class"] = "java.lang.NegativeArraySizeException";
+ NegativeArraySizeException["__interfaces"] = ["java.io.Serializable"];
+ })(lang = java.lang || (java.lang = {}));
+})(java || (java = {}));
+(function (java) {
+ var lang;
+ (function (lang) {
+ /**
+ * See the
+ * official Java API doc for details.
+ * @param {string} message
+ * @class
+ * @extends java.lang.RuntimeException
+ */
+ var ArrayStoreException = /** @class */ (function (_super) {
+ __extends(ArrayStoreException, _super);
+ function ArrayStoreException(message) {
+ var _this = this;
+ if (((typeof message === 'string') || message === null)) {
+ var __args = arguments;
+ _this = _super.call(this, message) || this;
+ }
+ else if (message === undefined) {
+ var __args = arguments;
+ _this = _super.call(this) || this;
+ }
+ else
+ throw new Error('invalid overload');
+ return _this;
+ }
+ return ArrayStoreException;
+ }(java.lang.RuntimeException));
+ lang.ArrayStoreException = ArrayStoreException;
+ ArrayStoreException["__class"] = "java.lang.ArrayStoreException";
+ ArrayStoreException["__interfaces"] = ["java.io.Serializable"];
+ })(lang = java.lang || (java.lang = {}));
+})(java || (java = {}));
+(function (java) {
+ var lang;
+ (function (lang) {
+ /**
+ * NOTE: in GWT this is only thrown for division by zero on longs and
+ * BigInteger/BigDecimal.
+ * key,
+ * provided that key's hash code is hashCode; or
+ * null if no such Map.Entry exists at the specified hashCode.
+ * @param {*} key
+ * @return {*}
+ * @private
+ */
+ AbstractHashMap.prototype.getHashValue = function (key) {
+ return (util.AbstractMap.getEntryValueOrNull(this.hashCodeMap.getEntry(key)));
+ };
+ /**
+ * Returns the value for the given key in the stringMap. Returns
+ * null if the specified key does not exist.
+ * @param {string} key
+ * @return {*}
+ * @private
+ */
+ AbstractHashMap.prototype.getStringValue = function (key) {
+ return key == null ? this.getHashValue(null) : this.stringMap.get(key);
+ };
+ /**
+ * Returns true if the a key exists in the hashCodeMap that is Object equal
+ * to key, provided that key's hash code is
+ * hashCode.
+ * @param {*} key
+ * @return {boolean}
+ * @private
+ */
+ AbstractHashMap.prototype.hasHashValue = function (key) {
+ return this.hashCodeMap.getEntry(key) != null;
+ };
+ /**
+ * Returns true if the given key exists in the stringMap.
+ * @param {string} key
+ * @return {boolean}
+ * @private
+ */
+ AbstractHashMap.prototype.hasStringValue = function (key) {
+ return key == null ? this.hasHashValue(null) : this.stringMap.contains(key);
+ };
+ /**
+ * Sets the specified key to the specified value in the hashCodeMap. Returns
+ * the value previously at that key. Returns null if the
+ * specified key did not exist.
+ * @param {*} key
+ * @param {*} value
+ * @return {*}
+ * @private
+ */
+ AbstractHashMap.prototype.putHashValue = function (key, value) {
+ return this.hashCodeMap.put(key, value);
+ };
+ /**
+ * Sets the specified key to the specified value in the stringMap. Returns
+ * the value previously at that key. Returns null if the
+ * specified key did not exist.
+ * @param {string} key
+ * @param {*} value
+ * @return {*}
+ * @private
+ */
+ AbstractHashMap.prototype.putStringValue = function (key, value) {
+ return key == null ? this.putHashValue(null, value) : this.stringMap.put(key, value);
+ };
+ /**
+ * Removes the pair whose key is Object equal to key from
+ * hashCodeMap, provided that key's hash code is
+ * hashCode. Returns the value that was associated with the
+ * removed key, or null if no such key existed.
+ * @param {*} key
+ * @return {*}
+ * @private
+ */
+ AbstractHashMap.prototype.removeHashValue = function (key) {
+ return this.hashCodeMap.remove(key);
+ };
+ /**
+ * Removes the specified key from the stringMap and returns the value that
+ * was previously there. Returns null if the specified key does
+ * not exist.
+ * @param {string} key
+ * @return {*}
+ * @private
+ */
+ AbstractHashMap.prototype.removeStringValue = function (key) {
+ return key == null ? this.removeHashValue(null) : this.stringMap.remove(key);
+ };
+ return AbstractHashMap;
+ }(java.util.AbstractMap));
+ util.AbstractHashMap = AbstractHashMap;
+ AbstractHashMap["__class"] = "java.util.AbstractHashMap";
+ AbstractHashMap["__interfaces"] = ["java.util.Map"];
+ (function (AbstractHashMap) {
+ var EntrySet = /** @class */ (function (_super) {
+ __extends(EntrySet, _super);
+ function EntrySet(__parent) {
+ var _this = _super.call(this) || this;
+ _this.__parent = __parent;
+ return _this;
+ }
+ /**
+ *
+ */
+ EntrySet.prototype.clear = function () {
+ this.clear();
+ };
+ /**
+ *
+ * @param {*} o
+ * @return {boolean}
+ */
+ EntrySet.prototype.contains = function (o) {
+ if (o != null && (o["__interfaces"] != null && o["__interfaces"].indexOf("java.util.Map.Entry") >= 0 || o.constructor != null && o.constructor["__interfaces"] != null && o.constructor["__interfaces"].indexOf("java.util.Map.Entry") >= 0)) {
+ return this.__parent.containsEntry(o);
+ }
+ return false;
+ };
+ /**
+ *
+ * @return {*}
+ */
+ EntrySet.prototype.iterator = function () {
+ return new AbstractHashMap.EntrySetIterator(this.__parent);
+ };
+ /**
+ *
+ * @param {*} entry
+ * @return {boolean}
+ */
+ EntrySet.prototype.remove = function (entry) {
+ if (this.contains(entry)) {
+ var key = entry.getKey();
+ this.remove(key);
+ return true;
+ }
+ return false;
+ };
+ /**
+ *
+ * @return {number}
+ */
+ EntrySet.prototype.size = function () {
+ return this.size();
+ };
+ return EntrySet;
+ }(java.util.AbstractSet));
+ AbstractHashMap.EntrySet = EntrySet;
+ EntrySet["__class"] = "java.util.AbstractHashMap.EntrySet";
+ EntrySet["__interfaces"] = ["java.util.Collection", "java.util.Set", "java.lang.Iterable"];
+ /**
+ * Iterator for EntrySet.
+ * @class
+ */
+ var EntrySetIterator = /** @class */ (function () {
+ function EntrySetIterator(__parent) {
+ this.__parent = __parent;
+ if (this.stringMapEntries === undefined) {
+ this.stringMapEntries = null;
+ }
+ if (this.current === undefined) {
+ this.current = null;
+ }
+ if (this.last === undefined) {
+ this.last = null;
+ }
+ if (this.__hasNext === undefined) {
+ this.__hasNext = false;
+ }
+ this.stringMapEntries = __parent.stringMap.iterator();
+ this.current = this.stringMapEntries;
+ this.__hasNext = this.computeHasNext();
+ java.util.ConcurrentModificationDetector.recordLastKnownStructure(__parent, this);
+ }
+ /* Default method injected from java.util.Iterator */
+ EntrySetIterator.prototype.forEachRemaining = function (consumer) {
+ var _this = this;
+ javaemul.internal.InternalPreconditions.checkNotNull((consumer));
+ while ((this.hasNext())) {
+ {
+ (function (target) { return (typeof target === 'function') ? target(_this.next()) : target.accept(_this.next()); })(consumer);
+ }
+ }
+ ;
+ };
+ /**
+ *
+ * @return {boolean}
+ */
+ EntrySetIterator.prototype.hasNext = function () {
+ return this.__hasNext;
+ };
+ EntrySetIterator.prototype.computeHasNext = function () {
+ if (this.current.hasNext()) {
+ return true;
+ }
+ if (this.current !== this.stringMapEntries) {
+ return false;
+ }
+ this.current = this.__parent.hashCodeMap.iterator();
+ return this.current.hasNext();
+ };
+ /**
+ *
+ * @return {*}
+ */
+ EntrySetIterator.prototype.next = function () {
+ java.util.ConcurrentModificationDetector.checkStructuralChange(this.__parent, this);
+ javaemul.internal.InternalPreconditions.checkElement(this.hasNext());
+ this.last = this.current;
+ var rv = this.current.next();
+ this.__hasNext = this.computeHasNext();
+ return rv;
+ };
+ /**
+ *
+ */
+ EntrySetIterator.prototype.remove = function () {
+ javaemul.internal.InternalPreconditions.checkState(this.last != null);
+ java.util.ConcurrentModificationDetector.checkStructuralChange(this.__parent, this);
+ this.last.remove();
+ this.last = null;
+ this.__hasNext = this.computeHasNext();
+ java.util.ConcurrentModificationDetector.recordLastKnownStructure(this.__parent, this);
+ };
+ return EntrySetIterator;
+ }());
+ AbstractHashMap.EntrySetIterator = EntrySetIterator;
+ EntrySetIterator["__class"] = "java.util.AbstractHashMap.EntrySetIterator";
+ EntrySetIterator["__interfaces"] = ["java.util.Iterator"];
+ })(AbstractHashMap = util.AbstractHashMap || (util.AbstractHashMap = {}));
+ })(util = java.util || (java.util = {}));
+})(java || (java = {}));
+(function (java) {
+ var util;
+ (function (util) {
+ /**
+ * A {@link java.util.Map} of {@link Enum}s. [Sun
+ * docs]
+ *
+ * @param key as K. Only runtime checks that
+ * key is an Enum, not that it's the particular Enum K. Should only be called
+ * when you are sure key is of type K.
+ * @param {*} key
+ * @return {java.lang.Enum}
+ * @private
+ */
+ EnumMap.prototype.asKey = function (key) {
+ return key;
+ };
+ EnumMap.prototype.asOrdinal = function (key) {
+ return this.asKey(key).ordinal();
+ };
+ EnumMap.prototype.init$java_lang_Class = function (type) {
+ this.__keySet = java.util.EnumSet.noneOf(type);
+ this.__values = (function (s) { var a = []; while (s-- > 0)
+ a.push(null); return a; })(this.__keySet.capacity());
+ };
+ EnumMap.prototype.init = function (type) {
+ if (((type != null && type instanceof java.lang.Class) || type === null)) {
+ return this.init$java_lang_Class(type);
+ }
+ else if (((type != null && type instanceof java.util.EnumMap) || type === null)) {
+ return this.init$java_util_EnumMap(type);
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ EnumMap.prototype.init$java_util_EnumMap = function (m) {
+ this.__keySet = /* clone */ (function (o) { if (o.clone != undefined) {
+ return o.clone();
+ }
+ else {
+ var clone = Object.create(o);
+ for (var p in o) {
+ if (o.hasOwnProperty(p))
+ clone[p] = o[p];
+ }
+ return clone;
+ } })(m.__keySet);
+ this.__values = javaemul.internal.ArrayHelper.clone(m.__values, 0, m.__values.length);
+ };
+ EnumMap.prototype.set = function (ordinal, value) {
+ var was = this.__values[ordinal];
+ this.__values[ordinal] = value;
+ return was;
+ };
+ return EnumMap;
+ }(java.util.AbstractMap));
+ util.EnumMap = EnumMap;
+ EnumMap["__class"] = "java.util.EnumMap";
+ EnumMap["__interfaces"] = ["java.util.Map"];
+ (function (EnumMap) {
+ var EntrySet = /** @class */ (function (_super) {
+ __extends(EntrySet, _super);
+ function EntrySet(__parent) {
+ var _this = _super.call(this) || this;
+ _this.__parent = __parent;
+ return _this;
+ }
+ /**
+ *
+ */
+ EntrySet.prototype.clear = function () {
+ this.clear();
+ };
+ /**
+ *
+ * @param {*} o
+ * @return {boolean}
+ */
+ EntrySet.prototype.contains = function (o) {
+ if (o != null && (o["__interfaces"] != null && o["__interfaces"].indexOf("java.util.Map.Entry") >= 0 || o.constructor != null && o.constructor["__interfaces"] != null && o.constructor["__interfaces"].indexOf("java.util.Map.Entry") >= 0)) {
+ return this.__parent.containsEntry(o);
+ }
+ return false;
+ };
+ /**
+ *
+ * @return {*}
+ */
+ EntrySet.prototype.iterator = function () {
+ return new EnumMap.EntrySetIterator(this.__parent);
+ };
+ /**
+ *
+ * @param {*} entry
+ * @return {boolean}
+ */
+ EntrySet.prototype.remove = function (entry) {
+ if (this.contains(entry)) {
+ var key = entry.getKey();
+ this.remove(key);
+ return true;
+ }
+ return false;
+ };
+ /**
+ *
+ * @return {number}
+ */
+ EntrySet.prototype.size = function () {
+ return this.size();
+ };
+ return EntrySet;
+ }(java.util.AbstractSet));
+ EnumMap.EntrySet = EntrySet;
+ EntrySet["__class"] = "java.util.EnumMap.EntrySet";
+ EntrySet["__interfaces"] = ["java.util.Collection", "java.util.Set", "java.lang.Iterable"];
+ var EntrySetIterator = /** @class */ (function () {
+ function EntrySetIterator(__parent) {
+ this.__parent = __parent;
+ this.it = this.__parent.__keySet.iterator();
+ if (this.key === undefined) {
+ this.key = null;
+ }
+ }
+ /* Default method injected from java.util.Iterator */
+ EntrySetIterator.prototype.forEachRemaining = function (consumer) {
+ var _this = this;
+ javaemul.internal.InternalPreconditions.checkNotNull((consumer));
+ while ((this.hasNext())) {
+ {
+ (function (target) { return (typeof target === 'function') ? target(_this.next()) : target.accept(_this.next()); })(consumer);
+ }
+ }
+ ;
+ };
+ /**
+ *
+ * @return {boolean}
+ */
+ EntrySetIterator.prototype.hasNext = function () {
+ return this.it.hasNext();
+ };
+ /**
+ *
+ * @return {*}
+ */
+ EntrySetIterator.prototype.next = function () {
+ this.key = this.it.next();
+ return new EnumMap.MapEntry(this.__parent, this.key);
+ };
+ /**
+ *
+ */
+ EntrySetIterator.prototype.remove = function () {
+ javaemul.internal.InternalPreconditions.checkState(this.key != null);
+ this.__parent.remove(this.key);
+ this.key = null;
+ };
+ return EntrySetIterator;
+ }());
+ EnumMap.EntrySetIterator = EntrySetIterator;
+ EntrySetIterator["__class"] = "java.util.EnumMap.EntrySetIterator";
+ EntrySetIterator["__interfaces"] = ["java.util.Iterator"];
+ var MapEntry = /** @class */ (function (_super) {
+ __extends(MapEntry, _super);
+ function MapEntry(__parent, key) {
+ var _this = _super.call(this) || this;
+ _this.__parent = __parent;
+ if (_this.key === undefined) {
+ _this.key = null;
+ }
+ _this.key = key;
+ return _this;
+ }
+ /**
+ *
+ * @return {java.lang.Enum}
+ */
+ MapEntry.prototype.getKey = function () {
+ return this.key;
+ };
+ /**
+ *
+ * @return {*}
+ */
+ MapEntry.prototype.getValue = function () {
+ return this.__parent.__values[this.key.ordinal()];
+ };
+ /**
+ *
+ * @param {*} value
+ * @return {*}
+ */
+ MapEntry.prototype.setValue = function (value) {
+ return this.__parent.set(this.key.ordinal(), value);
+ };
+ return MapEntry;
+ }(java.util.AbstractMapEntry));
+ EnumMap.MapEntry = MapEntry;
+ MapEntry["__class"] = "java.util.EnumMap.MapEntry";
+ MapEntry["__interfaces"] = ["java.util.Map.Entry"];
+ })(EnumMap = util.EnumMap || (util.EnumMap = {}));
+ })(util = java.util || (java.util = {}));
+})(java || (java = {}));
+(function (java) {
+ var util;
+ (function (util) {
+ /**
+ * Skeletal implementation of a NavigableMap.
+ * @extends java.util.AbstractMap
+ * @class
+ */
+ var AbstractNavigableMap = /** @class */ (function (_super) {
+ __extends(AbstractNavigableMap, _super);
+ function AbstractNavigableMap() {
+ return _super.call(this) || this;
+ }
+ /* Default method injected from java.util.Map */
+ AbstractNavigableMap.prototype.getOrDefault = function (key, defaultValue) {
+ var v;
+ return (((v = this.get(key)) != null) || this.containsKey(key)) ? v : defaultValue;
+ };
+ /* Default method injected from java.util.Map */
+ AbstractNavigableMap.prototype.putIfAbsent = function (key, value) {
+ var v = this.get(key);
+ if (v == null) {
+ v = this.put(key, value);
+ }
+ return v;
+ };
+ /* Default method injected from java.util.Map */
+ AbstractNavigableMap.prototype.merge = function (key, value, map) {
+ var old = this.get(key);
+ var next = (old == null) ? value : (function (target) { return (typeof target === 'function') ? target(old, value) : target.apply(old, value); })(map);
+ if (next == null) {
+ this.remove(key);
+ }
+ else {
+ this.put(key, next);
+ }
+ return next;
+ };
+ /* Default method injected from java.util.Map */
+ AbstractNavigableMap.prototype.computeIfAbsent = function (key, mappingFunction) {
+ var result;
+ if ((result = this.get(key)) == null) {
+ result = (function (target) { return (typeof target === 'function') ? target(key) : target.apply(key); })(mappingFunction);
+ if (result != null)
+ this.put(key, result);
+ }
+ return result;
+ };
+ /* Default method injected from java.util.Map */
+ AbstractNavigableMap.prototype.replaceAll = function (__function) {
+ java.util.Objects.requireNonNull((__function));
+ var _loop_20 = function (index175) {
+ var entry = index175.next();
+ {
+ var k_2;
+ var v_2;
+ try {
+ k_2 = entry.getKey();
+ v_2 = entry.getValue();
+ }
+ catch (ise) {
+ throw new java.lang.RuntimeException(ise);
+ }
+ ;
+ v_2 = (function (target) { return (typeof target === 'function') ? target(k_2, v_2) : target.apply(k_2, v_2); })(__function);
+ try {
+ entry.setValue(v_2);
+ }
+ catch (ise) {
+ throw new java.lang.RuntimeException(ise);
+ }
+ ;
+ }
+ };
+ for (var index175 = this.entrySet().iterator(); index175.hasNext();) {
+ _loop_20(index175);
+ }
+ };
+ AbstractNavigableMap.copyOf = function (entry) {
+ return entry == null ? null : (new util.AbstractMap.SimpleImmutableEntry(entry));
+ };
+ AbstractNavigableMap.getKeyOrNSE = function (entry) {
+ if (entry == null) {
+ throw new java.util.NoSuchElementException();
+ }
+ return entry.getKey();
+ };
+ /**
+ *
+ * @param {*} key
+ * @return {*}
+ */
+ AbstractNavigableMap.prototype.ceilingEntry = function (key) {
+ return AbstractNavigableMap.copyOf(this.getCeilingEntry(key));
+ };
+ /**
+ *
+ * @param {*} key
+ * @return {*}
+ */
+ AbstractNavigableMap.prototype.ceilingKey = function (key) {
+ return (util.AbstractMap.getEntryKeyOrNull(this.getCeilingEntry(key)));
+ };
+ /**
+ *
+ * @param {*} k
+ * @return {boolean}
+ */
+ AbstractNavigableMap.prototype.containsKey = function (k) {
+ var key = k;
+ return this.getEntry(key) != null;
+ };
+ /**
+ *
+ * @return {*}
+ */
+ AbstractNavigableMap.prototype.descendingKeySet = function () {
+ return this.descendingMap().navigableKeySet();
+ };
+ /**
+ *
+ * @return {*}
+ */
+ AbstractNavigableMap.prototype.descendingMap = function () {
+ return new AbstractNavigableMap.DescendingMap(this);
+ };
+ /**
+ *
+ * @return {*}
+ */
+ AbstractNavigableMap.prototype.entrySet = function () {
+ return new AbstractNavigableMap.EntrySet(this);
+ };
+ /**
+ *
+ * @return {*}
+ */
+ AbstractNavigableMap.prototype.firstEntry = function () {
+ return AbstractNavigableMap.copyOf(this.getFirstEntry());
+ };
+ /**
+ *
+ * @return {*}
+ */
+ AbstractNavigableMap.prototype.firstKey = function () {
+ return (AbstractNavigableMap.getKeyOrNSE(this.getFirstEntry()));
+ };
+ /**
+ *
+ * @param {*} key
+ * @return {*}
+ */
+ AbstractNavigableMap.prototype.floorEntry = function (key) {
+ return AbstractNavigableMap.copyOf(this.getFloorEntry(key));
+ };
+ /**
+ *
+ * @param {*} key
+ * @return {*}
+ */
+ AbstractNavigableMap.prototype.floorKey = function (key) {
+ return (util.AbstractMap.getEntryKeyOrNull(this.getFloorEntry(key)));
+ };
+ /**
+ *
+ * @param {*} k
+ * @return {*}
+ */
+ AbstractNavigableMap.prototype.get = function (k) {
+ var key = k;
+ return (util.AbstractMap.getEntryValueOrNull(this.getEntry(key)));
+ };
+ AbstractNavigableMap.prototype.headMap = function (toKey, inclusive) {
+ if (((toKey != null) || toKey === null) && inclusive === undefined) {
+ return this.headMap$java_lang_Object(toKey);
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ AbstractNavigableMap.prototype.headMap$java_lang_Object = function (toKey) {
+ return this.headMap(toKey, false);
+ };
+ /**
+ *
+ * @param {*} key
+ * @return {*}
+ */
+ AbstractNavigableMap.prototype.higherEntry = function (key) {
+ return AbstractNavigableMap.copyOf(this.getHigherEntry(key));
+ };
+ /**
+ *
+ * @param {*} key
+ * @return {*}
+ */
+ AbstractNavigableMap.prototype.higherKey = function (key) {
+ return (util.AbstractMap.getEntryKeyOrNull(this.getHigherEntry(key)));
+ };
+ /**
+ *
+ * @return {*}
+ */
+ AbstractNavigableMap.prototype.keySet = function () {
+ return this.navigableKeySet();
+ };
+ /**
+ *
+ * @return {*}
+ */
+ AbstractNavigableMap.prototype.lastEntry = function () {
+ return AbstractNavigableMap.copyOf(this.getLastEntry());
+ };
+ /**
+ *
+ * @return {*}
+ */
+ AbstractNavigableMap.prototype.lastKey = function () {
+ return (AbstractNavigableMap.getKeyOrNSE(this.getLastEntry()));
+ };
+ /**
+ *
+ * @param {*} key
+ * @return {*}
+ */
+ AbstractNavigableMap.prototype.lowerEntry = function (key) {
+ return AbstractNavigableMap.copyOf(this.getLowerEntry(key));
+ };
+ /**
+ *
+ * @param {*} key
+ * @return {*}
+ */
+ AbstractNavigableMap.prototype.lowerKey = function (key) {
+ return (util.AbstractMap.getEntryKeyOrNull(this.getLowerEntry(key)));
+ };
+ /**
+ *
+ * @return {*}
+ */
+ AbstractNavigableMap.prototype.navigableKeySet = function () {
+ return (new AbstractNavigableMap.NavigableKeySet(this));
+ };
+ /**
+ *
+ * @return {*}
+ */
+ AbstractNavigableMap.prototype.pollFirstEntry = function () {
+ return this.pollEntry(this.getFirstEntry());
+ };
+ /**
+ *
+ * @return {*}
+ */
+ AbstractNavigableMap.prototype.pollLastEntry = function () {
+ return this.pollEntry(this.getLastEntry());
+ };
+ AbstractNavigableMap.prototype.subMap = function (fromKey, fromInclusive, toKey, toInclusive) {
+ if (((fromKey != null) || fromKey === null) && ((fromInclusive != null) || fromInclusive === null) && toKey === undefined && toInclusive === undefined) {
+ return this.subMap$java_lang_Object$java_lang_Object(fromKey, fromInclusive);
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ AbstractNavigableMap.prototype.subMap$java_lang_Object$java_lang_Object = function (fromKey, toKey) {
+ return this.subMap(fromKey, true, toKey, false);
+ };
+ AbstractNavigableMap.prototype.tailMap = function (fromKey, inclusive) {
+ if (((fromKey != null) || fromKey === null) && inclusive === undefined) {
+ return this.tailMap$java_lang_Object(fromKey);
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ AbstractNavigableMap.prototype.tailMap$java_lang_Object = function (fromKey) {
+ return this.tailMap(fromKey, true);
+ };
+ /**
+ *
+ * @param {*} entry
+ * @return {boolean}
+ */
+ AbstractNavigableMap.prototype.containsEntry = function (entry) {
+ var key = entry.getKey();
+ var lookupEntry = this.getEntry(key);
+ return lookupEntry != null && java.util.Objects.equals(lookupEntry.getValue(), entry.getValue());
+ };
+ AbstractNavigableMap.prototype.pollEntry = function (entry) {
+ if (entry != null) {
+ this.removeEntry(entry);
+ }
+ return AbstractNavigableMap.copyOf(entry);
+ };
+ return AbstractNavigableMap;
+ }(java.util.AbstractMap));
+ util.AbstractNavigableMap = AbstractNavigableMap;
+ AbstractNavigableMap["__class"] = "java.util.AbstractNavigableMap";
+ AbstractNavigableMap["__interfaces"] = ["java.util.Map", "java.util.NavigableMap", "java.util.SortedMap"];
+ (function (AbstractNavigableMap) {
+ var DescendingMap = /** @class */ (function (_super) {
+ __extends(DescendingMap, _super);
+ function DescendingMap(__parent) {
+ var _this = _super.call(this) || this;
+ _this.__parent = __parent;
+ return _this;
+ }
+ /**
+ *
+ */
+ DescendingMap.prototype.clear = function () {
+ this.ascendingMap().clear();
+ };
+ /**
+ *
+ * @return {*}
+ */
+ DescendingMap.prototype.comparator = function () {
+ return (java.util.Collections.reverseOrder$java_util_Comparator((this.ascendingMap().comparator())));
+ };
+ /**
+ *
+ * @return {*}
+ */
+ DescendingMap.prototype.descendingMap = function () {
+ return this.ascendingMap();
+ };
+ DescendingMap.prototype.headMap$java_lang_Object$boolean = function (toKey, inclusive) {
+ return this.ascendingMap().tailMap(toKey, inclusive).descendingMap();
+ };
+ /**
+ *
+ * @param {*} toKey
+ * @param {boolean} inclusive
+ * @return {*}
+ */
+ DescendingMap.prototype.headMap = function (toKey, inclusive) {
+ if (((toKey != null) || toKey === null) && ((typeof inclusive === 'boolean') || inclusive === null)) {
+ return this.headMap$java_lang_Object$boolean(toKey, inclusive);
+ }
+ else if (((toKey != null) || toKey === null) && inclusive === undefined) {
+ return this.headMap$java_lang_Object(toKey);
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ /**
+ *
+ * @param {*} key
+ * @param {*} value
+ * @return {*}
+ */
+ DescendingMap.prototype.put = function (key, value) {
+ return this.ascendingMap().put(key, value);
+ };
+ /**
+ *
+ * @param {*} key
+ * @return {*}
+ */
+ DescendingMap.prototype.remove = function (key) {
+ return this.ascendingMap().remove(key);
+ };
+ /**
+ *
+ * @return {number}
+ */
+ DescendingMap.prototype.size = function () {
+ return this.ascendingMap().size();
+ };
+ DescendingMap.prototype.subMap$java_lang_Object$boolean$java_lang_Object$boolean = function (fromKey, fromInclusive, toKey, toInclusive) {
+ return this.ascendingMap().subMap(toKey, toInclusive, fromKey, fromInclusive).descendingMap();
+ };
+ /**
+ *
+ * @param {*} fromKey
+ * @param {boolean} fromInclusive
+ * @param {*} toKey
+ * @param {boolean} toInclusive
+ * @return {*}
+ */
+ DescendingMap.prototype.subMap = function (fromKey, fromInclusive, toKey, toInclusive) {
+ if (((fromKey != null) || fromKey === null) && ((typeof fromInclusive === 'boolean') || fromInclusive === null) && ((toKey != null) || toKey === null) && ((typeof toInclusive === 'boolean') || toInclusive === null)) {
+ return this.subMap$java_lang_Object$boolean$java_lang_Object$boolean(fromKey, fromInclusive, toKey, toInclusive);
+ }
+ else if (((fromKey != null) || fromKey === null) && ((fromInclusive != null) || fromInclusive === null) && toKey === undefined && toInclusive === undefined) {
+ return this.subMap$java_lang_Object$java_lang_Object(fromKey, fromInclusive);
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ DescendingMap.prototype.tailMap$java_lang_Object$boolean = function (fromKey, inclusive) {
+ return this.ascendingMap().headMap(fromKey, inclusive).descendingMap();
+ };
+ /**
+ *
+ * @param {*} fromKey
+ * @param {boolean} inclusive
+ * @return {*}
+ */
+ DescendingMap.prototype.tailMap = function (fromKey, inclusive) {
+ if (((fromKey != null) || fromKey === null) && ((typeof inclusive === 'boolean') || inclusive === null)) {
+ return this.tailMap$java_lang_Object$boolean(fromKey, inclusive);
+ }
+ else if (((fromKey != null) || fromKey === null) && inclusive === undefined) {
+ return this.tailMap$java_lang_Object(fromKey);
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ DescendingMap.prototype.ascendingMap = function () {
+ return this.__parent;
+ };
+ /**
+ *
+ * @return {*}
+ */
+ DescendingMap.prototype.descendingEntryIterator = function () {
+ return this.ascendingMap().entryIterator();
+ };
+ /**
+ *
+ * @return {*}
+ */
+ DescendingMap.prototype.entryIterator = function () {
+ return this.ascendingMap().descendingEntryIterator();
+ };
+ /**
+ *
+ * @param {*} key
+ * @return {*}
+ */
+ DescendingMap.prototype.getEntry = function (key) {
+ return this.ascendingMap().getEntry(key);
+ };
+ /**
+ *
+ * @return {*}
+ */
+ DescendingMap.prototype.getFirstEntry = function () {
+ return this.ascendingMap().getLastEntry();
+ };
+ /**
+ *
+ * @return {*}
+ */
+ DescendingMap.prototype.getLastEntry = function () {
+ return this.ascendingMap().getFirstEntry();
+ };
+ /**
+ *
+ * @param {*} key
+ * @return {*}
+ */
+ DescendingMap.prototype.getCeilingEntry = function (key) {
+ return this.ascendingMap().getFloorEntry(key);
+ };
+ /**
+ *
+ * @param {*} key
+ * @return {*}
+ */
+ DescendingMap.prototype.getFloorEntry = function (key) {
+ return this.ascendingMap().getCeilingEntry(key);
+ };
+ /**
+ *
+ * @param {*} key
+ * @return {*}
+ */
+ DescendingMap.prototype.getHigherEntry = function (key) {
+ return this.ascendingMap().getLowerEntry(key);
+ };
+ /**
+ *
+ * @param {*} key
+ * @return {*}
+ */
+ DescendingMap.prototype.getLowerEntry = function (key) {
+ return this.ascendingMap().getHigherEntry(key);
+ };
+ /**
+ *
+ * @param {*} entry
+ * @return {boolean}
+ */
+ DescendingMap.prototype.removeEntry = function (entry) {
+ return this.ascendingMap().removeEntry(entry);
+ };
+ return DescendingMap;
+ }(java.util.AbstractNavigableMap));
+ AbstractNavigableMap.DescendingMap = DescendingMap;
+ DescendingMap["__class"] = "java.util.AbstractNavigableMap.DescendingMap";
+ DescendingMap["__interfaces"] = ["java.util.Map", "java.util.NavigableMap", "java.util.SortedMap"];
+ var EntrySet = /** @class */ (function (_super) {
+ __extends(EntrySet, _super);
+ function EntrySet(__parent) {
+ var _this = _super.call(this) || this;
+ _this.__parent = __parent;
+ return _this;
+ }
+ /**
+ *
+ * @param {*} o
+ * @return {boolean}
+ */
+ EntrySet.prototype.contains = function (o) {
+ return (o != null && (o["__interfaces"] != null && o["__interfaces"].indexOf("java.util.Map.Entry") >= 0 || o.constructor != null && o.constructor["__interfaces"] != null && o.constructor["__interfaces"].indexOf("java.util.Map.Entry") >= 0)) && this.__parent.containsEntry(o);
+ };
+ /**
+ *
+ * @return {*}
+ */
+ EntrySet.prototype.iterator = function () {
+ return this.__parent.entryIterator();
+ };
+ /**
+ *
+ * @param {*} o
+ * @return {boolean}
+ */
+ EntrySet.prototype.remove = function (o) {
+ if (o != null && (o["__interfaces"] != null && o["__interfaces"].indexOf("java.util.Map.Entry") >= 0 || o.constructor != null && o.constructor["__interfaces"] != null && o.constructor["__interfaces"].indexOf("java.util.Map.Entry") >= 0)) {
+ var entry = o;
+ return this.__parent.removeEntry(entry);
+ }
+ return false;
+ };
+ /**
+ *
+ * @return {number}
+ */
+ EntrySet.prototype.size = function () {
+ return this.size();
+ };
+ return EntrySet;
+ }(java.util.AbstractSet));
+ AbstractNavigableMap.EntrySet = EntrySet;
+ EntrySet["__class"] = "java.util.AbstractNavigableMap.EntrySet";
+ EntrySet["__interfaces"] = ["java.util.Collection", "java.util.Set", "java.lang.Iterable"];
+ var NavigableKeySet = /** @class */ (function (_super) {
+ __extends(NavigableKeySet, _super);
+ function NavigableKeySet(map) {
+ var _this = _super.call(this) || this;
+ if (_this.map === undefined) {
+ _this.map = null;
+ }
+ _this.map = map;
+ return _this;
+ }
+ /* Default method injected from java.util.Collection */
+ NavigableKeySet.prototype.removeIf = function (filter) {
+ javaemul.internal.InternalPreconditions.checkNotNull((filter));
+ var removed = false;
+ var _loop_21 = function (it) {
+ {
+ if ((function (target) { return (typeof target === 'function') ? target(it.next()) : target.test(it.next()); })(filter)) {
+ it.remove();
+ removed = true;
+ }
+ }
+ ;
+ };
+ for (var it = this.iterator(); it.hasNext();) {
+ _loop_21(it);
+ }
+ return removed;
+ };
+ /* Default method injected from java.util.Collection */
+ NavigableKeySet.prototype.stream = function () {
+ return (new javaemul.internal.stream.StreamHelper(this));
+ };
+ /* Default method injected from java.util.Collection */
+ NavigableKeySet.prototype.parallelStream = function () {
+ return this.stream();
+ };
+ /* Default method injected from java.lang.Iterable */
+ NavigableKeySet.prototype.forEach = function (action) {
+ javaemul.internal.InternalPreconditions.checkNotNull((action));
+ var _loop_22 = function (index176) {
+ var t = index176.next();
+ {
+ (function (target) { return (typeof target === 'function') ? target(t) : target.accept(t); })(action);
+ }
+ };
+ for (var index176 = this.iterator(); index176.hasNext();) {
+ _loop_22(index176);
+ }
+ };
+ /**
+ *
+ * @param {*} k
+ * @return {*}
+ */
+ NavigableKeySet.prototype.ceiling = function (k) {
+ return this.map.ceilingKey(k);
+ };
+ /**
+ *
+ */
+ NavigableKeySet.prototype.clear = function () {
+ this.map.clear();
+ };
+ /**
+ *
+ * @return {*}
+ */
+ NavigableKeySet.prototype.comparator = function () {
+ return (this.map.comparator());
+ };
+ /**
+ *
+ * @param {*} o
+ * @return {boolean}
+ */
+ NavigableKeySet.prototype.contains = function (o) {
+ return this.map.containsKey(o);
+ };
+ /**
+ *
+ * @return {*}
+ */
+ NavigableKeySet.prototype.descendingIterator = function () {
+ return this.descendingSet().iterator();
+ };
+ /**
+ *
+ * @return {*}
+ */
+ NavigableKeySet.prototype.descendingSet = function () {
+ return this.map.descendingMap().navigableKeySet();
+ };
+ /**
+ *
+ * @return {*}
+ */
+ NavigableKeySet.prototype.first = function () {
+ return this.map.firstKey();
+ };
+ /**
+ *
+ * @param {*} k
+ * @return {*}
+ */
+ NavigableKeySet.prototype.floor = function (k) {
+ return this.map.floorKey(k);
+ };
+ NavigableKeySet.prototype.headSet$java_lang_Object = function (toElement) {
+ return this.headSet(toElement, false);
+ };
+ NavigableKeySet.prototype.headSet$java_lang_Object$boolean = function (toElement, inclusive) {
+ return this.map.headMap(toElement, inclusive).navigableKeySet();
+ };
+ /**
+ *
+ * @param {*} toElement
+ * @param {boolean} inclusive
+ * @return {*}
+ */
+ NavigableKeySet.prototype.headSet = function (toElement, inclusive) {
+ if (((toElement != null) || toElement === null) && ((typeof inclusive === 'boolean') || inclusive === null)) {
+ return this.headSet$java_lang_Object$boolean(toElement, inclusive);
+ }
+ else if (((toElement != null) || toElement === null) && inclusive === undefined) {
+ return this.headSet$java_lang_Object(toElement);
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ /**
+ *
+ * @param {*} k
+ * @return {*}
+ */
+ NavigableKeySet.prototype.higher = function (k) {
+ return this.map.higherKey(k);
+ };
+ /**
+ *
+ * @return {*}
+ */
+ NavigableKeySet.prototype.iterator = function () {
+ var entryIterator = this.map.entrySet().iterator();
+ return new NavigableKeySet.NavigableKeySet$0(this, entryIterator);
+ };
+ /**
+ *
+ * @return {*}
+ */
+ NavigableKeySet.prototype.last = function () {
+ return this.map.lastKey();
+ };
+ /**
+ *
+ * @param {*} k
+ * @return {*}
+ */
+ NavigableKeySet.prototype.lower = function (k) {
+ return this.map.lowerKey(k);
+ };
+ /**
+ *
+ * @return {*}
+ */
+ NavigableKeySet.prototype.pollFirst = function () {
+ return (util.AbstractMap.getEntryKeyOrNull(this.map.pollFirstEntry()));
+ };
+ /**
+ *
+ * @return {*}
+ */
+ NavigableKeySet.prototype.pollLast = function () {
+ return (util.AbstractMap.getEntryKeyOrNull(this.map.pollLastEntry()));
+ };
+ /**
+ *
+ * @param {*} o
+ * @return {boolean}
+ */
+ NavigableKeySet.prototype.remove = function (o) {
+ if (this.map.containsKey(o)) {
+ this.map.remove(o);
+ return true;
+ }
+ return false;
+ };
+ /**
+ *
+ * @return {number}
+ */
+ NavigableKeySet.prototype.size = function () {
+ return this.map.size();
+ };
+ NavigableKeySet.prototype.subSet$java_lang_Object$boolean$java_lang_Object$boolean = function (fromElement, fromInclusive, toElement, toInclusive) {
+ return this.map.subMap(fromElement, fromInclusive, toElement, toInclusive).navigableKeySet();
+ };
+ /**
+ *
+ * @param {*} fromElement
+ * @param {boolean} fromInclusive
+ * @param {*} toElement
+ * @param {boolean} toInclusive
+ * @return {*}
+ */
+ NavigableKeySet.prototype.subSet = function (fromElement, fromInclusive, toElement, toInclusive) {
+ if (((fromElement != null) || fromElement === null) && ((typeof fromInclusive === 'boolean') || fromInclusive === null) && ((toElement != null) || toElement === null) && ((typeof toInclusive === 'boolean') || toInclusive === null)) {
+ return this.subSet$java_lang_Object$boolean$java_lang_Object$boolean(fromElement, fromInclusive, toElement, toInclusive);
+ }
+ else if (((fromElement != null) || fromElement === null) && ((fromInclusive != null) || fromInclusive === null) && toElement === undefined && toInclusive === undefined) {
+ return this.subSet$java_lang_Object$java_lang_Object(fromElement, fromInclusive);
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ NavigableKeySet.prototype.subSet$java_lang_Object$java_lang_Object = function (fromElement, toElement) {
+ return this.subSet(fromElement, true, toElement, false);
+ };
+ NavigableKeySet.prototype.tailSet$java_lang_Object = function (fromElement) {
+ return this.tailSet(fromElement, true);
+ };
+ NavigableKeySet.prototype.tailSet$java_lang_Object$boolean = function (fromElement, inclusive) {
+ return this.map.tailMap(fromElement, inclusive).navigableKeySet();
+ };
+ /**
+ *
+ * @param {*} fromElement
+ * @param {boolean} inclusive
+ * @return {*}
+ */
+ NavigableKeySet.prototype.tailSet = function (fromElement, inclusive) {
+ if (((fromElement != null) || fromElement === null) && ((typeof inclusive === 'boolean') || inclusive === null)) {
+ return this.tailSet$java_lang_Object$boolean(fromElement, inclusive);
+ }
+ else if (((fromElement != null) || fromElement === null) && inclusive === undefined) {
+ return this.tailSet$java_lang_Object(fromElement);
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ return NavigableKeySet;
+ }(java.util.AbstractSet));
+ AbstractNavigableMap.NavigableKeySet = NavigableKeySet;
+ NavigableKeySet["__class"] = "java.util.AbstractNavigableMap.NavigableKeySet";
+ NavigableKeySet["__interfaces"] = ["java.util.SortedSet", "java.util.Collection", "java.util.Set", "java.util.NavigableSet", "java.lang.Iterable"];
+ (function (NavigableKeySet) {
+ var NavigableKeySet$0 = /** @class */ (function () {
+ function NavigableKeySet$0(__parent, entryIterator) {
+ this.entryIterator = entryIterator;
+ this.__parent = __parent;
+ }
+ /* Default method injected from java.util.Iterator */
+ NavigableKeySet$0.prototype.forEachRemaining = function (consumer) {
+ var _this = this;
+ javaemul.internal.InternalPreconditions.checkNotNull((consumer));
+ while ((this.hasNext())) {
+ {
+ (function (target) { return (typeof target === 'function') ? target(_this.next()) : target.accept(_this.next()); })(consumer);
+ }
+ }
+ ;
+ };
+ /**
+ *
+ * @return {boolean}
+ */
+ NavigableKeySet$0.prototype.hasNext = function () {
+ return this.entryIterator.hasNext();
+ };
+ /**
+ *
+ * @return {*}
+ */
+ NavigableKeySet$0.prototype.next = function () {
+ var entry = this.entryIterator.next();
+ return entry.getKey();
+ };
+ /**
+ *
+ */
+ NavigableKeySet$0.prototype.remove = function () {
+ this.entryIterator.remove();
+ };
+ return NavigableKeySet$0;
+ }());
+ NavigableKeySet.NavigableKeySet$0 = NavigableKeySet$0;
+ NavigableKeySet$0["__interfaces"] = ["java.util.Iterator"];
+ })(NavigableKeySet = AbstractNavigableMap.NavigableKeySet || (AbstractNavigableMap.NavigableKeySet = {}));
+ })(AbstractNavigableMap = util.AbstractNavigableMap || (util.AbstractNavigableMap = {}));
+ })(util = java.util || (java.util = {}));
+})(java || (java = {}));
+(function (java) {
+ var util;
+ (function (util) {
+ /**
+ * Utility methods that operate on collections. [Sun
+ * docs]
+ * @class
+ */
+ var Collections = /** @class */ (function () {
+ function Collections() {
+ }
+ Collections.EMPTY_LIST_$LI$ = function () { if (Collections.EMPTY_LIST == null) {
+ Collections.EMPTY_LIST = new Collections.EmptyList();
+ } return Collections.EMPTY_LIST; };
+ ;
+ Collections.EMPTY_MAP_$LI$ = function () { if (Collections.EMPTY_MAP == null) {
+ Collections.EMPTY_MAP = new Collections.EmptyMap();
+ } return Collections.EMPTY_MAP; };
+ ;
+ Collections.EMPTY_SET_$LI$ = function () { if (Collections.EMPTY_SET == null) {
+ Collections.EMPTY_SET = new Collections.EmptySet();
+ } return Collections.EMPTY_SET; };
+ ;
+ Collections.addAll = function (c) {
+ var a = [];
+ for (var _i = 1; _i < arguments.length; _i++) {
+ a[_i - 1] = arguments[_i];
+ }
+ var result = false;
+ for (var index177 = 0; index177 < a.length; index177++) {
+ var e = a[index177];
+ {
+ result = c.add(e) || result;
+ }
+ }
+ return result;
+ };
+ Collections.asLifoQueue = function (deque) {
+ return (new Collections.LifoQueue(deque));
+ };
+ Collections.binarySearch$java_util_List$java_lang_Object = function (sortedList, key) {
+ return Collections.binarySearch(sortedList, key, (null));
+ };
+ Collections.binarySearch$java_util_List$java_lang_Object$java_util_Comparator = function (sortedList, key, comparator) {
+ if (comparator == null) {
+ comparator = (java.util.Comparators.natural());
+ }
+ var low = 0;
+ var high = sortedList.size() - 1;
+ while ((low <= high)) {
+ {
+ var mid = low + ((high - low) >> 1);
+ var midVal = sortedList.get(mid);
+ var compareResult = ((function (target) { return (target['compare'] === undefined) ? target : target['compare']; })(comparator))(midVal, key);
+ if (compareResult < 0) {
+ low = mid + 1;
+ }
+ else if (compareResult > 0) {
+ high = mid - 1;
+ }
+ else {
+ return mid;
+ }
+ }
+ }
+ ;
+ return -low - 1;
+ };
+ /**
+ * Perform a binary search on a sorted List, using a user-specified comparison
+ * function.
+ *
+ * null indicates natural
+ * ordering should be used.
+ * @return {number} the index of an element with a matching value, or a negative number
+ * which is the index of the next larger value (or just past the end of
+ * the array if the searched value is larger than all elements in the
+ * array) minus 1 (to ensure error returns are negative)
+ * @throws ClassCastException
+ * if key and sortedList's elements cannot
+ * be compared by comparator.
+ */
+ Collections.binarySearch = function (sortedList, key, comparator) {
+ if (((sortedList != null && (sortedList["__interfaces"] != null && sortedList["__interfaces"].indexOf("java.util.List") >= 0 || sortedList.constructor != null && sortedList.constructor["__interfaces"] != null && sortedList.constructor["__interfaces"].indexOf("java.util.List") >= 0)) || sortedList === null) && ((key != null) || key === null) && ((typeof comparator === 'function' && comparator.length === 2) || comparator === null)) {
+ return java.util.Collections.binarySearch$java_util_List$java_lang_Object$java_util_Comparator(sortedList, key, comparator);
+ }
+ else if (((sortedList != null && (sortedList["__interfaces"] != null && sortedList["__interfaces"].indexOf("java.util.List") >= 0 || sortedList.constructor != null && sortedList.constructor["__interfaces"] != null && sortedList.constructor["__interfaces"].indexOf("java.util.List") >= 0)) || sortedList === null) && ((key != null) || key === null) && comparator === undefined) {
+ return java.util.Collections.binarySearch$java_util_List$java_lang_Object(sortedList, key);
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ Collections.copy = function (dest, src) {
+ if (src.size() > dest.size()) {
+ throw new java.lang.IndexOutOfBoundsException("src does not fit in dest");
+ }
+ var destIt = dest['listIterator$']();
+ for (var index178 = src.iterator(); index178.hasNext();) {
+ var e = index178.next();
+ {
+ destIt.next();
+ destIt.set(e);
+ }
+ }
+ };
+ Collections.disjoint = function (c1, c2) {
+ var iterating = c1;
+ var testing = c2;
+ if ((c1 != null && (c1["__interfaces"] != null && c1["__interfaces"].indexOf("java.util.Set") >= 0 || c1.constructor != null && c1.constructor["__interfaces"] != null && c1.constructor["__interfaces"].indexOf("java.util.Set") >= 0)) && !(c2 != null && (c2["__interfaces"] != null && c2["__interfaces"].indexOf("java.util.Set") >= 0 || c2.constructor != null && c2.constructor["__interfaces"] != null && c2.constructor["__interfaces"].indexOf("java.util.Set") >= 0))) {
+ iterating = c2;
+ testing = c1;
+ }
+ for (var index179 = iterating.iterator(); index179.hasNext();) {
+ var o = index179.next();
+ {
+ if (testing.contains(o)) {
+ return false;
+ }
+ }
+ }
+ return true;
+ };
+ Collections.emptyIterator = function () {
+ return Collections.EmptyListIterator.INSTANCE_$LI$();
+ };
+ Collections.emptyList = function () {
+ return Collections.EMPTY_LIST_$LI$();
+ };
+ Collections.emptyListIterator = function () {
+ return Collections.EmptyListIterator.INSTANCE_$LI$();
+ };
+ Collections.emptyMap = function () {
+ return Collections.EMPTY_MAP_$LI$();
+ };
+ Collections.emptySet = function () {
+ return Collections.EMPTY_SET_$LI$();
+ };
+ Collections.enumeration = function (c) {
+ var it = c.iterator();
+ return new Collections.Collections$0(it);
+ };
+ Collections.fill = function (list, obj) {
+ for (var it = list['listIterator$'](); it.hasNext();) {
+ {
+ it.next();
+ it.set(obj);
+ }
+ ;
+ }
+ };
+ Collections.frequency = function (c, o) {
+ var count = 0;
+ for (var index180 = c.iterator(); index180.hasNext();) {
+ var e = index180.next();
+ {
+ if (java.util.Objects.equals(o, e)) {
+ ++count;
+ }
+ }
+ }
+ return count;
+ };
+ Collections.list = function (e) {
+ var arrayList = (new java.util.ArrayList());
+ while ((e.hasMoreElements())) {
+ {
+ arrayList.add(e.nextElement());
+ }
+ }
+ ;
+ return arrayList;
+ };
+ Collections.max$java_util_Collection = function (coll) {
+ return (Collections.max$java_util_Collection$java_util_Comparator(coll, (null)));
+ };
+ Collections.max$java_util_Collection$java_util_Comparator = function (coll, comp) {
+ if (comp == null) {
+ comp = (java.util.Comparators.natural());
+ }
+ var it = coll.iterator();
+ var max = it.next();
+ while ((it.hasNext())) {
+ {
+ var t = it.next();
+ if (((function (target) { return (target['compare'] === undefined) ? target : target['compare']; })(comp))(t, max) > 0) {
+ max = t;
+ }
+ }
+ }
+ ;
+ return max;
+ };
+ Collections.max = function (coll, comp) {
+ if (((coll != null && (coll["__interfaces"] != null && coll["__interfaces"].indexOf("java.util.Collection") >= 0 || coll.constructor != null && coll.constructor["__interfaces"] != null && coll.constructor["__interfaces"].indexOf("java.util.Collection") >= 0)) || coll === null) && ((typeof comp === 'function' && comp.length === 2) || comp === null)) {
+ return java.util.Collections.max$java_util_Collection$java_util_Comparator(coll, comp);
+ }
+ else if (((coll != null && (coll["__interfaces"] != null && coll["__interfaces"].indexOf("java.util.Collection") >= 0 || coll.constructor != null && coll.constructor["__interfaces"] != null && coll.constructor["__interfaces"].indexOf("java.util.Collection") >= 0)) || coll === null) && comp === undefined) {
+ return java.util.Collections.max$java_util_Collection(coll);
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ Collections.min = function (coll, comp) {
+ if (comp === void 0) { comp = null; }
+ return (Collections.max$java_util_Collection$java_util_Comparator(coll, (Collections.reverseOrder$java_util_Comparator((comp)))));
+ };
+ Collections.newSetFromMap = function (map) {
+ javaemul.internal.InternalPreconditions.checkArgument(map.isEmpty(), "map is not empty");
+ return (new Collections.SetFromMap(map));
+ };
+ Collections.nCopies = function (n, o) {
+ var list = (new java.util.ArrayList());
+ for (var i = 0; i < n; ++i) {
+ {
+ list.add(o);
+ }
+ ;
+ }
+ return Collections.unmodifiableList(list);
+ };
+ Collections.replaceAll = function (list, oldVal, newVal) {
+ var modified = false;
+ for (var it = list['listIterator$'](); it.hasNext();) {
+ {
+ var t = it.next();
+ if (java.util.Objects.equals(t, oldVal)) {
+ it.set(newVal);
+ modified = true;
+ }
+ }
+ ;
+ }
+ return modified;
+ };
+ Collections.reverse = function (l) {
+ if (l != null && (l["__interfaces"] != null && l["__interfaces"].indexOf("java.util.RandomAccess") >= 0 || l.constructor != null && l.constructor["__interfaces"] != null && l.constructor["__interfaces"].indexOf("java.util.RandomAccess") >= 0)) {
+ for (var iFront = 0, iBack = l.size() - 1; iFront < iBack; ++iFront, --iBack) {
+ {
+ Collections.swap(l, iFront, iBack);
+ }
+ ;
+ }
+ }
+ else {
+ var head = l['listIterator$']();
+ var tail = l['listIterator$int'](l.size());
+ while ((head.nextIndex() < tail.previousIndex())) {
+ {
+ var headElem = head.next();
+ var tailElem = tail.previous();
+ head.set(tailElem);
+ tail.set(headElem);
+ }
+ }
+ ;
+ }
+ };
+ Collections.reverseOrder$ = function () {
+ return Collections.ReverseComparator.INSTANCE_$LI$();
+ };
+ Collections.reverseOrder$java_util_Comparator = function (cmp) {
+ if (cmp == null) {
+ return (Collections.reverseOrder$());
+ }
+ return function (t1, t2) {
+ return ((function (target) { return (target['compare'] === undefined) ? target : target['compare']; })(cmp))(t2, t1);
+ };
+ };
+ Collections.reverseOrder = function (cmp) {
+ if (((typeof cmp === 'function' && cmp.length === 2) || cmp === null)) {
+ return java.util.Collections.reverseOrder$java_util_Comparator(cmp);
+ }
+ else if (cmp === undefined) {
+ return java.util.Collections.reverseOrder$();
+ }
+ else
+ throw new Error('invalid overload');
+ };
+ /**
+ * Rotates the elements in {@code list} by the distance {@code dist}
+ * node is red. Note that null pointers are
+ * considered black.
+ * @param {java.util.TreeMap.Node} node
+ * @return {boolean}
+ * @private
+ */
+ TreeMap.prototype.isRed = function (node) {
+ return node != null && node.isRed;
+ };
+ /**
+ * Returns true if a is greater than or equal to b.
+ * @param {*} a
+ * @param {*} b
+ * @param {boolean} orEqual
+ * @return {boolean}
+ * @private
+ */
+ TreeMap.prototype.larger = function (a, b, orEqual) {
+ var compare = ((function (target) { return (target['compare'] === undefined) ? target : target['compare']; })(this.cmp))(a, b);
+ return compare > 0 || (orEqual && compare === 0);
+ };
+ /**
+ * Returns true if a is less than or equal to b.
+ * @param {*} a
+ * @param {*} b
+ * @param {boolean} orEqual
+ * @return {boolean}
+ * @private
+ */
+ TreeMap.prototype.smaller = function (a, b, orEqual) {
+ var compare = ((function (target) { return (target['compare'] === undefined) ? target : target['compare']; })(this.cmp))(a, b);
+ return compare < 0 || (orEqual && compare === 0);
+ };
+ /**
+ * Remove a key from the tree, returning whether it was found and its value.
+ *
+ * @param {*} key key to remove
+ * @param {java.util.TreeMap.State} state return state, not null
+ * @return {boolean} true if the value was found
+ * @private
+ */
+ TreeMap.prototype.removeWithState = function (key, state) {
+ if (this.root == null) {
+ return false;
+ }
+ var found = null;
+ var parent = null;
+ var head = (new TreeMap.Node(null, null));
+ var dir = TreeMap.RIGHT;
+ head.child[TreeMap.RIGHT] = this.root;
+ var node = head;
+ while ((node.child[dir] != null)) {
+ {
+ var last = dir;
+ var grandparent = parent;
+ parent = node;
+ node = node.child[dir];
+ var c = ((function (target) { return (target['compare'] === undefined) ? target : target['compare']; })(this.cmp))(key, node.getKey());
+ dir = c < 0 ? TreeMap.LEFT : TreeMap.RIGHT;
+ if (c === 0 && (!state.matchValue || java.util.Objects.equals(node.getValue(), state.value))) {
+ found = node;
+ }
+ if (!this.isRed(node) && !this.isRed(node.child[dir])) {
+ if (this.isRed(node.child[TreeMap.otherChild(dir)])) {
+ parent = parent.child[last] = this.rotateSingle(node, dir);
+ }
+ else if (!this.isRed(node.child[TreeMap.otherChild(dir)])) {
+ var sibling = parent.child[TreeMap.otherChild(last)];
+ if (sibling != null) {
+ if (!this.isRed(sibling.child[TreeMap.otherChild(last)]) && !this.isRed(sibling.child[last])) {
+ parent.isRed = false;
+ sibling.isRed = true;
+ node.isRed = true;
+ }
+ else {
+ var dir2 = grandparent.child[TreeMap.RIGHT] === parent ? TreeMap.RIGHT : TreeMap.LEFT;
+ if (this.isRed(sibling.child[last])) {
+ grandparent.child[dir2] = this.rotateDouble(parent, last);
+ }
+ else if (this.isRed(sibling.child[TreeMap.otherChild(last)])) {
+ grandparent.child[dir2] = this.rotateSingle(parent, last);
+ }
+ node.isRed = grandparent.child[dir2].isRed = true;
+ grandparent.child[dir2].child[TreeMap.LEFT].isRed = false;
+ grandparent.child[dir2].child[TreeMap.RIGHT].isRed = false;
+ }
+ }
+ }
+ }
+ }
+ }
+ ;
+ if (found != null) {
+ state.found = true;
+ state.value = found.getValue();
+ if (node !== found) {
+ var newNode = (new TreeMap.Node(node.getKey(), node.getValue()));
+ this.replaceNode(head, found, newNode);
+ if (parent === found) {
+ parent = newNode;
+ }
+ }
+ parent.child[parent.child[TreeMap.RIGHT] === node ? TreeMap.RIGHT : TreeMap.LEFT] = node.child[node.child[TreeMap.LEFT] == null ? TreeMap.RIGHT : TreeMap.LEFT];
+ this.__size--;
+ }
+ this.root = head.child[TreeMap.RIGHT];
+ if (this.root != null) {
+ this.root.isRed = false;
+ }
+ return state.found;
+ };
+ /**
+ * replace 'node' with 'newNode' in the tree rooted at 'head'. Could have
+ * avoided this traversal if each node maintained a parent pointer.
+ * @param {java.util.TreeMap.Node} head
+ * @param {java.util.TreeMap.Node} node
+ * @param {java.util.TreeMap.Node} newNode
+ * @private
+ */
+ TreeMap.prototype.replaceNode = function (head, node, newNode) {
+ var parent = head;
+ var direction = (parent.getKey() == null || ((function (target) { return (target['compare'] === undefined) ? target : target['compare']; })(this.cmp))(node.getKey(), parent.getKey()) > 0) ? TreeMap.RIGHT : TreeMap.LEFT;
+ while ((parent.child[direction] !== node)) {
+ {
+ parent = parent.child[direction];
+ direction = ((function (target) { return (target['compare'] === undefined) ? target : target['compare']; })(this.cmp))(node.getKey(), parent.getKey()) > 0 ? TreeMap.RIGHT : TreeMap.LEFT;
+ }
+ }
+ ;
+ parent.child[direction] = newNode;
+ newNode.isRed = node.isRed;
+ newNode.child[TreeMap.LEFT] = node.child[TreeMap.LEFT];
+ newNode.child[TreeMap.RIGHT] = node.child[TreeMap.RIGHT];
+ node.child[TreeMap.LEFT] = null;
+ node.child[TreeMap.RIGHT] = null;
+ };
+ /**
+ * Perform a double rotation, first rotating the child which will become the
+ * root in the opposite direction, then rotating the root in the specified
+ * direction.
+ *
+ *
+ * A F
+ * B C becomes (with rotateDirection=0) A C
+ * D E F G B E G
+ * D
+ *
+ *
+ * @param {java.util.TreeMap.Node} tree root of the subtree to rotate
+ * @param {number} rotateDirection the direction to rotate: 0=left, 1=right
+ * @return {java.util.TreeMap.Node} the new root of the rotated subtree
+ * @private
+ */
+ TreeMap.prototype.rotateDouble = function (tree, rotateDirection) {
+ var otherChildDir = TreeMap.otherChild(rotateDirection);
+ tree.child[otherChildDir] = this.rotateSingle(tree.child[otherChildDir], otherChildDir);
+ return this.rotateSingle(tree, rotateDirection);
+ };
+ /**
+ * Perform a single rotation, pushing the root of the subtree to the specified
+ * direction.
+ *
+ *
+ * A B
+ * B C becomes (with rotateDirection=1) D A
+ * D E E C
+ *
+ *
+ * @param {java.util.TreeMap.Node} tree the root of the subtree to rotate
+ * @param {number} rotateDirection the direction to rotate: 0=left rotation, 1=right
+ * @return {java.util.TreeMap.Node} the new root of the rotated subtree
+ * @private
+ */
+ TreeMap.prototype.rotateSingle = function (tree, rotateDirection) {
+ var otherChildDir = TreeMap.otherChild(rotateDirection);
+ var save = tree.child[otherChildDir];
+ tree.child[otherChildDir] = save.child[rotateDirection];
+ save.child[rotateDirection] = tree;
+ tree.isRed = true;
+ save.isRed = false;
+ return save;
+ };
+ TreeMap.LEFT = 0;
+ TreeMap.RIGHT = 1;
+ return TreeMap;
+ }(java.util.AbstractNavigableMap));
+ util.TreeMap = TreeMap;
+ TreeMap["__class"] = "java.util.TreeMap";
+ TreeMap["__interfaces"] = ["java.util.Map", "java.util.NavigableMap", "java.util.SortedMap", "java.io.Serializable"];
+ (function (TreeMap) {
+ /**
+ * Create an iterator which may return only a restricted range.
+ *
+ * @param {*} fromKey the first key to return in the iterator.
+ * @param {*} toKey the upper bound of keys to return.
+ * @param {java.util.TreeMap.SubMapType} type
+ * @param {boolean} fromInclusive
+ * @param {boolean} toInclusive
+ * @class
+ */
+ var DescendingEntryIterator = /** @class */ (function () {
+ function DescendingEntryIterator(__parent, type, fromKey, fromInclusive, toKey, toInclusive) {
+ if (((type != null && type instanceof java.util.TreeMap.SubMapType) || type === null) && ((fromKey != null) || fromKey === null) && ((typeof fromInclusive === 'boolean') || fromInclusive === null) && ((toKey != null) || toKey === null) && ((typeof toInclusive === 'boolean') || toInclusive === null)) {
+ var __args = Array.prototype.slice.call(arguments, [1]);
+ if (this.iter === undefined) {
+ this.iter = null;
+ }
+ if (this.last === undefined) {
+ this.last = null;
+ }
+ var list = (new java.util.ArrayList());
+ __parent.inOrderAdd(list, type, __parent.root, fromKey, fromInclusive, toKey, toInclusive);
+ this.iter = list['listIterator$int'](list.size());
+ }
+ else if (type === undefined && fromKey === undefined && fromInclusive === undefined && toKey === undefined && toInclusive === undefined) {
+ var __args = Array.prototype.slice.call(arguments, [1]);
+ {
+ var __args_41 = Array.prototype.slice.call(arguments, [1]);
+ var type_1 = java.util.TreeMap.SubMapType_All_$LI$();
+ var fromKey_1 = null;
+ var fromInclusive_1 = false;
+ var toKey_1 = null;
+ var toInclusive_1 = false;
+ if (this.iter === undefined) {
+ this.iter = null;
+ }
+ if (this.last === undefined) {
+ this.last = null;
+ }
+ var list = (new java.util.ArrayList());
+ __parent.inOrderAdd(list, type_1, __parent.root, fromKey_1, fromInclusive_1, toKey_1, toInclusive_1);
+ this.iter = list['listIterator$int'](list.size());
+ }
+ if (this.iter === undefined) {
+ this.iter = null;
+ }
+ if (this.last === undefined) {
+ this.last = null;
+ }
+ }
+ else
+ throw new Error('invalid overload');
+ }
+ /* Default method injected from java.util.Iterator */
+ DescendingEntryIterator.prototype.forEachRemaining = function (consumer) {
+ var _this = this;
+ javaemul.internal.InternalPreconditions.checkNotNull((consumer));
+ while ((this.hasNext())) {
+ {
+ (function (target) { return (typeof target === 'function') ? target(_this.next()) : target.accept(_this.next()); })(consumer);
+ }
+ }
+ ;
+ };
+ /**
+ *
+ * @return {boolean}
+ */
+ DescendingEntryIterator.prototype.hasNext = function () {
+ return this.iter.hasPrevious();
+ };
+ /**
+ *
+ * @return {*}
+ */
+ DescendingEntryIterator.prototype.next = function () {
+ return this.last = this.iter.previous();
+ };
+ /**
+ *
+ */
+ DescendingEntryIterator.prototype.remove = function () {
+ this.iter.remove();
+ this.__parent.removeEntry(this.last);
+ this.last = null;
+ };
+ return DescendingEntryIterator;
+ }());
+ TreeMap.DescendingEntryIterator = DescendingEntryIterator;
+ DescendingEntryIterator["__class"] = "java.util.TreeMap.DescendingEntryIterator";
+ DescendingEntryIterator["__interfaces"] = ["java.util.Iterator"];
+ /**
+ * Create an iterator which may return only a restricted range.
+ *
+ * @param {*} fromKey the first key to return in the iterator.
+ * @param {*} toKey the upper bound of keys to return.
+ * @param {java.util.TreeMap.SubMapType} type
+ * @param {boolean} fromInclusive
+ * @param {boolean} toInclusive
+ * @class
+ */
+ var EntryIterator = /** @class */ (function () {
+ function EntryIterator(__parent, type, fromKey, fromInclusive, toKey, toInclusive) {
+ if (((type != null && type instanceof java.util.TreeMap.SubMapType) || type === null) && ((fromKey != null) || fromKey === null) && ((typeof fromInclusive === 'boolean') || fromInclusive === null) && ((toKey != null) || toKey === null) && ((typeof toInclusive === 'boolean') || toInclusive === null)) {
+ var __args = Array.prototype.slice.call(arguments, [1]);
+ if (this.iter === undefined) {
+ this.iter = null;
+ }
+ if (this.last === undefined) {
+ this.last = null;
+ }
+ var list = (new java.util.ArrayList());
+ __parent.inOrderAdd(list, type, __parent.root, fromKey, fromInclusive, toKey, toInclusive);
+ this.iter = list['listIterator$']();
+ }
+ else if (type === undefined && fromKey === undefined && fromInclusive === undefined && toKey === undefined && toInclusive === undefined) {
+ var __args = Array.prototype.slice.call(arguments, [1]);
+ {
+ var __args_42 = Array.prototype.slice.call(arguments, [1]);
+ var type_2 = java.util.TreeMap.SubMapType_All_$LI$();
+ var fromKey_2 = null;
+ var fromInclusive_2 = false;
+ var toKey_2 = null;
+ var toInclusive_2 = false;
+ if (this.iter === undefined) {
+ this.iter = null;
+ }
+ if (this.last === undefined) {
+ this.last = null;
+ }
+ var list = (new java.util.ArrayList());
+ __parent.inOrderAdd(list, type_2, __parent.root, fromKey_2, fromInclusive_2, toKey_2, toInclusive_2);
+ this.iter = list['listIterator$']();
+ }
+ if (this.iter === undefined) {
+ this.iter = null;
+ }
+ if (this.last === undefined) {
+ this.last = null;
+ }
+ }
+ else
+ throw new Error('invalid overload');
+ }
+ /* Default method injected from java.util.Iterator */
+ EntryIterator.prototype.forEachRemaining = function (consumer) {
+ var _this = this;
+ javaemul.internal.InternalPreconditions.checkNotNull((consumer));
+ while ((this.hasNext())) {
+ {
+ (function (target) { return (typeof target === 'function') ? target(_this.next()) : target.accept(_this.next()); })(consumer);
+ }
+ }
+ ;
+ };
+ /**
+ *
+ * @return {boolean}
+ */
+ EntryIterator.prototype.hasNext = function () {
+ return this.iter.hasNext();
+ };
+ /**
+ *
+ * @return {*}
+ */
+ EntryIterator.prototype.next = function () {
+ return this.last = this.iter.next();
+ };
+ /**
+ *
+ */
+ EntryIterator.prototype.remove = function () {
+ this.iter.remove();
+ this.__parent.removeEntry(this.last);
+ this.last = null;
+ };
+ return EntryIterator;
+ }());
+ TreeMap.EntryIterator = EntryIterator;
+ EntryIterator["__class"] = "java.util.TreeMap.EntryIterator";
+ EntryIterator["__interfaces"] = ["java.util.Iterator"];
+ var __java_util_TreeMap_EntrySet = /** @class */ (function (_super) {
+ __extends(__java_util_TreeMap_EntrySet, _super);
+ function __java_util_TreeMap_EntrySet(__parent) {
+ var _this = _super.call(this, __parent) || this;
+ _this.__parent = __parent;
+ return _this;
+ }
+ /**
+ *
+ */
+ __java_util_TreeMap_EntrySet.prototype.clear = function () {
+ this.clear();
+ };
+ return __java_util_TreeMap_EntrySet;
+ }(java.util.AbstractNavigableMap.EntrySet));
+ TreeMap.__java_util_TreeMap_EntrySet = __java_util_TreeMap_EntrySet;
+ __java_util_TreeMap_EntrySet["__class"] = "java.util.TreeMap.EntrySet";
+ __java_util_TreeMap_EntrySet["__interfaces"] = ["java.util.Collection", "java.util.Set", "java.lang.Iterable"];
+ /**
+ * Create a node of the specified color.
+ *
+ * @param {*} key
+ * @param {*} value
+ * @param {boolean} isRed true if this should be a red node, false for black
+ * @class
+ * @extends java.util.AbstractMap.SimpleEntry
+ */
+ var Node = /** @class */ (function (_super) {
+ __extends(Node, _super);
+ function Node(key, value, isRed) {
+ var _this = this;
+ if (((key != null) || key === null) && ((value != null) || value === null) && ((typeof isRed === 'boolean') || isRed === null)) {
+ var __args = arguments;
+ _this = _super.call(this, key, value) || this;
+ if (_this.isRed === undefined) {
+ _this.isRed = false;
+ }
+ _this.child = [null, null];
+ _this.isRed = isRed;
+ }
+ else if (((key != null) || key === null) && ((value != null) || value === null) && isRed === undefined) {
+ var __args = arguments;
+ {
+ var __args_43 = arguments;
+ var isRed_1 = true;
+ _this = _super.call(this, key, value) || this;
+ if (_this.isRed === undefined) {
+ _this.isRed = false;
+ }
+ _this.child = [null, null];
+ _this.isRed = isRed_1;
+ }
+ if (_this.isRed === undefined) {
+ _this.isRed = false;
+ }
+ _this.child = [null, null];
+ }
+ else
+ throw new Error('invalid overload');
+ return _this;
+ }
+ return Node;
+ }(util.AbstractMap.SimpleEntry));
+ TreeMap.Node = Node;
+ Node["__class"] = "java.util.TreeMap.Node";
+ Node["__interfaces"] = ["java.util.Map.Entry"];
+ /**
+ * A state object which is passed down the tree for both insert and remove.
+ * All uses make use of the done flag to indicate when no further rebalancing
+ * of the tree is required. Remove methods use the found flag to indicate when
+ * the desired key has been found. value is used both to return the value of a
+ * removed node as well as to pass in a value which must match (used for
+ * entrySet().remove(entry)), and the matchValue flag is used to request this
+ * behavior.
+ *
+ * @param