Java List Last Item getLastBefore(List list)

Here you can find the source of getLastBefore(List list)

Description

get Last Before

License

Open Source License

Declaration

public static <T> T getLastBefore(List<T> list) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.util.List;

public class Main {

    public static <T> T getLastBefore(List<T> list) {
        int size = list.size();
        if (size >= 2) {
            return list.get(size - 2);
        } else {//from  www.  j  av a 2s  .c  o m
            return null;
        }
    }
}

Related

  1. getLast(List list)
  2. getLast(List list)
  3. getLast(List list)
  4. getLast(List source)
  5. getLast(List list)
  6. getLastDateFromTimeSeriesDeltas(Double xAxisStart, List xAxisDeltas)
  7. getLastElement(List list)
  8. getLastNameIndex(List list)
  9. getLastNonNullIndex(final List list)