4 * Circular buffer that holds the live set of slots.
10 static final int DEFAULT_SIZE = 128;
15 private long oldestseqn;
18 array=new Slot[DEFAULT_SIZE+1];
26 return (array.length + head) - tail;
30 return array.length - 1;
33 void resize(int newsize) {
34 if (newsize == (array.length-1))
36 Slot[] newarray = new Slot[newsize+1];
37 int currsize = size();
39 for(int i=0; i < currsize; i++) {
40 newarray[i] = array[index];
41 if ((++index) == array.length)
49 private void incrementHead() {
51 if (head >= array.length)
55 private void incrementTail() {
57 if (tail >= array.length)
61 void putSlot(Slot s) {
66 oldestseqn = s.getSequenceNumber();
74 Slot getSlot(long seqnum) {
75 int diff=(int) (seqnum-oldestseqn);
76 int index=diff + tail;
77 if (index >= array.length) {
83 if (index >= array.length)
86 if (head >= tail && index >= head)
92 long getOldestSeqNum() {
96 long getNewestSeqNum() {
97 return oldestseqn + size() - 1;