Java Utililty Methods List Last Item

List of utility methods to do List Last Item

Description

The list of methods to do List Last Item are organized into topic(s).

Method

TgetLast(List source)
get Last
return source.isEmpty() ? null : source.get(source.size() - 1);
VgetLast(List list)
get Last
return getLast(list, null);
TgetLastBefore(List list)
get Last Before
int size = list.size();
if (size >= 2) {
    return list.get(size - 2);
} else {
    return null;
DoublegetLastDateFromTimeSeriesDeltas(Double xAxisStart, List xAxisDeltas)
get Last Date From Time Series Deltas
Double ret = xAxisStart;
for (Double delta : xAxisDeltas) {
    ret += delta;
return ret;
TgetLastElement(List list)
get Last Element
return list.get(list.size() - 1);
intgetLastNameIndex(List list)
get Last Name Index
for (int i = list.size() - 1; i >= 0; i--) {
    if ((list.get(i).length() > 1) && (!personStopWordSet.contains(list.get(i)))) {
        return i;
return -1;
intgetLastNonNullIndex(final List list)
get Last Non Null Index
for (int i = list.size() - 1; i >= 0; i--) {
    final Object o = list.get(i);
    if (o != null) {
        return i;
return -1;
TgetLastOrNull(List l)
get Last Or Null
final int size = l.size();
if (size == 0)
    return null;
return l.get(size - 1);
TgetLastOrNull(List list)
Get the last element of a list, or return null.
if (list.isEmpty())
    return null;
return list.get(list.size() - 1);
StringBuffergetLastSectionDays(List sections)
get Last Section Days
if (sections.size() == 0) {
    return new StringBuffer();
} else {
    return (StringBuffer) sections.get(sections.size() - 1);