List of utility methods to do List Last Item
List | getLastXItems(int lastXItems, List get Last X Items ArrayList<T> sizedList = new ArrayList<T>(list); if (lastXItems < 0) lastXItems = 0; sizedList.subList(0, Math.max(sizedList.size() - lastXItems, 0)).clear(); return sizedList; |
boolean | isLast(List> list, Object o) is Last if (list.get(list.size() - 1).equals(o)) { return true; return false; |
boolean | isLast(T object, List is Last if (isEmpty(list)) return false; Object last = getLast(list); return last == null ? object == null : last.equals(object); |
boolean | isLastIdx(List> l, int idx) is Last Idx return l.size() == (idx + 1);
|
boolean | isLastIndex(List> list, int index) is Last Index return index == getLastIndex(list);
|
boolean | isLastIndex(List is Last Index return i == suggestedList.size() - 1;
|
int | lastIndexOf(List last Index Of for (int i = lines.size() - 1; i >= 0; i--) { String line = lines.get(i); if (matchLine(line, conditions)) return i; return -1; |
int | lastIndexOfIdentical(List Finds the last location of an element in the List using the == operator for comparison. for (int i = startingAt; i >= 0; i--) { if (l.get(i) == element) { return i; return -1; |
StringBuffer | listToWorkspaceLocationHistoryString(List list To Workspace Location History String StringBuffer lastUsedWorkspaceLocations = new StringBuffer(); for (String workspaceLocationHistoryEntry : lastUsedWorkspaceLocationList) { lastUsedWorkspaceLocations.append(workspaceLocationHistoryEntry); lastUsedWorkspaceLocations.append(WORKSPACE_LOCATION_HISTORY_PREFERENCE_SPLIT_CHAR); return lastUsedWorkspaceLocations; |
boolean | removeBySwapLast(List Removes element from List by swapping with last element. int idx = a.indexOf(o); if (idx == -1) return false; removeBySwapLast(a, idx); return true; |