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.

56 lines (55 loc) 2.04 kB
"use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); Object.defineProperty(exports, "__esModule", { value: true }); var map_1 = require("../map"); var objects_1 = require("../objects"); var nullpointerexception_1 = require("../../lang/nullpointerexception"); var TreeMapEntry = /** @class */ (function (_super) { __extends(TreeMapEntry, _super); function TreeMapEntry(key, value) { var _this = _super.call(this) || this; _this.key = key; _this.value = value; return _this; } TreeMapEntry.prototype.getKey = function () { return this.key; }; TreeMapEntry.prototype.getValue = function () { return this.value; }; TreeMapEntry.prototype.setValue = function (value) { var oldValue = this.value; this.value = value; return oldValue; }; TreeMapEntry.prototype.equals = function (obj) { var rbObj = obj; return objects_1.Objects.equals(this.key, rbObj.key) && objects_1.Objects.equals(this.value, rbObj.value); }; TreeMapEntry.prototype.compareTo = function (entry) { var k = this.key; return k.compareTo(entry.key); }; TreeMapEntry.prototype.compareKey = function (key) { if (key === null) { throw new nullpointerexception_1.NullPointerException(); } var k = this.key; return k.compareTo(key); }; return TreeMapEntry; }(map_1.AbstractMapEntry)); exports.TreeMapEntry = TreeMapEntry;