igniteui-angular-core
Version:
Ignite UI Angular Core logic used in multiple UI components.
114 lines (113 loc) • 4.08 kB
JavaScript
/*
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 { __extends } from "tslib";
import { JsonDictionaryItem } from "./JsonDictionaryItem";
import { Dictionary$2 } from "./Dictionary$2";
import { List$1 } from "./List$1";
import { JsonDictionaryValue } from "./JsonDictionaryValue";
import { String_$type, typeCast, markType } from "./type";
/**
* @hidden
*/
var JsonDictionaryObject = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(JsonDictionaryObject, _super);
function JsonDictionaryObject() {
var _this = _super.call(this) || this;
_this.m = new List$1(String_$type, 0);
_this.l = new Dictionary$2(String_$type, JsonDictionaryItem.$, 0);
return _this;
}
JsonDictionaryObject.prototype.k = function (a) {
return this.l.containsKey(a) && typeCast(JsonDictionaryValue.$, this.l.item(a)) !== null && this.l.item(a).e == 2;
};
JsonDictionaryObject.prototype.j = function (a) {
return this.l.containsKey(a) && typeCast(JsonDictionaryValue.$, this.l.item(a)) !== null && this.l.item(a).e == 0;
};
JsonDictionaryObject.prototype.i = function (a) {
return this.l.containsKey(a) && typeCast(JsonDictionaryValue.$, this.l.item(a)) !== null && this.l.item(a).e == 1;
};
JsonDictionaryObject.prototype.o = function (a) {
if (!this.k(a)) {
return null;
}
return this.l.item(a).value;
};
JsonDictionaryObject.prototype.n = function (a) {
if (!this.j(a)) {
return NaN;
}
return this.l.item(a).value;
};
JsonDictionaryObject.prototype.h = function (a) {
if (!this.i(a)) {
return false;
}
return this.l.item(a).value;
};
JsonDictionaryObject.prototype.p = function (a, b) {
if (!this.l.containsKey(a)) {
this.m.add(a);
}
this.l.item(a, b);
};
JsonDictionaryObject.prototype.r = function (a) {
if (this.l.containsKey(a)) {
this.m.remove(a);
}
this.l.removeItem(a);
};
JsonDictionaryObject.prototype.q = function () {
this.m.clear();
this.l.clear();
};
JsonDictionaryObject.prototype.item = function (a, b) {
if (arguments.length === 2) {
if (!this.l.containsKey(a)) {
this.m.add(a);
}
this.l.item(a, b);
return b;
}
else {
return this.l.item(a);
}
};
JsonDictionaryObject.prototype.g = function (a) {
return this.l.containsKey(a);
};
JsonDictionaryObject.prototype.e = function () {
return this.m.toArray();
};
JsonDictionaryObject.prototype.d = function (a) {
a.i("{");
a.h();
a.g();
var b = this.e();
if (b != null) {
for (var c = 0; c < b.length; c++) {
if (c > 0) {
a.j(",");
}
var d = b[c];
var e = this.l.item(d);
a.i("\"" + this.a(d) + "\": ");
if (e == null) {
a.i("null");
}
else {
e.d(a);
}
}
}
a.h();
a.e();
a.i("}");
};
JsonDictionaryObject.$t = markType(JsonDictionaryObject, 'JsonDictionaryObject', JsonDictionaryItem.$);
return JsonDictionaryObject;
}(JsonDictionaryItem));
export { JsonDictionaryObject };