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 <X> Collection<X> createCollection(X o)
createList
public static <X> List<X> createList(X o)
createSmallMap
public static <X,Y> Map<X,Y> createSmallMap()
equalsSet
public static boolean equalsSet(Collection c1,
Collection c2)
equalsList
public static boolean equalsList(Collection<?> c1,
Collection<?> c2)
getFirstItem
public static <X> X getFirstItem(Collection<X> c)
- Returns the first item in the collection or null if the collection is empty
getSoleItem
public static <X> X getSoleItem(Collection<X> 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 <X> Collection<X> removeFirst(Collection<X> c)
toString
public static String toString(Collection collection)
apply
public static <X,Y> void apply(Collection<? extends X> c,
UnaryFunction<X,Y> function)
Submit a bug report or feature request
Protégé is a trademark of Stanford University.
Copyright (c) 1998-2011 Stanford University.