4 * Slot indexer allows slots in both the slot buffer and the new
5 * server response to looked up in a consistent fashion.
11 private Slot[] updates;
12 private SlotBuffer buffer;
13 private long firstslotseqnum;
15 SlotIndexer(Slot[] _updates, SlotBuffer _buffer) {
18 firstslotseqnum = updates[0].getSequenceNumber();
21 Slot getSlot(long seqnum) {
22 if (seqnum >= firstslotseqnum) {
23 int offset = (int) (seqnum - firstslotseqnum);
24 if (offset >= updates.length)
25 throw new Error("Invalid Slot Sequence Number Reference");
27 return updates[offset];
29 return buffer.getSlot(seqnum);