'use strict'; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** * Licensed Materials - Property of IBM * IBM Business Analytics (C) Copyright IBM Corp. 2019, 2020 * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. */ define(['./VIPRDecoratable', './VIPRItemClassSet', './VIPRTuple'], function (VIPRDecoratable, VIPRItemClassSet, VIPRTuple) { // implements ICatDataItem var VIPRCatDataItem = function (_VIPRDecoratable) { _inherits(VIPRCatDataItem, _VIPRDecoratable); function VIPRCatDataItem(resultItem, context, content) { _classCallCheck(this, VIPRCatDataItem); var _this = _possibleConstructorReturn(this, _VIPRDecoratable.call(this, resultItem, context)); _this.resultItem = resultItem; _this.context = context; _this.content = content; _this.dataItemIndex = _this.context.index.dataitem; _this.dataset = _this.context.dataset; var slot = _this.dataset.slots[_this.dataItemIndex]; _this.dataItemFormats = []; slot.getDataItemList().forEach(function (dataItem) { _this.dataItemFormats.push(dataItem.getFormat()); }); _this.tuples = []; _this.itemClassSets = [new VIPRItemClassSet(_this.resultItem.getDataItemList(), _this.context)]; _this.viprItemCache = {}; return _this; } VIPRCatDataItem.prototype.getUniqueName = function getUniqueName() {}; VIPRCatDataItem.prototype.postProcessing = function postProcessing() {}; VIPRCatDataItem.prototype.getCaption = function getCaption() {}; VIPRCatDataItem.prototype.getType = function getType() { return 'cat'; }; VIPRCatDataItem.prototype.getTupleCount = function getTupleCount() { return this.resultItem ? this.resultItem.getRowCount() : 0; }; VIPRCatDataItem.prototype.getTuple = function getTuple(index) { if (index < this.getTupleCount() && this.tuples[index] === undefined) { this.context.dataset = this.dataset; var tuple = this.resultItem.getValue(index); this.context.index = { dataitem: this.dataItemIndex, dataItemFormats: this.dataItemFormats, tuple: index, itemClassSet: 0 }; this.tuples[index] = new VIPRTuple(tuple, this.context, this.content, this.viprItemCache); } return this.tuples[index]; }; VIPRCatDataItem.prototype.getDataWindowStart = function getDataWindowStart() { return 0; }; VIPRCatDataItem.prototype.getDataWindowEnd = function getDataWindowEnd() { return this.getTupleCount(); }; VIPRCatDataItem.prototype.getItemClassSetCount = function getItemClassSetCount() { return this.itemClassSets.length; }; VIPRCatDataItem.prototype.getItemClassSet = function getItemClassSet(index) { return this.itemClassSets[index || 0]; }; return VIPRCatDataItem; }(VIPRDecoratable); return VIPRCatDataItem; }); //# sourceMappingURL=VIPRCatDataItem.js.map