Java Collection First getFirst(Collection c)

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

Description

get First

License

Open Source License

Declaration

private static Object getFirst(Collection<?> c) 

Method Source Code


//package com.java2s;

import java.util.Collection;

public class Main {
    private static Object getFirst(Collection<?> c) {
        if (c == null || c.isEmpty()) {
            return null;
        }/* w w  w.  j  av a 2  s . c  o  m*/
        return c.iterator().next();
    }
}

Related

  1. firstOrThat(Collection collection, T that)
  2. firstValue(Class type, Collection values)
  3. GET_FIRST_ELEMENT(Collection coll)
  4. getCollectionFirstElement( final Collection collection)
  5. getFirst(Collection c)
  6. getFirst(Collection collection)
  7. getFirst(Collection bag)
  8. getFirst(Collection c)
  9. getFirst(Collection col)