Package net.ontopia.utils
Class CollectionUtils
java.lang.Object
net.ontopia.utils.CollectionUtils
INTERNAL: Class that contains useful collection methods.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> booleanequalsUnorderedSet(Collection<T> coll1, Collection<T> coll2) INTERNAL: Compares two collections to see if they contain the same elements.static <T> TgetFirst(Collection<T> coll) INTERNAL: Gets the first object in the collection.static <T> TgetFirstElement(Collection<T> coll) INTERNAL: Gets the first object in the collection.static <T> TgetRandom(Collection<T> coll) INTERNAL: Gets a random object from the collection.static <T> List<T>EXPERIMENTAL: Iterates over up to length number of elements in the iterator and returns those elements as a Collection.
-
Method Details
-
getFirst
INTERNAL: Gets the first object in the collection. If the collection is empty, null is returned. -
getFirstElement
INTERNAL: Gets the first object in the collection. If the collection does not contain any elements NoSuchElementException is thrown.- Since:
- 1.3.4
-
getRandom
INTERNAL: Gets a random object from the collection. If the collection is empty, null is returned. -
equalsUnorderedSet
INTERNAL: Compares two collections to see if they contain the same elements.- Since:
- 1.4.1
-
nextBatch
EXPERIMENTAL: Iterates over up to length number of elements in the iterator and returns those elements as a Collection. If the iterator is exhausted only the iterated elements are returned.
-