Java List First Item removeFirst(List list)

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

Description

remove First

License

Apache License

Declaration

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

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.util.ArrayList;

import java.util.List;

public class Main {

    public static <T> List<T> removeFirst(List<T> list) {
        if (list != null && list.size() > 0) {
            List<T> newList = new ArrayList<T>();
            for (int i = 1; i < list.size(); i++) {
                T t = list.get(i);//from  w  ww  .  ja  v a2s .  c o m
                newList.add(t);
            }
            return newList;
        } else {
            return list;
        }
    }
}

Related

  1. orderByFuzzyFirstOccurenceInText(String listToOrder[], String textToParse)
  2. permutationsWithFirstElement(List listings)
  3. prepend(String first, List list)
  4. putFirstLast(List list)
  5. removeFirst(final List list)
  6. removeFirst(List list)
  7. removeFirstElement(List l)
  8. removeFirstHalfElements(final List list)
  9. replace(int codePoint, int firstCharacterInGroup, List referenceList)