Java List Sub List sublist(List list, int start, int limit)

Here you can find the source of sublist(List list, int start, int limit)

Description

Sub list

License

Apache License

Declaration

public static <T> List<T> sublist(List<T> list, int start, int limit) 

Method Source Code

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

import java.util.List;

public class Main {
    /**/*from w  w w. j a  v a 2s. c o  m*/
     * Sub list
     *
     * @return
     */
    public static <T> List<T> sublist(List<T> list, int start, int limit) {
        int fromIndex = Math.min(start, list.size());
        int toIndex = Math.min(fromIndex + limit, list.size());
        return list.subList(fromIndex, toIndex);
    }
}

Related

  1. sublist(List l, int fromIndex, int toIndex)
  2. subList(List list, int fromIndex, int toIndex)
  3. subList(List list, int fromIndex, int toIndex)
  4. subList(List list, int size)
  5. subList(List list, int start, int end)
  6. subList(List list, int start, int max)
  7. subList(List list, int[] indexs)
  8. subList(List origin, int start, int length)
  9. subList(List parentList, int start, int end)