org.sonar.duplications.utils
Class SortedListsUtils
java.lang.Object
org.sonar.duplications.utils.SortedListsUtils
public final class SortedListsUtils
- extends Object
Provides utility methods for sorted lists.
Method Summary |
static
|
contains(List<T> container,
List<T> list,
Comparator<T> comparator)
Returns true if container contains all elements from list . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
contains
public static <T> boolean contains(List<T> container,
List<T> list,
Comparator<T> comparator)
- Returns true if
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.