com.mchange.v2.util
Class CollectionUtils

java.lang.Object
  extended by com.mchange.v2.util.CollectionUtils

public final class CollectionUtils
extends Object


Field Summary
static SortedSet EMPTY_SORTED_SET
           
 
Method Summary
static void add(Collection c, Object o)
           
static Collection attemptClone(Collection c)
          Attempts to find a public clone() method or a copy constructor, in that order, and calls what it finds.
static Map attemptClone(Map m)
          Attempts to find a public clone() method or a copy constructor, in that order, and calls what it finds.
static boolean isCollectionsWrapper(Class cl)
           
static boolean isCollectionsWrapper(Collection c)
           
static boolean isCollectionsWrapper(Map m)
           
static boolean isSynchronizedWrapper(Class cl)
           
static boolean isSynchronizedWrapper(Collection c)
           
static boolean isSynchronizedWrapper(Map m)
           
static boolean isUnmodifiableWrapper(Class cl)
           
static boolean isUnmodifiableWrapper(Collection c)
           
static boolean isUnmodifiableWrapper(Map m)
           
static Collection narrowSynchronizedCollection(Collection c)
           
static Map narrowSynchronizedMap(Map m)
           
static Collection narrowUnmodifiableCollection(Collection c)
           
static Map narrowUnmodifiableMap(Map m)
           
static void remove(Collection c, Object o)
           
static int size(Object o)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EMPTY_SORTED_SET

public static final SortedSet EMPTY_SORTED_SET
Method Detail

isCollectionsWrapper

public static boolean isCollectionsWrapper(Class cl)

isCollectionsWrapper

public static boolean isCollectionsWrapper(Collection c)

isCollectionsWrapper

public static boolean isCollectionsWrapper(Map m)

isSynchronizedWrapper

public static boolean isSynchronizedWrapper(Class cl)

isSynchronizedWrapper

public static boolean isSynchronizedWrapper(Collection c)

isSynchronizedWrapper

public static boolean isSynchronizedWrapper(Map m)

isUnmodifiableWrapper

public static boolean isUnmodifiableWrapper(Class cl)

isUnmodifiableWrapper

public static boolean isUnmodifiableWrapper(Collection c)

isUnmodifiableWrapper

public static boolean isUnmodifiableWrapper(Map m)

narrowUnmodifiableCollection

public static Collection narrowUnmodifiableCollection(Collection c)

narrowSynchronizedCollection

public static Collection narrowSynchronizedCollection(Collection c)

narrowUnmodifiableMap

public static Map narrowUnmodifiableMap(Map m)

narrowSynchronizedMap

public static Map narrowSynchronizedMap(Map m)

attemptClone

public static Collection attemptClone(Collection c)
                               throws NoSuchMethodException
Attempts to find a public clone() method or a copy constructor, in that order, and calls what it finds. If neither is available, throws a NoSuchMethodException.

Throws:
NoSuchMethodException

attemptClone

public static Map attemptClone(Map m)
                        throws NoSuchMethodException
Attempts to find a public clone() method or a copy constructor, in that order, and calls what it finds. If neither is available, throws a NoSuchMethodException.

Throws:
NoSuchMethodException

add

public static void add(Collection c,
                       Object o)

remove

public static void remove(Collection c,
                          Object o)

size

public static int size(Object o)