List of utility methods to do List Sort
int | getOverlapCount(List get Overlap Count if (!sorted) { Collections.sort(list1); Collections.sort(list2); if (list1.size() > list2.size()) { List<T> temp = list1; list1 = list2; list2 = temp; ... |
List | getSortedFilesList(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; |
List | getSortedKetList(HashMap 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; |
LinkedList | getSortedList(Collection collection) get Sorted List LinkedList list = new LinkedList<>(collection); Collections.sort(list); return list; |
List | getSortedList(Set get Sorted List List<String> l = new ArrayList<>(items); Collections.sort(l); return l; |
List | getSortedStringList(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 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; |
Double | interpolateLinearlyQuantile(List 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 { ... |
boolean | isEqualList(final List 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); ... |
boolean | isSorted(Iterable extends E> 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; ... |