List of utility methods to do List Last Item
List | addDelimiter(List add Delimiter int amountLines = lines.size(); int index = 0; for (String line : lines) { line = line.trim(); boolean isLastLine = index + 1 == amountLines; if (!isLastLine || isDelimitedLastLine) { if (!line.endsWith(delimiter)) { line = line + delimiter; ... |
void | addLast(T e, List Add the element to the last position of a list. list.add(e); |
void | addLastElement(List add Last Element list.add(list.size(), element); |
String | buildPathFromComponentsUpToIndex(final List Given a list of path components, as produced by the breakIRODSPathIntoComponents , re-create an iRODS absolute path by simply stringing together the path components with the iRODS '/' delimiter.
if (pathComponents == null) { throw new IllegalArgumentException("null pathComponents"); StringBuilder sb = new StringBuilder(); int i = 0; for (String pathComponent : pathComponents) { if (!pathComponent.isEmpty()) { if (lastIndex >= 0) { ... |
byte[] | flattenByteSegments(List byteSegments, int eachSegmentButLastLength, int lastSegmentLength) Turns a List of equally-sized byte segments (buffers) into a single buffer by concatenating them one by one. if (byteSegments.isEmpty()) return new byte[0]; else { int totalBytes = eachSegmentButLastLength * (byteSegments.size() - 1) + lastSegmentLength; byte[] flattenedBytes = new byte[totalBytes]; int nextSegmentOffset = 0; for (int i = 0; i < byteSegments.size() - 1; i++) { System.arraycopy(byteSegments.get(i), 0, flattenedBytes, nextSegmentOffset, ... |
T | getLast(final List extends T> list) Gets the last element of the list. if (list == null || list.isEmpty()) { return null; } else { return list.get(list.size() - 1); |
T | getLast(final List Gets the last object from the given List. if (!isEmpty(list) && 0 < list.size()) { return list.get(list.size() - 1); return null; |
E | getLast(List Returns the last element of a list or null, if empty. if (list.isEmpty()) { return null; return list.get(list.size() - 1); |
T | getLast(List Returns the last object in the given list. return get(aList, size(aList) - 1);
|
T | getLast(List get Last return elements.get(elements.size() - 1);
|