public class ListUtils extends Object
Constructor and Description |
---|
ListUtils() |
Modifier and Type | Method and Description |
---|---|
static <T> List<T> |
copySubList(List<T> list,
int fromIndex,
int toIndex)
Unlike List.subList(), which returns a live view of a set of List
elements, this method returns a new copy of the list.
|
public static <T> List<T> copySubList(List<T> list, int fromIndex, int toIndex)
list
- The source ListfromIndex
- Starting index in the source ListtoIndex
- Ending index in the source ListIndexOutOfBoundsException
- Call exceeds the bounds of the source ListIllegalArgumentException
- fromIndex and toIndex are not in sequenceCopyright © 2005–2018. All rights reserved.