public final class SortedListsUtils extends Object
Modifier and Type | Method and Description |
---|---|
static <T> boolean |
contains(List<T> container,
List<T> list,
Comparator<T> comparator)
Returns true if
container contains all elements from list . |
public static <T> boolean contains(List<T> container, List<T> list, Comparator<T> comparator)
container
contains all elements from list
.
Both lists must be sorted in consistency with comparator
,
that is for any two sequential elements x and y:
(comparator.compare(x, y) <= 0) && (comparator.compare(y, x) >= 0)
.
Running time - O(|container| + |list|).Copyright © 2009-2012 SonarSource. All Rights Reserved.