List of utility methods to do List Ends with
boolean | endsWith(List left, List right, boolean equals) ends With if (left == null || right == null) return false; int l = left.size(); int r = right.size(); if (r > l || !equals && r == l) return false; for (int i = 0; i < r; i++) if (!equals(left.get(l - i - 1), right.get(r - i - 1))) ... |
boolean | endsWith(List left, List right, boolean equals) ends With if (left == null || right == null) { return false; } else { int l = left.size(); int r = right.size(); if (r > l || !equals && r == l) { return false; for (int i = 0; i < r; i++) { if (!equals(left.get(l - i - 1), right.get(r - i - 1))) { return false; return true; |
boolean | endsWith(List ends With return endsWith(source, prefix, 0);
|
boolean | endsWith(List Check that the provided list ends with the provided items if (hierarchy.size() < items.length) { return false; final int firstI = hierarchy.size() - items.length; for (int i = firstI; i < hierarchy.size(); i++) { if (!hierarchy.get(i).equals(items[i - firstI])) { return false; return true; |
boolean | endsWith(List Checks if list ends with the specific suffix int idx = lst.size() - suffix.size(); if (idx < 0) { return false; for (int i = 0; i < suffix.size(); i++) { if (!lst.get(idx + i).equals(suffix.get(i))) { return false; return true; |
boolean | endsWith(List Checks if the list ends with specific elements. final int stringSize = string.size(); final int suffixSize = suffix.size(); if (suffixSize > stringSize) { return false; return suffix.equals(string.subList(stringSize - suffixSize, stringSize)); |