Java List Null Empty getIgnoreNull(List list, int n)

Here you can find the source of getIgnoreNull(List list, int n)

Description

get Ignore Null

License

Apache License

Declaration

public static <T> T getIgnoreNull(List<T> list, int n) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.util.List;

public class Main {
    public static <T> T getIgnoreNull(List<T> list, int n) {
        int cnt = 0;
        for (T i : list)
            if (i != null) {
                if (cnt == n)
                    return i;
                cnt++;//from w w w  .  j a  va2  s. co  m
            }
        return null;
    }
}

Related

  1. fillNull(final List list, final int numElements)
  2. fillNull(List lst, int size)
  3. fillUpWithNulls(List list)
  4. getEmptyList(Class cls)
  5. getEmptyList(Class tClass)
  6. getListIgnoringNulls(T[] items)
  7. getNonNull(List list)
  8. getNotNullCount(List list)
  9. getNotNullId(final List idList)