addElements
Insert a contiguous block of elements supplied as a raw array slice.
Preconditions checked:
offsetandlengthmust define a valid slice ofa.no element in slice may be null (throws NullPointerException).
each element's computed weight must be within bounds.
the block's weights must be non-decreasing internally.
the block must fit between neighbor weights at
index.
On success, elements and weights are inserted as a contiguous block.
Parameters
index
insertion index
a
source array
offset
offset in a
length
number of elements to insert
Throws
for invalid index/offset/length
for null element in the array slice
if any weight is out of bounds or order/fit checks fail