/*
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 { IFastItemColumnInternal_$type } from "./IFastItemColumnInternal";
import { IFastItemColumn$1_$type } from "./IFastItemColumn$1";
import { Base, typeGetValue, Number_$type, markType } from "./type";
import { List$1 } from "./List$1";
import { NotImplementedException } from "./NotImplementedException";
import { FastItemColumn } from "./FastItemColumn";
var FastItemIntColumn = /** @class */ (function (_super) {
    tslib_1.__extends(FastItemIntColumn, _super);
    function FastItemIntColumn(a, b, c, d) {
        var _this = _super.call(this) || this;
        _this.f = null;
        _this.c = false;
        _this.a = null;
        _this._propertyName = null;
        _this.h = 0;
        _this.g = 0;
        _this.e = null;
        _this.f = c;
        _this.c = d;
        _this.propertyName = b;
        _this.b = a;
        return _this;
    }
    Object.defineProperty(FastItemIntColumn.prototype, "b", {
        get: function () {
            return this.a;
        },
        set: function (a) {
            this.a = a;
            this.reset();
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(FastItemIntColumn.prototype, "propertyName", {
        get: function () {
            return this._propertyName;
        },
        set: function (a) {
            this._propertyName = a;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(FastItemIntColumn.prototype, "minimum", {
        get: function () {
            return this.h;
        },
        set: function (a) {
            this.h = a;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(FastItemIntColumn.prototype, "maximum", {
        get: function () {
            return this.g;
        },
        set: function (a) {
            this.g = a;
        },
        enumerable: true,
        configurable: true
    });
    FastItemIntColumn.prototype.item = function (a, b) {
        if (arguments.length === 2) {
            return b;
        }
        else {
            return this.e._inner[a];
        }
    };
    FastItemIntColumn.prototype.getEnumerator = function () {
        return this.e.getEnumerator();
    };
    FastItemIntColumn.prototype.getEnumeratorObject = function () {
        return this.e.getEnumerator();
    };
    FastItemIntColumn.prototype.contains = function (a) {
        return this.e.contains(a);
    };
    FastItemIntColumn.prototype.copyTo = function (a, b) {
        this.e.copyTo(a, b);
    };
    Object.defineProperty(FastItemIntColumn.prototype, "count", {
        get: function () {
            return this.e.count;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(FastItemIntColumn.prototype, "isReadOnly", {
        get: function () {
            return true;
        },
        enumerable: true,
        configurable: true
    });
    FastItemIntColumn.prototype.indexOf = function (a) {
        return this.e.indexOf(a);
    };
    FastItemIntColumn.prototype.add = function (a) {
        throw new NotImplementedException(0);
    };
    FastItemIntColumn.prototype.clear = function () {
        throw new NotImplementedException(0);
    };
    FastItemIntColumn.prototype.remove = function (a) {
        throw new NotImplementedException(0);
    };
    FastItemIntColumn.prototype.insert = function (a, b) {
        throw new NotImplementedException(0);
    };
    FastItemIntColumn.prototype.removeAt = function (a) {
        throw new NotImplementedException(0);
    };
    FastItemIntColumn.prototype.reset = function () {
        this.e = null;
        return this.b != null ? this.insertRange(0, this.b.count) : true;
    };
    FastItemIntColumn.prototype.insertRange = function (a, b) {
        var c = new Array(b);
        var source_ = this.a.asArray();
        var item_;
        var d = this.minimum;
        var e = this.maximum;
        var f = 0;
        var g = this.f;
        var propertyName_ = this._propertyName;
        var sourceItem_;
        if (this.f != null || this.c) {
            for (var i_ = a; i_ < a + b; ++i_) {
                sourceItem_ = source_[i_];
                item_ = (source_[i_][propertyName_]);
                if (this.c) {
                    if ((typeof (item_) == 'function')) {
                        item_ = item_.apply(sourceItem_);
                    }
                }
                if (g != null) {
                    item_ = g(item_);
                }
                var h = item_ == null ? 0 : typeGetValue(item_);
                c[f] = h;
                f++;
            }
        }
        else {
            for (var i_ = a; i_ < a + b; ++i_) {
                item_ = (source_[i_][propertyName_]);
                var i = item_ == null ? 0 : typeGetValue(item_);
                c[f] = i;
                f++;
            }
        }
        if (this.e == null) {
            this.e = new List$1(Number_$type, 1, c);
        }
        else {
            this.e.t(a, c);
        }
        return true;
    };
    FastItemIntColumn.prototype.replaceRange = function (a, b) {
        var c = false;
        for (var d = 0; d < b; ++d) {
            var e = this.e._inner[a + d];
            var f = this.i(this.b.item(a + d));
            if (e != f) {
                this.e._inner[a + d] = f;
                c = true;
            }
        }
        return c;
    };
    FastItemIntColumn.prototype.removeRange = function (a, b) {
        this.e.v(a, b);
        return true;
    };
    FastItemIntColumn.prototype.i = function (a) {
        var sourceItem_ = a;
        var from_ = a;
        var propertyName_ = this._propertyName;
        a = from_[propertyName_];
        if (this.c) {
            from_ = a;
            if ((typeof (from_) == 'function')) {
                a = from_.apply(sourceItem_);
            }
        }
        if (this.f != null) {
            a = this.f(a);
        }
        if (a == null) {
            return 0;
        }
        return typeGetValue(a);
    };
    Object.defineProperty(FastItemIntColumn.prototype, "mayContainUnknowns", {
        get: function () {
            return true;
        },
        enumerable: true,
        configurable: true
    });
    FastItemIntColumn.prototype.d = function () {
        return FastItemColumn.e(this.e, function (a, b) {
            var c = typeGetValue(a);
            var d = typeGetValue(b);
            if (c < d) {
                return -1;
            }
            if (c > d) {
                return 1;
            }
            return 0;
        });
    };
    FastItemIntColumn.prototype.asArray = function () {
        return this.e.asArray();
    };
    FastItemIntColumn.prototype.getItem = function (a) {
        return this.item(a);
    };
    FastItemIntColumn.$t = markType(FastItemIntColumn, 'FastItemIntColumn', Base.$, [IFastItemColumnInternal_$type, IFastItemColumn$1_$type.specialize(Number_$type)]);
    return FastItemIntColumn;
}(Base));
export { FastItemIntColumn };
//# sourceMappingURL=FastItemIntColumn.js.map