/*
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, Number_$type, typeCast, markType } from "igniteui-react-core/ES5/type";
import { ReadOnlyCollection$1 } from "igniteui-react-core/ES5/ReadOnlyCollection$1";
import { SafeEnumerable } from "./SafeEnumerable";
import { isInfinity, isNaN_ } from "igniteui-react-core/ES5/number";
var SafeReadOnlyDoubleCollection = /** @class */ (function (_super) {
    tslib_1.__extends(SafeReadOnlyDoubleCollection, _super);
    function SafeReadOnlyDoubleCollection(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 = 0;
        a = (a == void 0) ? 0 : a;
        switch (a) {
            case 0:
                {
                    var c = _rest[0];
                    _this.a = new ReadOnlyCollection$1(Number_$type, 1, c);
                }
                break;
            case 1:
                {
                    var c = _rest[0];
                    var d = _rest[1];
                    _this.a = new ReadOnlyCollection$1(Number_$type, 1, c);
                    _this.b = d;
                }
                break;
        }
        return _this;
    }
    SafeReadOnlyDoubleCollection.prototype.c = function (a) {
        if (isInfinity(a) || isNaN_(a)) {
            return this.b;
        }
        return a;
    };
    SafeReadOnlyDoubleCollection.prototype.indexOf = function (a) {
        return this.a.indexOf(a);
    };
    SafeReadOnlyDoubleCollection.prototype.insert = function (a, b) {
        this.a.insert(a, b);
    };
    SafeReadOnlyDoubleCollection.prototype.removeAt = function (a) {
        this.a.removeAt(a);
    };
    SafeReadOnlyDoubleCollection.prototype.item = function (a, b) {
        if (arguments.length === 2) {
            (typeCast(IList$1_$type.specialize(Number_$type), this.a)).item(a, b);
            return b;
        }
        else {
            return this.c(this.a.item(a));
        }
    };
    SafeReadOnlyDoubleCollection.prototype.add = function (a) {
        this.a.add(a);
    };
    SafeReadOnlyDoubleCollection.prototype.clear = function () {
        this.a.clear();
    };
    SafeReadOnlyDoubleCollection.prototype.contains = function (a) {
        return this.a.contains(a);
    };
    SafeReadOnlyDoubleCollection.prototype.copyTo = function (a, b) {
        for (var c = b; c < a.length; c++) {
            a[c] = this.item(c);
        }
    };
    Object.defineProperty(SafeReadOnlyDoubleCollection.prototype, "count", {
        get: function () {
            return this.a.count;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(SafeReadOnlyDoubleCollection.prototype, "isReadOnly", {
        get: function () {
            return this.a.isReadOnly;
        },
        enumerable: true,
        configurable: true
    });
    SafeReadOnlyDoubleCollection.prototype.remove = function (a) {
        return this.a.remove(a);
    };
    SafeReadOnlyDoubleCollection.prototype.getEnumerator = function () {
        return new SafeEnumerable(this.a).getEnumerator();
    };
    SafeReadOnlyDoubleCollection.prototype.getEnumeratorObject = function () {
        return this.getEnumerator();
    };
    SafeReadOnlyDoubleCollection.$t = markType(SafeReadOnlyDoubleCollection, 'SafeReadOnlyDoubleCollection', Base.$, [IList$1_$type.specialize(Number_$type)]);
    return SafeReadOnlyDoubleCollection;
}(Base));
export { SafeReadOnlyDoubleCollection };
