Java Collection First removeFirst(Collection c)

Here you can find the source of removeFirst(Collection c)

Description

remove First

License

Open Source License

Declaration

public static <X> Collection<X> removeFirst(Collection<X> c) 

Method Source Code


//package com.java2s;
import java.util.*;

public class Main {
    public static <X> Collection<X> removeFirst(Collection<X> c) {
        List<X> list;/*from w  w w . jav a2  s .  c  o  m*/
        if (c == null || c.size() == 0) {
            list = Collections.emptyList();
        } else {
            list = new ArrayList<X>(c);
            list.remove(0);
        }
        return list;
    }
}

Related

  1. getFirstSortedItem( Collection items, T defaultValue)
  2. getUnionSize(Collection firstCollection, Collection secondCollection)
  3. intersect(Collection firstSet, Collection secondSet)
  4. nullSafeFirstElement(Collection collection)
  5. removeFirst(Collection collection, int numToRemove)
  6. sub(Collection coll, int first, int size)
  7. subtract(Collection firstCollection, Collection secondCollection)
  8. union(Collection firstSet, Collection secondSet)