list-runner
Version:
a lightweight linked-list implementation that offers both Singly (next) and Doubly data structures (next and previous)
42 lines (33 loc) • 1.17 kB
JavaScript
;
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.SentinelSingly = void 0;
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
var _constants = require("../constants");
var SentinelSingly =
/*#__PURE__*/
function () {
function SentinelSingly() {
var next = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _constants.SENTINEL;
(0, _classCallCheck2["default"])(this, SentinelSingly);
this.type = type;
this.next = next;
}
(0, _createClass2["default"])(SentinelSingly, [{
key: "getNext",
value: function getNext() {
return this.next;
}
}, {
key: "setNext",
value: function setNext(cell) {
this.next = cell;
}
}]);
return SentinelSingly;
}(); // eslint-disable-line import/prefer-default-export
exports.SentinelSingly = SentinelSingly;