checkElementIndex
Ensures that index
specifies a valid element in an array, list or string of size size
. An element index may range from zero, inclusive, to size
, exclusive.
Parameters
index
a user-supplied index identifying an element of an array, list or string
size
the size of that array, list or string
Throws
if index
is negative or is not less than size
if size
is negative
Ensures that index
specifies a valid element in an array, list or string of size size
. An element index may range from zero, inclusive, to size
, exclusive.
Parameters
index
a user-supplied index identifying an element of an array, list or string
size
the size of that array, list or string
desc
the text to use to describe this index in an error message
Throws
if index
is negative or is not less than size
if size
is negative