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 all elements from second list also presented in first 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 all elements from second list also presented in first list.
Both lists must be sorted.
And both must implement
RandomAccess
, otherwise this method is inefficient in terms of performance.
Running time - O(|container| + |list|).
Copyright © 2009-2011 SonarSource. All Rights Reserved.