com.sun.appserv.management.util.misc
Class CollectionUtil
java.lang.Object
com.sun.appserv.management.util.misc.CollectionUtil
public final class CollectionUtil
- extends Object
Various helper utilities for Collections.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
toString
public static String toString(Collection c,
String delim)
- Returns:
- a String
toString
public static String toString(Collection c)
getSingleton
public static <T> T getSingleton(Collection<T> s)
addArray
public static <T> void addArray(Collection<T> c,
T[] array)
- Add all items in an array to a set.
toStringArray
public static String[] toStringArray(Collection c)
- Returns:
- String[]
toArray
public static <T> T[] toArray(Collection<? extends T> c,
Class<T> elementClass)
- Parameters:
c
- the CollectionelementClass
- the type of the element, must be non-primitive
- Returns:
- array of [] elements
isAllStrings
public static boolean isAllStrings(Collection<?> c)
- Returns:
- true if all elements are String, and there is at least one element
Submit a bug or feature Copyright 2006 Sun Microsystems, Inc. All rights reserved.