| java.lang.Object | |
| ↳ | com.pnfsoftware.jeb.util.collect.CollectionUtil |
Convenience methods for Java Collection collections, in particular, List lists.
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| CollectionUtil() | |||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| static <T, K extends Comparable<K>> T |
binarySearch(List<T> list, K key, IExtractor<T, K> extractor)
Perform a binary search in an ordered list.
| ||||||||||
| static <T, K extends Comparable<K>> int |
binarySearchEx(List<T> list, K key, IExtractor<T, K> extractor, Comparator<K> cc)
Perform a binary search in an ordered list.
| ||||||||||
| static <T> boolean | compare(Collection<? extends T> c1, Collection<? extends T> c2, boolean sorted) | ||||||||||
| static <T> boolean | compareByReference(Collection<? extends T> c1, Collection<? extends T> c2, boolean sorted) | ||||||||||
| static boolean |
contains(Collection<?> c, Object v)
Safely check if an object is present within a collection.
| ||||||||||
| static boolean |
containsNonNull(Iterable<?> c)
Determine if the given iterable contains one or more non-null elements.
| ||||||||||
| static boolean |
containsNull(Iterable<?> c)
Determine if the given iterable contains one or more null elements.
| ||||||||||
| static <T> boolean |
containsReference(Collection<T> c, T o)
Determine if the collection contains the object reference (differs from
contains(Object) by checking reference equality == instead
of equals(Object) equality) | ||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
Perform a binary search in an ordered list.
| list | a list of ordered items |
|---|---|
| key | the ordering key for the items. |
| extractor | key extractor |
Perform a binary search in an ordered list.
| list | a list of ordered items |
|---|---|
| key | the ordering key for the items. |
| extractor | key extractor |
Safely check if an object is present within a collection.
| c | collection, potentially null |
|---|---|
| v | object, potentially null |
Determine if the given iterable contains one or more non-null elements.
Determine if the given iterable contains one or more null elements.
Determine if the collection contains the object reference (differs from
contains(Object) by checking reference equality == instead
of equals(Object) equality)
| c | collection to loop into |
|---|---|
| o | element whose presence in this collection is to be tested |