List of utility methods to do List Reverse
List> | addReverse(List list, List append) Adds the contents of one list to the other in reverse order. for (ListIterator i = append.listIterator(append.size()); i.hasPrevious();) list.add(i.previous()); return list; |
int | compareVersions(List INTERNAL: Compares two lists of Integers -1, 0, 1 means the first list is less than, equal, greater than the second list. int n = Math.max(list1.size(), list2.size()); int res = 0; for (int i = 0; i < n; i++) { int l1 = 0; if (i < list1.size()) { l1 = list1.get(i); int l2 = 0; ... |
int | compareVersions(List compare Versions for (Iterator<Integer> it1 = version1.iterator(), it2 = version2.iterator();;) { if (!it1.hasNext()) { return it2.hasNext() ? -1 : 0; if (!it2.hasNext()) { return it1.hasNext() ? 1 : 0; Integer num1 = it1.next(); ... |
int | compareVersions(String version1, String version2) Compares two versions strings (ex. return compareVersions(version1, version2, 3);
|
List | createReversedList(List create Reversed List List<T> result = new ArrayList<T>(inputList); Collections.reverse(result); return result; |
E | firstElementOf(List Returns the first element of a given List return list != null && !list.isEmpty() ? list.get(0) : null;
|
String | formatToIp(final List Formats a List with short values into it's IP-Address representation. if (shortList == null) { return null; if (reverseOrder) { Collections.reverse(shortList); return shortList.toString().replaceAll(",[ ]*", ".").replaceAll("[\\[\\]]", ""); |
Iterable | getReversedListIterable(final List get Reversed List Iterable return new Iterable<T>() { @Override public Iterator<T> iterator() { return getReversedListIterator(inList); }; |
Iterable | iterateReverse(final List iterate Reverse return new Iterable<T>() { @Override public Iterator<T> iterator() { return new Iterator<T>() { ListIterator<T> it = elements.listIterator(elements.size()); @Override public boolean hasNext() { return it.hasPrevious(); ... |
String | listToArrowSep(List list To Arrow Sep if (strings.isEmpty()) return "&6None"; StringBuilder sb = new StringBuilder(); for (String s : strings) { if (s.equalsIgnoreCase(highlightFirst)) { sb.append("&b").append(s).append("&4").append(reversed ? " <--- " : " ---> "); } else if (s.equalsIgnoreCase(highlightSecond)) { sb.append("&b").append(s).append("&7").append(reversed ? " <--- " : " ---> "); ... |