QueryResultAPI.js 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. 'use strict';
  2. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3. /**
  4. * Licensed Materials - Property of IBM
  5. * IBM Business Analytics (C) Copyright IBM Corp. 2018, 2020
  6. * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  7. */
  8. /**
  9. * @interface QueryResultAPI
  10. * @hideconstructor
  11. * @classdesc API class that is used to access a query result object.
  12. * @example queryResults.getResult()
  13. */
  14. define([], function () {
  15. var QueryResultAPI = function () {
  16. function QueryResultAPI() {
  17. _classCallCheck(this, QueryResultAPI);
  18. }
  19. /**
  20. * @function QueryResultAPI#getVersion
  21. * @description Gets the query result version.
  22. * @private
  23. *
  24. * @return {Number} Query result version
  25. */
  26. QueryResultAPI.prototype.getVersion = function getVersion() {};
  27. /**
  28. * @function QueryResultAPI#hasMoreData
  29. * @description Checks if the current query result is complete.
  30. * @private
  31. *
  32. * @return {Boolean} true if query result data object includes hasNext or hasPrev equals to true
  33. */
  34. QueryResultAPI.prototype.hasMoreData = function hasMoreData() {};
  35. /**
  36. * @function QueryResultAPI#getResultItemList
  37. * @description Gets array of {@link ResultItemAPI}.
  38. * @public
  39. *
  40. * @return {ResultItemAPI[]} Array of {@link ResultItemAPI}
  41. */
  42. QueryResultAPI.prototype.getResultItemList = function getResultItemList() {};
  43. /**
  44. * @function QueryResultAPI#getResultItem
  45. * @description Gets result data item with data item unique ID.
  46. * @private
  47. *
  48. * @param {String} resultDataItemID Result data item unique ID
  49. * @return {ResultItemAPI} {@link ResultItemAPI}
  50. */
  51. QueryResultAPI.prototype.getResultItem = function getResultItem() {};
  52. /**
  53. * @function QueryResultAPI#getValue
  54. * @description Gets result data value based on row and column indexes.
  55. * @public
  56. *
  57. * @param {Number} rowIndex Row index of the result data points
  58. * @param {Number} resultDataItemIndex Data item index to get value in {@link ResultItemAPI}
  59. * @return {ResultDataValue[] | ResultDataValue} Array of {@link ResultDataValue}
  60. * @example
  61. * // Category value
  62. * [{
  63. * value: 'dataset_csv.Product_line->[Camping Equipment]',
  64. * label: 'Camping Equipment'
  65. * }]
  66. * @example
  67. * // Measure value
  68. * {
  69. * value: 200
  70. * }
  71. */
  72. QueryResultAPI.prototype.getValue = function getValue() {};
  73. /**
  74. * @function QueryResultAPI#getValueIndex
  75. * @description Given an index in the result, return the index in the resultItem's values where this categorical tuple is found.
  76. * @private
  77. *
  78. * @param {Number} rowIndex The row index (datapoint index)
  79. * @param {Number} resultDataItemIndex The data item index to get value in {@link ResultItemAPI}
  80. * @return {Number} A single number representing the index of the tuple.
  81. * @example The first resultDataItem might be a nested categorical with values like 2004-Cars, 2004-Trucks, 2005-Cars, 2005-Trucks
  82. * // getValueIndex({pointindex}, 0) would return 2 for any datapoint that contains 2005-Cars for the firstitem.
  83. * 2
  84. */
  85. QueryResultAPI.prototype.getValueIndex = function getValueIndex() {};
  86. /**
  87. * @function QueryResultAPI#getDataPointValueList
  88. * @description Get the data points of the query result object.
  89. * @private
  90. *
  91. * @return {Object[]} An array of data point object
  92. * @example
  93. * [{
  94. * pt: [13, 4, {v: 151}, {v: 13834.62}]
  95. * }]
  96. */
  97. QueryResultAPI.prototype.getDataPointValueList = function getDataPointValueList() {};
  98. /**
  99. * @function QueryResultAPI#getRowCount
  100. * @description Gets data row count.
  101. *
  102. * @return {Number} Number of rows of data in a query result object.
  103. */
  104. QueryResultAPI.prototype.getRowCount = function getRowCount() {};
  105. /**
  106. * @function QueryResultAPI#setPropertyValue
  107. * @description Set a property value.
  108. * @private
  109. *
  110. * @param {String} name Property name
  111. * @param {String} value Property value
  112. */
  113. QueryResultAPI.prototype.setPropertyValue = function setPropertyValue() {};
  114. /**
  115. * @function QueryResultAPI#getPropertyValue
  116. * @description Get a property value.
  117. * @private
  118. *
  119. * @param {String} name Property name
  120. * @return {String} Property value
  121. */
  122. QueryResultAPI.prototype.getPropertyValue = function getPropertyValue() {};
  123. return QueryResultAPI;
  124. }();
  125. /**
  126. * @private
  127. * @readonly
  128. * @description Enumeration of result value types
  129. * @enum {string}
  130. * @memberof QueryResultAPI
  131. */
  132. QueryResultAPI.VALUE_TYPE = {
  133. /** Summary value type */
  134. SUMMARY: 'summary'
  135. };
  136. return QueryResultAPI;
  137. });
  138. //# sourceMappingURL=QueryResultAPI.js.map