Java List Sub List getSubList(List entireList, Class cls)

Here you can find the source of getSubList(List entireList, Class cls)

Description

get report elements

License

Apache License

Declaration

public static List getSubList(List entireList, Class cls) 

Method Source Code

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

import java.util.ArrayList;

import java.util.List;

public class Main {
    /**//w w  w .  ja v  a 2s.  c o  m
     * get report elements
     * @return
     */
    public static List getSubList(List entireList, Class cls) {
        List list = new ArrayList();
        for (Object e : entireList) {
            if (cls.isInstance(e))
                list.add(cls.cast(e));
        }
        return list;
    }
}

Related

  1. divideListInSublistsOfNSize(List list, int n)
  2. getIndexesId(List aList, List aSubList)
  3. getIndicesOfItems(List superList, List sublist)
  4. getRandomSubList(List inputList, double percentage)
  5. getSubList(int offset, int count, List originalList)
  6. getSubList(List list, Class type)
  7. getSubList(List source, int nFrom, int nTo)
  8. getSubList(List allKeys, String part)
  9. getSubList(List list, int from, int maxnum)