/*
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 { IDictionary$2_$type } from "igniteui-react-core/ES2015/IDictionary$2";
import { Base, Type, markType } from "igniteui-react-core/ES2015/type";
import { Dictionary$2 } from "igniteui-react-core/ES2015/Dictionary$2";
import { List$1 } from "igniteui-react-core/ES2015/List$1";
import { OrderedDictionary_Enumerator$2 } from "./OrderedDictionary_Enumerator$2";
export class OrderedDictionary$2 extends Base {
    constructor($tKey, $tValue) {
        super();
        this.$tKey = null;
        this.$tValue = null;
        this.b = null;
        this.c = null;
        this.$tKey = $tKey;
        this.$tValue = $tValue;
        this.$type = this.$type.specialize(this.$tKey, this.$tValue);
        this.b = new Dictionary$2(this.$tKey, this.$tValue, 0);
        this.c = new List$1(this.$tKey, 0);
    }
    item1(a) {
        return this.c._inner[a];
    }
    item(a, b) {
        if (arguments.length === 2) {
            let c = this.c.indexOf(a);
            this.c._inner[c] = a;
            this.b.item(a, b);
            return b;
        }
        else {
            return this.b.item(a);
        }
    }
    get count() {
        return this.b.count;
    }
    get isReadOnly() {
        return false;
    }
    get keys() {
        return this.c;
    }
    get values() {
        return this.b.values;
    }
    add(a) {
        this.addItem(a.key, a.value);
    }
    addItem(a, b) {
        this.b.addItem(a, b);
        this.c.add(a);
    }
    clear() {
        this.b.clear();
        this.c.clear();
    }
    contains(a) {
        return this.b.contains(a);
    }
    containsKey(a) {
        return this.b.containsKey(a);
    }
    copyTo(a, b) {
        this.b.copyTo(a, b);
    }
    getEnumerator() {
        return new OrderedDictionary_Enumerator$2(this.$tKey, this.$tValue, this);
    }
    remove(a) {
        return this.removeItem(a.key);
    }
    removeItem(a) {
        return this.b.removeItem(a) && this.c.remove(a);
    }
    tryGetValue(a, b) {
        if (this.b.containsKey(a)) {
            b = this.b.item(a);
            return {
                ret: true,
                p1: b
            };
        }
        b = Type.getDefaultValue(this.$tValue);
        return {
            ret: false,
            p1: b
        };
    }
    getEnumeratorObject() {
        return new OrderedDictionary_Enumerator$2(this.$tKey, this.$tValue, this);
    }
}
OrderedDictionary$2.$t = markType(OrderedDictionary$2, 'OrderedDictionary$2', Base.$, [IDictionary$2_$type.specialize(0, 1)]);
