Lines Matching defs:comparator

43    * to {@code comparator}.
45 public static boolean hasSameComparator(Comparator<?> comparator, Iterable<?> elements) {
46 checkNotNull(comparator);
51 comparator2 = sortedSet.comparator();
56 comparator2 = ((SortedIterable<?>) elements).comparator();
60 return comparator.equals(comparator2);
64 * Returns a sorted collection of the unique elements according to the specified comparator. Does
69 Comparator<? super E> comparator, Iterator<E> elements) {
70 SortedSet<E> sortedSet = Sets.newTreeSet(comparator);
76 * Returns a sorted collection of the unique elements according to the specified comparator. Does
81 Comparator<? super E> comparator, Iterable<E> elements) {
86 if (hasSameComparator(comparator, elements)) {
90 Collections.sort(list, comparator);
94 if (!hasSameComparator(comparator, elements)) {
95 Arrays.sort(array, comparator);
97 return uniquifySortedArray(comparator, array);
101 Comparator<? super E> comparator, E[] array) {
107 int cmp = comparator.compare(array[i], array[length - 1]);
123 Comparator<? super E> comparator, Iterator<E> elements) {
124 TreeMultiset<E> multiset = TreeMultiset.create(comparator);
134 Comparator<? super E> comparator, Iterable<E> elements) {
137 if (hasSameComparator(comparator, elements)) {
142 entries, Ordering.from(comparator).onResultOf(new Function<Multiset.Entry<E>, E>() {
151 if (hasSameComparator(comparator, elements)) {
155 Collections.sort(list, comparator);
159 } else if (hasSameComparator(comparator, elements)) {
165 if (comparator.compare(current, e) == 0) {
182 TreeMultiset<E> multiset = TreeMultiset.create(comparator);