/*
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 { OrderedDictionary } from "./OrderedDictionary";
import { IDictionary$2_$type } from "igniteui-react-core/ES2015/IDictionary$2";
import { IDictionary_$type, IEnumerator$1_$type, IEnumerator_$type, Base, Type, getBoxIfEnum, markType } from "igniteui-react-core/ES2015/type";
import { KeyValuePair$2 } from "igniteui-react-core/ES2015/KeyValuePair$2";
import { Dictionary$2 } from "igniteui-react-core/ES2015/Dictionary$2";
import { List$1 } from "igniteui-react-core/ES2015/List$1";
/**
 * @hidden
 */
export class OrderedDictionary$2 extends OrderedDictionary {
    constructor($tKey, $tValue) {
        super();
        this.$tKey = null;
        this.$tValue = null;
        this.e = null;
        this.f = null;
        this.$tKey = $tKey;
        this.$tValue = $tValue;
        this.$type = this.$type.specialize(this.$tKey, this.$tValue);
        this.e = new Dictionary$2(this.$tKey, this.$tValue, 0);
        this.f = new List$1(this.$tKey, 0);
    }
    item1(a) {
        return this.f._inner[a];
    }
    item(a, b) {
        if (arguments.length === 2) {
            let c = this.f.indexOf(a);
            this.f._inner[c] = a;
            this.e.item(a, b);
            return b;
        }
        else {
            return this.e.item(a);
        }
    }
    get_a() {
        return this.count;
    }
    get a() {
        return this.get_a();
    }
    get count() {
        return this.e.count;
    }
    get isReadOnly() {
        return false;
    }
    get keys() {
        return this.f;
    }
    get values() {
        return this.e.values;
    }
    add(a) {
        this.addItem(a.key, a.value);
    }
    addItem(a, b) {
        this.e.addItem(a, b);
        this.f.add(a);
    }
    clear() {
        this.e.clear();
        this.f.clear();
    }
    contains(a) {
        return this.e.contains(a);
    }
    containsKey(a) {
        return this.e.containsKey(a);
    }
    copyTo(a, b) {
        this.e.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.e.removeItem(a) && this.f.remove(a);
    }
    tryGetValue(a, b) {
        if (this.e.containsKey(a)) {
            b = this.e.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);
    }
    b(a) {
        return getBoxIfEnum(this.$tKey, this.item1(a));
    }
    c(a) {
        return this.item(a);
    }
}
OrderedDictionary$2.$t = markType(OrderedDictionary$2, 'OrderedDictionary$2', OrderedDictionary.$, [IDictionary$2_$type.specialize(0, 1), IDictionary_$type]);
/**
 * @hidden
 */
export class OrderedDictionary_Enumerator$2 extends Base {
    constructor($tKey, $tValue, a) {
        super();
        this.$tKey = null;
        this.$tValue = null;
        this.b = 0;
        this.a = null;
        this.$tKey = $tKey;
        this.$tValue = $tValue;
        this.$type = this.$type.specialize(this.$tKey, this.$tValue);
        this.b = -1;
        this.a = a;
    }
    get currentObject() {
        return getBoxIfEnum(this.$tValue, this.a.item(this.a.item1(this.b)));
    }
    get current() {
        let a = this.a.item1(this.b);
        return new KeyValuePair$2(this.$tKey, this.$tValue, 1, a, this.a.item(a));
    }
    moveNext() {
        this.b++;
        return this.b < this.a.count;
    }
    reset() {
        this.b = -1;
    }
    dispose() {
    }
}
OrderedDictionary_Enumerator$2.$t = markType(OrderedDictionary_Enumerator$2, 'OrderedDictionary_Enumerator$2', Base.$, [IEnumerator$1_$type.specialize(KeyValuePair$2.$.specialize(0, 1)), IEnumerator_$type]);
