I tried
cache = new Vector<CacheBlock>(1024);
...
cache.add(10, blk); // gives index out of bounds
So is it impossible to insert (into specified index) into an empty list? Or how might I fill up all elements if the Vector, with null or otherwise, so I can accomplish this?
You could use setSize() to make sure your cache is big enough before you insert elements: