3 var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
5 function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
7 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; }
9 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; }
11 var TableStatus = function (_Entry) {
12 _inherits(TableStatus, _Entry);
14 function TableStatus(slot, _maxslots) {
15 _classCallCheck(this, TableStatus);
17 var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(TableStatus).call(this, slot));
19 _this.maxslots = _maxslots;
23 _createClass(TableStatus, [{
25 value: function getMaxSlots() {
30 value: function encode(bb) {
31 bb.writeByte(Entry.TypeTableStatus);
32 bb.writeInt8(this.maxslots);
36 value: function getSize() {
41 value: function getType() {
42 return Entry.TypeTableStatus;
46 value: function getcopy(s) {
47 if (!(s instanceof Slot)) {
48 throw new Error('Argument Error: s is not an instanceof Slot');
50 return new TableStatus(s, this.maxslots);
54 value: function decode(slot, bb) {
55 //bb is an object of the type bytebuffer See main.js file and its require section
57 if (!(bb instanceof ByteBuffer && slot instanceof Slot)) {
58 throw new Error('Argument Error: bb is not an instanceof Bytebuffer');
60 this.maxslots = bb.readByte();
61 return new TableStatus(slot, this.maxslots);