Here you can find the source of containsIndex(int index, List> objects)
Parameter | Description |
---|---|
index | a parameter |
objects | a parameter |
public static boolean containsIndex(int index, List<?> objects)
//package com.java2s; //License from project: Open Source License import java.util.List; public class Main { /**// w ww . j a v a 2 s . com * Determines whether the specified index is not null in the specified list. * @param index * @param objects * @return */ public static boolean containsIndex(int index, List<?> objects) { if (objects.size() >= index) { for (int i = 0; i < objects.size(); i++) { if (i == index) { return true; } } } return false; } }