2 constructor(_updates,_buffer){
3 // updates is an array of slot objects
4 // buffer is an instanceof slotbuffer constructor object in slotbuffer.js
5 this.updates = _updates;
6 if(_buffer && _buffer instanceof SlotBuffer){
9 throw new Error("Argument error Buffer should be an instance of SlotBuffer");
11 this.firstslotseqnum = this.updates[0].getSequenceNumber();
15 if(seqnum >= this.firstslotseqnum){
16 var offset = seqnum - this.firstslotseqnum;
17 if(offset >= this.updates.length){
18 throw new Error('Invalid Slot Sequence Number Reference');
20 return this.updates[offset];
23 return this.buffer.getSlot(seqnum);