UNPKG

ts-collection

Version:

This is re-write of the java collection classes in typescript. There is some tweak as typescript templates are not as equivalent as Java.

31 lines (30 loc) 808 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Integer = /** @class */ (function () { function Integer(num) { this.num = num; } Integer.prototype.compareTo = function (int) { return this.num - int.num; }; Integer.prototype.equals = function (e) { return this.num === e.num; }; return Integer; }()); exports.Integer = Integer; var IntegerComparator = /** @class */ (function () { function IntegerComparator() { } IntegerComparator.prototype.compare = function (e1, e2) { if (e1.num > e2.num) { return 1; } else if (e1.num < e2.num) { return -1; } return 0; }; return IntegerComparator; }()); exports.IntegerComparator = IntegerComparator;