Java List Sub List getSubList(List allKeys, String part)

Here you can find the source of getSubList(List allKeys, String part)

Description

get Sub List

License

Open Source License

Declaration

public static <T> List<T> getSubList(List<T> allKeys, String part) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.List;

public class Main {
    public static <T> List<T> getSubList(List<T> allKeys, String part) {
        int start = Integer.parseInt(part.split(":")[0]);
        int end = Integer.parseInt(part.split(":")[1]);
        if (end > allKeys.size()) {
            end = allKeys.size();/*from  w  ww .  j  a  v a  2  s.c om*/
        }
        return allKeys.subList(start, end);
    }
}

Related

  1. getRandomSubList(List inputList, double percentage)
  2. getSubList(int offset, int count, List originalList)
  3. getSubList(List entireList, Class cls)
  4. getSubList(List list, Class type)
  5. getSubList(List source, int nFrom, int nTo)
  6. getSubList(List list, int from, int maxnum)
  7. getSublist(List list, int i)
  8. getSubList(List list, int start, int end)
  9. getSubList(List list, int start, int limit)