Java Utililty Methods List Sort

List of utility methods to do List Sort

Description

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

Method

intgetOverlapCount(List list1, List list2, boolean sorted)
get Overlap Count
if (!sorted) {
    Collections.sort(list1);
    Collections.sort(list2);
if (list1.size() > list2.size()) {
    List<T> temp = list1;
    list1 = list2;
    list2 = temp;
...
ListgetSortedFilesList(String filesList)
Transforms a string containing an unsorted list of files into a sorted List of files.
List<String> files = new ArrayList<String>(Arrays.asList(filesList.split(";")));
Collections.sort(files);
return files;
ListgetSortedKetList(HashMap numKnownGenesHashMap)
get Sorted Ket List
List<String> ret = new ArrayList<String>();
final Set<String> keySet = numKnownGenesHashMap.keySet();
for (String key : keySet) {
    ret.add(key);
Collections.sort(ret);
return ret;
LinkedListgetSortedList(Collection collection)
get Sorted List
LinkedList list = new LinkedList<>(collection);
Collections.sort(list);
return list;
ListgetSortedList(Set items)
get Sorted List
List<String> l = new ArrayList<>(items);
Collections.sort(l);
return l;
ListgetSortedStringList(List pathList)
get Sorted String List
List<String> sortedList = new ArrayList<String>();
for (Object path : pathList) {
    sortedList.add(path.toString());
Collections.sort(sortedList);
return sortedList;
long[][]getZipfPlotData(List sortedCount)
Expects sorted count in a decreasing order.
long[][] plotData = new long[sortedCount.size()][];
for (int rank = 0; rank < sortedCount.size(); rank++) {
    plotData[rank] = new long[] { rank, sortedCount.get(rank) };
return plotData;
DoubleinterpolateLinearlyQuantile(List sortedDataAscendingOrder, Double p)
Interpolate linearly an quantile Inspired on: http://msenux.redwoods.edu/math/R/boxplot.php
int n = sortedDataAscendingOrder.size();
double position = (1 + (p * (n - 1)));
int leftIndex = (int) Math.floor(position) - 1;
int rightIndex = (int) Math.ceil(position) - 1;
Double quantile;
if (leftIndex == rightIndex) {
    quantile = sortedDataAscendingOrder.get(leftIndex);
} else {
...
booleanisEqualList(final List list1, final List list2, Comparator c, boolean sortList)
is Equal List
if (list1 == list2) {
    return true;
if (list1 == null || list2 == null || list1.size() != list2.size()) {
    return false;
if (sortList) {
    Collections.sort(list1, c);
...
booleanisSorted(Iterable list)
Returns whether an iterable is in non-descending order.
final Iterator<? extends E> iterator = list.iterator();
if (!iterator.hasNext()) {
    return true;
E e = iterator.next();
for (;;) {
    if (!iterator.hasNext()) {
        return true;
...