o[i] = obj; size++;
}
public Object set(int i, Object obj) {
- if (i >= size) throw new IndexOutOfBoundsException(
+ if (i >= o.length) throw new IndexOutOfBoundsException(
"index "+i+" is beyond list boundary "+size);
- Object old = o[i]; o[i] = obj; return old;
+ Object old = o[i]; o[i] = obj;
+ size = Math.max(i+1, size);
+ return old;
}
public Object get(int i) {
if (i >= size) throw new IndexOutOfBoundsException(
int dest = orig * indexmultiple;
int tries = 1;
boolean plus = true;
-
while (entries[dest] != null) {
if (equals(k, entries[dest])) return dest;
dest = Math.abs((orig + (plus ? 1 : -1) * tries * tries) % (entries.length / indexmultiple)) * indexmultiple;