|
![]() |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.ontopia.utils.CollectionUtils
public class CollectionUtils
INTERNAL: Class that contains useful collection methods.
Method Summary | |
---|---|
static void |
addAll(java.util.Collection c,
java.lang.Object[] a)
INTERNAL: Adds all elements in the array to the collection. |
static java.util.List |
castList(java.util.Collection c)
INTERNAL: Cast collection as list or make a new list. |
static java.util.Map |
createConcurrentMap()
INTERNAL: Creates new concurrent java.util.Map instance. |
static java.util.Set |
createConcurrentSet()
INTERNAL: Creates new concurrent java.util.Set instance. |
static boolean |
equalsUnorderedSet(java.util.Collection coll1,
java.util.Collection coll2)
INTERNAL: Compares two collections to see if they contain the same elements. |
static java.util.Set |
filterSet(java.util.Collection coll,
DeciderIF decider)
INTERNAL: Creates new Set that contains the elements from the input collection that the decider deems ok. |
static java.lang.Object |
getFirst(java.util.Collection coll)
INTERNAL: Gets the first object in the collection. |
static java.lang.Object |
getFirstElement(java.util.Collection coll)
INTERNAL: Gets the first object in the collection. |
static java.lang.Object |
getRandom(java.util.Collection coll)
INTERNAL: Gets a random object from the collection. |
static java.util.Collection |
getSingletonCollectionOrEmptyIfNull(java.lang.Object o)
|
static java.util.List |
nextBatch(java.util.Iterator iter,
int length)
EXPERIMENTAL: Iterates over up to length number of elements in the iterator and returns those elements as a Collection. |
static int |
nextBatch(java.util.Iterator iter,
int length,
java.util.Collection batch)
EXPERIMENTAL: Iterates over up to length number of elements in the iterator and adds those elements to the given collection. |
static int |
nextBatch(java.util.Iterator iter,
java.lang.Object[] values)
EXPERIMENTAL: Iterates over up to values.length number of elements in the iterator and inserts those elements in the values> array. |
static int |
nextBatch(java.util.Iterator iter,
java.lang.Object[] values,
int offset,
int length)
EXPERIMENTAL: Iterates over up to length number of elements in the iterator and inserts those elements in the values> array. |
static boolean |
overlaps(java.util.Collection c1,
java.util.Collection c2)
INTERNAL: Returns true if the two collections overlap with one or more elements. |
static java.util.List |
removeDuplicates(java.util.List list)
INTERNAL: Removes all except the first occurrence of each element in the list. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static java.lang.Object getFirst(java.util.Collection coll)
public static java.lang.Object getFirstElement(java.util.Collection coll) throws java.util.NoSuchElementException
java.util.NoSuchElementException
public static java.util.Collection getSingletonCollectionOrEmptyIfNull(java.lang.Object o)
public static java.lang.Object getRandom(java.util.Collection coll)
public static boolean equalsUnorderedSet(java.util.Collection coll1, java.util.Collection coll2)
public static java.util.List nextBatch(java.util.Iterator iter, int length)
public static int nextBatch(java.util.Iterator iter, int length, java.util.Collection batch)
public static int nextBatch(java.util.Iterator iter, java.lang.Object[] values)
public static int nextBatch(java.util.Iterator iter, java.lang.Object[] values, int offset, int length)
public static java.util.List castList(java.util.Collection c)
public static void addAll(java.util.Collection c, java.lang.Object[] a)
public static boolean overlaps(java.util.Collection c1, java.util.Collection c2)
public static java.util.Map createConcurrentMap()
public static java.util.Set createConcurrentSet()
public static java.util.Set filterSet(java.util.Collection coll, DeciderIF decider)
public static java.util.List removeDuplicates(java.util.List list)
|
![]() |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |