"use strict";
var __read = (this && this.__read) || function (o, n) {
    var m = typeof Symbol === "function" && o[Symbol.iterator];
    if (!m) return o;
    var i = m.call(o), r, ar = [], e;
    try {
        while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
    }
    catch (error) { e = { error: error }; }
    finally {
        try {
            if (r && !r.done && (m = i["return"])) m.call(i);
        }
        finally { if (e) throw e.error; }
    }
    return ar;
};
var __spread = (this && this.__spread) || function () {
    for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));
    return ar;
};
Object.defineProperty(exports, "__esModule", { value: true });
var IndexedGeometryLinearMap = (function () {
    function IndexedGeometryLinearMap() {
        this.map = new Map();
    }
    Object.defineProperty(IndexedGeometryLinearMap.prototype, "size", {
        get: function () {
            return this.map.size;
        },
        enumerable: true,
        configurable: true
    });
    IndexedGeometryLinearMap.prototype.set = function (geometry) {
        var x = geometry.value.x;
        var existing = this.map.get(x);
        if (existing === undefined) {
            this.map.set(x, [geometry]);
        }
        else {
            this.map.set(x, __spread([geometry], existing));
        }
    };
    IndexedGeometryLinearMap.prototype.getMergeData = function () {
        return __spread(this.map.values());
    };
    IndexedGeometryLinearMap.prototype.keys = function () {
        return __spread(this.map.keys());
    };
    IndexedGeometryLinearMap.prototype.find = function (x) {
        var _a;
        if (x === null) {
            return [];
        }
        return _a = this.map.get(x), (_a !== null && _a !== void 0 ? _a : []);
    };
    return IndexedGeometryLinearMap;
}());
exports.IndexedGeometryLinearMap = IndexedGeometryLinearMap;
//# sourceMappingURL=indexed_geometry_linear_map.js.map