void putSlot(Slot s) {
array[head]=s;
head++;
+ if (head >= array.length)
+ head=0;
+
if (oldestseqn==0)
oldestseqn = s.getSequenceNumber();
if (head==tail) {
tail++;
+ if (tail >= array.length)
+ tail=0;
+
oldestseqn++;
}
}
if (index >= array.length ||
index >= head)
return null;
+ if (index < 0) {
+ System.out.println("seqnum="+seqnum);
+ System.out.println("olestseqn="+oldestseqn);
+ System.out.println("diff="+diff);
+ System.out.println("tail="+tail);
+
+ }
+
return array[index];
}