org.argouml.util
Class CollectionUtil
java.lang.Object
org.argouml.util.CollectionUtil
- public final class CollectionUtil
- extends Object
Some helper methods for dealing with collections.
|
Constructor Summary |
private |
CollectionUtil()
Can't construct a utility. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CollectionUtil
private CollectionUtil()
- Can't construct a utility.
getFirstItem
public static Object getFirstItem(Collection c)
- Return the first item from a collection using the most efficient
method possible.
- Parameters:
c - The Collection.
- Returns:
- the first element of a Collection.
- Throws:
NoSuchElementException - if the collection is empty.
getFirstItemOrNull
public static Object getFirstItemOrNull(Collection c)
- Return the first item from a collection using the most efficient
method possible. Returns null for an empty collection.
- Parameters:
c - The Collection.
- Returns:
- the first element of a Collection.