@Override public ObjectBigListIterator<K> listIterator(final long index) { ensureIndex(index); return new ObjectBigListIterator<K>() { long pos = index, last = -1;
@Override public void add(final long index, final K k) { ensureIndex(index); grow(size + 1); if (index != size) ObjectBigArrays.copy(a, index, a, index + 1, size - index); ObjectBigArrays.set(a, index, k); size++; assert size <= ObjectBigArrays.length(a); } @Override
/** * Adds elements to this type-specific list using optimized system calls. * * @param index * the index at which to add elements. * @param a * the big array containing the elements. * @param offset * the offset of the first element to add. * @param length * the number of elements to add. */ @Override public void addElements(final long index, final K a[][], final long offset, final long length) { ensureIndex(index); ObjectBigArrays.ensureOffsetLength(a, offset, length); grow(size + length); ObjectBigArrays.copy(this.a, index, this.a, index + length, size - index); ObjectBigArrays.copy(a, offset, this.a, index, length); size += length; } @Override