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