Java List First Item getPage(List all, int first, int pageSize)

Here you can find the source of getPage(List all, int first, int pageSize)

Description

get Page

License

Contributor Agreement License

Declaration

public static <E> List<E> getPage(List<E> all, int first, int pageSize) 

Method Source Code

//package com.java2s;
/*//from   w w w  . j  a va  2s.  c  o  m
 *
 *
 * Copyright (C) 2007 Pingtel Corp., certain elements licensed under a Contributor Agreement.
 * Contributors retain copyright to elements licensed under a Contributor Agreement.
 * Licensed to the User under the LGPL license.
 *
 *
 */

import java.util.List;

public class Main {
    public static <E> List<E> getPage(List<E> all, int first, int pageSize) {
        int last = first + pageSize;
        if (last > all.size()) {
            last = all.size();
        }
        return all.subList(first, last);
    }
}

Related

  1. getFirstValueString(List values)
  2. getIndexOfFirstMatchingProperty(List propertyNames, String follower)
  3. getListBetween(String inputStr, String first, String second, List list)
  4. getNFirstBytes(int n, List byteList)
  5. getOnlyFirst(List obj)
  6. getStringFirstResult(List> llo, String reason)
  7. hasSameElement(List firstList, List secondList)
  8. isFirst(List list, V object)
  9. isFirstAnnotationOfMethod(List lines, int lineNumber)