/*
THIS INFRAGISTICS ULTIMATE SOFTWARE LICENSE  AGREEMENT ("AGREEMENT") LOCATED HERE:
https://www.infragistics.com/legal/license/igultimate-la
https://www.infragistics.com/legal/license/igultimate-eula
GOVERNS THE LICENSING, INSTALLATION AND USE OF INFRAGISTICS SOFTWARE. BY DOWNLOADING AND/OR INSTALLING AND USING INFRAGISTICS SOFTWARE:  you are indicating that you have read and understand this Agreement, and agree to be legally bound by it on behalf of the yourself and your company.
*/
import * as tslib_1 from "tslib";
import { IList$1_$type, Base, typeCast, Number_$type, toEnum, markType } from "igniteui-react-core/ES5/type";
import { SafeReadOnlyDoubleCollection } from "./SafeReadOnlyDoubleCollection";
import { isInfinity, isNaN_ } from "igniteui-react-core/ES5/number";
var SafeSortedReadOnlyDoubleCollection = /** @class */ (function (_super) {
    tslib_1.__extends(SafeSortedReadOnlyDoubleCollection, _super);
    function SafeSortedReadOnlyDoubleCollection(a) {
        var _rest = [];
        for (var _i = 1; _i < arguments.length; _i++) {
            _rest[_i - 1] = arguments[_i];
        }
        var _this = _super.call(this) || this;
        _this.a = null;
        _this.b = null;
        _this.c = 0;
        a = (a == void 0) ? 0 : a;
        switch (a) {
            case 0:
                {
                    var c = _rest[0];
                    var d = _rest[1];
                    _this.a = new SafeReadOnlyDoubleCollection(0, c);
                    _this.b = d;
                }
                break;
            case 1:
                {
                    var c = _rest[0];
                    var d = _rest[1];
                    var e = _rest[2];
                    _this.a = new SafeReadOnlyDoubleCollection(1, c, e);
                    _this.b = d;
                    _this.c = e;
                }
                break;
        }
        return _this;
    }
    SafeSortedReadOnlyDoubleCollection.prototype.d = function (a) {
        if (isInfinity(a) || isNaN_(a)) {
            return this.c;
        }
        return a;
    };
    SafeSortedReadOnlyDoubleCollection.prototype.indexOf = function (a) {
        var b = this.a.indexOf(a);
        return this.b.indexOf(b);
    };
    SafeSortedReadOnlyDoubleCollection.prototype.insert = function (a, b) {
        this.a.insert(a, b);
    };
    SafeSortedReadOnlyDoubleCollection.prototype.removeAt = function (a) {
        this.a.removeAt(a);
    };
    SafeSortedReadOnlyDoubleCollection.prototype.item = function (a, b) {
        if (arguments.length === 2) {
            (typeCast(IList$1_$type.specialize(Number_$type), this.a)).item(a, b);
            return b;
        }
        else {
            var b_1 = this.b.item(a);
            return this.d(this.a.item(b_1));
        }
    };
    SafeSortedReadOnlyDoubleCollection.prototype.add = function (a) {
        this.a.add(a);
    };
    SafeSortedReadOnlyDoubleCollection.prototype.clear = function () {
        this.a.clear();
    };
    SafeSortedReadOnlyDoubleCollection.prototype.contains = function (a) {
        return this.a.contains(a);
    };
    SafeSortedReadOnlyDoubleCollection.prototype.copyTo = function (a, b) {
        for (var c = b; c < a.length; c++) {
            a[c] = this.item(c);
        }
    };
    Object.defineProperty(SafeSortedReadOnlyDoubleCollection.prototype, "count", {
        get: function () {
            return this.a.count;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(SafeSortedReadOnlyDoubleCollection.prototype, "isReadOnly", {
        get: function () {
            return this.a.isReadOnly;
        },
        enumerable: true,
        configurable: true
    });
    SafeSortedReadOnlyDoubleCollection.prototype.remove = function (a) {
        return this.a.remove(a);
    };
    SafeSortedReadOnlyDoubleCollection.prototype._getEnumerator = function () {
        var a;
        return tslib_1.__generator(this, function (_a) {
            switch (_a.label) {
                case 0:
                    a = 0;
                    _a.label = 1;
                case 1:
                    if (!(a < this.a.count)) return [3 /*break*/, 4];
                    return [4 /*yield*/, this.item(a)];
                case 2:
                    _a.sent();
                    _a.label = 3;
                case 3:
                    a++;
                    return [3 /*break*/, 1];
                case 4: return [2 /*return*/];
            }
        });
    };
    SafeSortedReadOnlyDoubleCollection.prototype.getEnumerator = function () {
        var _this = this;
        return toEnum(function () { return _this._getEnumerator(); }).getEnumerator();
    };
    SafeSortedReadOnlyDoubleCollection.prototype.getEnumeratorObject = function () {
        return this.getEnumerator();
    };
    SafeSortedReadOnlyDoubleCollection.$t = markType(SafeSortedReadOnlyDoubleCollection, 'SafeSortedReadOnlyDoubleCollection', Base.$, [IList$1_$type.specialize(Number_$type)]);
    return SafeSortedReadOnlyDoubleCollection;
}(Base));
export { SafeSortedReadOnlyDoubleCollection };
