Java Utililty Methods List Sub List

List of utility methods to do List Sub List

Description

The list of methods to do List Sub List are organized into topic(s).

Method

ListsubListMaxSize(List list, int maxSize)
sub List Max Size
return subListMaxSize(list, 0, maxSize);
ListsubListPage(List baseList, int fromIndex, int maxPageSize)
sub List Page
int toIndex = Math.min(baseList.size(), fromIndex + maxPageSize);
return baseList.subList(fromIndex, toIndex);
ListtruncatedSubList(List inList, int start, int end)
Gets a sublist of a list, truncated at the end of the list if too many elements are selected.
final int limit = Math.min(end, inList.size());
return inList.subList(start, limit);