Java List Contain containsIndex(int index, List objects)

Here you can find the source of containsIndex(int index, List objects)

Description

Determines whether the specified index is not null in the specified list.

License

Open Source License

Parameter

Parameter Description
index a parameter
objects a parameter

Declaration

public static boolean containsIndex(int index, List<?> objects) 

Method Source Code

//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;
    }
}

Related

  1. containsIgnoreCase(List list, String findMe)
  2. containsIgnoreCase(List list, String s)
  3. containsIgnoreCase(List list, String soughtFor)
  4. containsIgnoreCase(String str, String... list)
  5. containsInAnyOrder(final List test, final List control)
  6. containsInEach(List first, List second)
  7. ContainsInList(String list, String value)
  8. containsInOrder(List a, List b)
  9. containsInstance(final List list, final Class clazz)