edu.stanford.smi.protege.util
Class CollectionUtilities
java.lang.Object
edu.stanford.smi.protege.util.CollectionUtilities
public class CollectionUtilities
- extends Object
Description of the class
- Author:
- Ray Fergerson
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
EMPTY_ARRAY_LIST
public static final ArrayList EMPTY_ARRAY_LIST
CollectionUtilities
public CollectionUtilities()
containSameItems
public static boolean containSameItems(Collection c1,
Collection c2)
containsAny
public static boolean containsAny(Collection c1,
Collection c2)
- Returns true if there is any element that is common to both collections.
createCollection
public static Collection createCollection(Object o)
createList
public static List createList(Object o)
createSmallMap
public static Map createSmallMap()
equalsSet
public static boolean equalsSet(Collection c1,
Collection c2)
equalsList
public static boolean equalsList(Collection c1,
Collection c2)
getFirstItem
public static Object getFirstItem(Collection c)
- Returns the first item in the collection or null if the collection is empty
getSoleItem
public static Object getSoleItem(Collection c)
- Returns the first item in the collection. Throws an AssertionFailureError
if there is not exactly 1 item in the collection. Use getFirstItem() to
get the first item of a collection if it is possible that there is either
0 items or more than 1 item in the collection.
removeFirst
public static Collection removeFirst(Collection c)
toString
public static String toString(Collection collection)
apply
public static void apply(Collection c,
UnaryFunction function)
Submit a bug report or feature request
Protégé is a trademark of Stanford University.
Copyright (c) 1998-2007 Stanford University.