/*
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 { IList$1_$type, Base, Number_$type, typeCast, markType } from "igniteui-react-core/ES2015/type";
import { ReadOnlyCollection$1 } from "igniteui-react-core/ES2015/ReadOnlyCollection$1";
import { SafeEnumerable } from "./SafeEnumerable";
import { isInfinity, isNaN_ } from "igniteui-react-core/ES2015/number";
export class SafeReadOnlyDoubleCollection extends Base {
    constructor(a, ..._rest) {
        super();
        this.a = null;
        this.b = 0;
        a = (a == void 0) ? 0 : a;
        switch (a) {
            case 0:
                {
                    let c = _rest[0];
                    this.a = new ReadOnlyCollection$1(Number_$type, 1, c);
                }
                break;
            case 1:
                {
                    let c = _rest[0];
                    let d = _rest[1];
                    this.a = new ReadOnlyCollection$1(Number_$type, 1, c);
                    this.b = d;
                }
                break;
        }
    }
    c(a) {
        if (isInfinity(a) || isNaN_(a)) {
            return this.b;
        }
        return a;
    }
    indexOf(a) {
        return this.a.indexOf(a);
    }
    insert(a, b) {
        this.a.insert(a, b);
    }
    removeAt(a) {
        this.a.removeAt(a);
    }
    item(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));
        }
    }
    add(a) {
        this.a.add(a);
    }
    clear() {
        this.a.clear();
    }
    contains(a) {
        return this.a.contains(a);
    }
    copyTo(a, b) {
        for (let c = b; c < a.length; c++) {
            a[c] = this.item(c);
        }
    }
    get count() {
        return this.a.count;
    }
    get isReadOnly() {
        return this.a.isReadOnly;
    }
    remove(a) {
        return this.a.remove(a);
    }
    getEnumerator() {
        return new SafeEnumerable(this.a).getEnumerator();
    }
    getEnumeratorObject() {
        return this.getEnumerator();
    }
}
SafeReadOnlyDoubleCollection.$t = markType(SafeReadOnlyDoubleCollection, 'SafeReadOnlyDoubleCollection', Base.$, [IList$1_$type.specialize(Number_$type)]);
