Here you can find the source of assertIndex(final int size, final int index)
Parameter | Description |
---|---|
size | the size of the list |
index | the index to be checked |
public static void assertIndex(final int size, final int index)
//package com.java2s; //License from project: Apache License public class Main { /**/*from w w w . ja va 2 s. c om*/ * Make sure the index provided as input is inside the range of possible * elements of a list. * * @param size * the size of the list * * @param index * the index to be checked */ public static void assertIndex(final int size, final int index) { if (index < 0 || index >= size) { throw new ArrayIndexOutOfBoundsException(); } } }