Java List Sub List getSubList(List list, int from, int maxnum)

Here you can find the source of getSubList(List list, int from, int maxnum)

Description

get Sub List

License

Apache License

Declaration

public static <T> List<T> getSubList(List<T> list, int from, int maxnum) 

Method Source Code

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

import java.util.ArrayList;

import java.util.List;

public class Main {
    public static <T> List<T> getSubList(List<T> list, int from, int maxnum) {
        if (list == null || list.size() <= from)
            return new ArrayList<T>();
        return new ArrayList(list.subList(from, Math.min(from + maxnum, list.size())));
    }/*from   w ww.  j  a va 2s .c om*/
}

Related

  1. getSubList(int offset, int count, List originalList)
  2. getSubList(List entireList, Class cls)
  3. getSubList(List list, Class type)
  4. getSubList(List source, int nFrom, int nTo)
  5. getSubList(List allKeys, String part)
  6. getSublist(List list, int i)
  7. getSubList(List list, int start, int end)
  8. getSubList(List list, int start, int limit)
  9. getSubListFromStart(List list, int length)