4 static final int DEFAULT_SIZE = 128;
9 private long oldestseqn;
12 array=new Slot[DEFAULT_SIZE+1];
18 return (array.length + head) - tail;
21 void resize(int newsize) {
22 if (newsize == (array.length-1))
24 Slot[] newarray = new Slot[newsize+1];
25 int currsize = size();
27 for(int i=0; i < currsize; i++) {
28 newarray[i] = array[index];
29 if ((++index) == array.length)
37 void putSlot(Slot s) {
41 oldestseqn = s.getSequenceNumber();
49 Slot getSlot(long seqnum) {
50 int diff=(int) (seqnum-oldestseqn);
51 int index=diff + tail;
52 if (index > array.length) {
58 if (index >= array.length ||
65 long getOldestSeqNum() {
69 long getNewestSeqNum() {
70 return oldestseqn + size();