Java List Sub List subList(List list, int start, int end)

Here you can find the source of subList(List list, int start, int end)

Description

sub List

License

Open Source License

Declaration

@SuppressWarnings({ "unchecked", "rawtypes" })
    public static List subList(List list, int start, int end) 

Method Source Code


//package com.java2s;
/*/*from   w  w  w  . j a v  a  2 s.  c om*/
 * Ext GWT 2.2.5 - Ext for GWT
 * Copyright(c) 2007-2010, Ext JS, LLC.
 * licensing@extjs.com
 * 
 * http://extjs.com/license
 */

import java.util.ArrayList;

import java.util.List;

public class Main {
    @SuppressWarnings({ "unchecked", "rawtypes" })
    public static List subList(List list, int start, int end) {
        List temp = new ArrayList();
        for (int i = start; i < end; i++) {
            temp.add(list.get(i));
        }
        return temp;
    }
}

Related

  1. subList(final List list, final int first, final int count)
  2. subList(final List list, final int offset, final int amount)
  3. subList(final List list, final int startIndex, final int endIndex)
  4. subList(final List source, final int... indices)
  5. sublist(LinkedHashSet base, int start, int count)
  6. subList(List list, int fromIndex, int toIndex)
  7. subList(List list, int page, int size)
  8. subList(List list, int fromIndex)
  9. subList(List list, int skip, int top)