Home
last modified time | relevance | path

Searched refs:comparator (Results 1 – 25 of 162) sorted by relevance

1234567

/external/guava/guava/src/com/google/common/collect/
DImmutableSortedSet.java104 Comparator<? super E> comparator) { in emptySet() argument
105 if (NATURAL_ORDER.equals(comparator)) { in emptySet()
108 return new EmptyImmutableSortedSet<E>(comparator); in emptySet()
316 Comparator<? super E> comparator, Iterator<? extends E> elements) { in copyOf() argument
317 checkNotNull(comparator); in copyOf()
318 return copyOfInternal(comparator, elements); in copyOf()
335 Comparator<? super E> comparator, Iterable<? extends E> elements) { in copyOf() argument
336 checkNotNull(comparator); in copyOf()
337 return copyOfInternal(comparator, elements); in copyOf()
359 Comparator<? super E> comparator, Collection<? extends E> elements) { in copyOf() argument
[all …]
DImmutableSortedMultiset.java233 Comparator<? super E> comparator, Iterator<? extends E> elements) { in copyOf() argument
234 checkNotNull(comparator); in copyOf()
235 return copyOfInternal(comparator, elements); in copyOf()
249 Comparator<? super E> comparator, Iterable<? extends E> elements) { in copyOf() argument
250 checkNotNull(comparator); in copyOf()
251 return copyOfInternal(comparator, elements); in copyOf()
270 Comparator<? super E> comparator = sortedMultiset.comparator(); in copyOfSorted() local
271 if (comparator == null) { in copyOfSorted()
272 comparator = (Comparator<? super E>) NATURAL_ORDER; in copyOfSorted()
274 return copyOfInternal(comparator, sortedMultiset); in copyOfSorted()
[all …]
DSortedIterables.java45 public static boolean hasSameComparator(Comparator<?> comparator, Iterable<?> elements) { in hasSameComparator() argument
46 checkNotNull(comparator); in hasSameComparator()
51 comparator2 = sortedSet.comparator(); in hasSameComparator()
56 comparator2 = ((SortedIterable<?>) elements).comparator(); in hasSameComparator()
60 return comparator.equals(comparator2); in hasSameComparator()
69 Comparator<? super E> comparator, Iterator<E> elements) { in sortedUnique() argument
70 SortedSet<E> sortedSet = Sets.newTreeSet(comparator); in sortedUnique()
81 Comparator<? super E> comparator, Iterable<E> elements) { in sortedUnique() argument
86 if (hasSameComparator(comparator, elements)) { in sortedUnique()
90 Collections.sort(list, comparator); in sortedUnique()
[all …]
DGeneralRange.java59 static <T> GeneralRange<T> all(Comparator<? super T> comparator) { in all() argument
60 return new GeneralRange<T>(comparator, false, null, OPEN, false, null, OPEN); in all()
67 static <T> GeneralRange<T> downTo(Comparator<? super T> comparator, @Nullable T endpoint, in downTo() argument
69 return new GeneralRange<T>(comparator, true, endpoint, boundType, false, null, OPEN); in downTo()
76 static <T> GeneralRange<T> upTo(Comparator<? super T> comparator, @Nullable T endpoint, in upTo() argument
78 return new GeneralRange<T>(comparator, false, null, OPEN, true, endpoint, boundType); in upTo()
85 static <T> GeneralRange<T> range(Comparator<? super T> comparator, @Nullable T lower, in range() argument
87 return new GeneralRange<T>(comparator, true, lower, lowerType, true, upper, upperType); in range()
90 private final Comparator<? super T> comparator; field in GeneralRange
100 private GeneralRange(Comparator<? super T> comparator, boolean hasLowerBound, in GeneralRange() argument
[all …]
DComparatorOrdering.java33 final Comparator<T> comparator; field in ComparatorOrdering
35 ComparatorOrdering(Comparator<T> comparator) { in ComparatorOrdering() argument
36 this.comparator = checkNotNull(comparator); in ComparatorOrdering()
40 return comparator.compare(a, b); in compare()
45 return Collections.binarySearch(sortedList, key, comparator); in binarySearch()
51 Collections.sort(list, comparator); in sortedCopy()
61 return this.comparator.equals(that.comparator); in equals()
67 return comparator.hashCode(); in hashCode()
71 return comparator.toString(); in toString()
DImmutableSortedMap.java91 Comparator<? super K> comparator) { in emptyMap() argument
92 if (NATURAL_ORDER.equals(comparator)) { in emptyMap()
96 ImmutableList.<Entry<K, V>>of(), comparator); in emptyMap()
200 Map<? extends K, ? extends V> map, Comparator<? super K> comparator) { in copyOf() argument
201 return copyOfInternal(map, checkNotNull(comparator)); in copyOf()
217 Comparator<? super K> comparator = map.comparator(); in copyOfSorted() local
218 if (comparator == null) { in copyOfSorted()
221 comparator = (Comparator<? super K>) NATURAL_ORDER; in copyOfSorted()
223 return copyOfInternal(map, comparator); in copyOfSorted()
227 Map<? extends K, ? extends V> map, Comparator<? super K> comparator) { in copyOfInternal() argument
[all …]
DSortedLists.java56 Comparator<? super E> comparator, E key, List<? extends E> list, int foundIndex) { in resultIndex() argument
66 Comparator<? super E> comparator, E key, List<? extends E> list, int foundIndex) { in resultIndex() argument
74 int c = comparator.compare(list.get(middle), key); in resultIndex()
90 Comparator<? super E> comparator, E key, List<? extends E> list, int foundIndex) { in resultIndex() argument
99 int c = comparator.compare(list.get(middle), key); in resultIndex()
116 Comparator<? super E> comparator, E key, List<? extends E> list, int foundIndex) { in resultIndex() argument
117 return LAST_PRESENT.resultIndex(comparator, key, list, foundIndex) + 1; in resultIndex()
127 Comparator<? super E> comparator, E key, List<? extends E> list, int foundIndex) { in resultIndex() argument
128 return FIRST_PRESENT.resultIndex(comparator, key, list, foundIndex) - 1; in resultIndex()
132 Comparator<? super E> comparator, E key, List<? extends E> list, int foundIndex); in resultIndex() argument
[all …]
DRegularImmutableSortedSet.java52 ImmutableList<E> elements, Comparator<? super E> comparator) { in RegularImmutableSortedSet() argument
53 super(comparator); in RegularImmutableSortedSet()
87 if (!SortedIterables.hasSameComparator(comparator(), targets) in containsAll()
137 Comparator<Object> unsafeComparator = (Comparator<Object>) comparator; in binarySearch()
167 if (SortedIterables.hasSameComparator(comparator, that)) { in equals()
204 elements, checkNotNull(toElement), comparator(), FIRST_AFTER, NEXT_HIGHER); in headSetImpl()
207 elements, checkNotNull(toElement), comparator(), FIRST_PRESENT, NEXT_HIGHER); in headSetImpl()
224 elements, checkNotNull(fromElement), comparator(), FIRST_PRESENT, NEXT_HIGHER); in tailSetImpl()
227 elements, checkNotNull(fromElement), comparator(), FIRST_AFTER, NEXT_HIGHER); in tailSetImpl()
237 return (Comparator<Object>) comparator; in unsafeComparator()
[all …]
DRegularImmutableSortedMultiset.java58 static <E> RegularImmutableSortedMultiset<E> createFromSorted(Comparator<? super E> comparator, in createFromSorted() argument
66 return new RegularImmutableSortedMultiset<E>(comparator, ImmutableList.copyOf(newEntries)); in createFromSorted()
72 Comparator<? super E> comparator, ImmutableList<CumulativeCountEntry<E>> entries) { in RegularImmutableSortedMultiset() argument
73 super(comparator); in RegularImmutableSortedMultiset()
89 return new RegularImmutableSortedSet<E>(elementList(), comparator());
145 elementList(), (E) element, comparator(), ANY_PRESENT, INVERTED_INSERTION_INDEX);
158 elementList(), checkNotNull(upperBound), comparator(), ANY_PRESENT, NEXT_HIGHER);
162 elementList(), checkNotNull(upperBound), comparator(), ANY_PRESENT, NEXT_LOWER) + 1;
176 elementList(), checkNotNull(lowerBound), comparator(), ANY_PRESENT, NEXT_LOWER) + 1;
180 elementList(), checkNotNull(lowerBound), comparator(), ANY_PRESENT, NEXT_HIGHER);
[all …]
DForwardingSortedSet.java66 public Comparator<? super E> comparator() { in comparator() method in ForwardingSortedSet
67 return delegate().comparator(); in comparator()
98 Comparator<? super E> comparator = comparator(); in unsafeCompare() local
99 return (comparator == null) in unsafeCompare()
101 : ((Comparator<Object>) comparator).compare(o1, o2); in unsafeCompare()
DTreeMultiset.java93 @Nullable Comparator<? super E> comparator) { in create()
94 return (comparator == null) in create()
96 : new TreeMultiset<E>(comparator); in create()
126 private TreeMultiset(Comparator<? super E> comparator) { in TreeMultiset() argument
127 super(comparator); in TreeMultiset()
128 this.range = GeneralRange.all(comparator); in TreeMultiset()
133 super(range.comparator()); in TreeMultiset()
182 Node<E> node = BstOperations.seek(comparator(), rootReference.get(), e); in count()
200 BstOperations.mutate(comparator(), mutationRule, rootReference.get(), e); in mutate()
350 range.intersect(GeneralRange.upTo(comparator, upperBound, boundType)), rootReference); in headMultiset()
[all …]
DTreeBasedTable.java80 final Comparator<? super C> comparator; field in TreeBasedTable.Factory
81 Factory(Comparator<? super C> comparator) { in Factory() argument
82 this.comparator = comparator; in Factory()
86 return new TreeMap<C, V>(comparator); in get()
148 return rowKeySet().comparator(); in rowComparator()
192 @Override public Comparator<? super C> comparator() { in comparator() method in TreeBasedTable.TreeRow
199 Comparator<Object> cmp = (Comparator) comparator(); in compare()
341 final Comparator<? super C> comparator = columnComparator(); in createColumnKeyIterator() local
350 }), comparator); in createColumnKeyIterator()
360 lastValue != null && comparator.compare(next, lastValue) == 0; in createColumnKeyIterator()
DForwardingSortedMap.java65 public Comparator<? super K> comparator() { in comparator() method in ForwardingSortedMap
66 return delegate().comparator(); in comparator()
97 Comparator<? super K> comparator = comparator(); in unsafeCompare() local
98 if (comparator == null) { in unsafeCompare()
101 return ((Comparator<Object>) comparator).compare(k1, k2); in unsafeCompare()
/external/guava/guava-gwt/src-super/com/google/common/collect/super/com/google/common/collect/
DImmutableSortedSet.java63 Comparator<? super E> comparator) { in emptySet() argument
64 checkNotNull(comparator); in emptySet()
65 if (NATURAL_ORDER.equals(comparator)) { in emptySet()
68 return new EmptyImmutableSortedSet<E>(comparator); in emptySet()
124 Comparator<? super E> comparator, E... elements) { in ofInternal() argument
128 return emptySet(comparator); in ofInternal()
130 SortedSet<E> delegate = new TreeSet<E>(comparator); in ofInternal()
160 Comparator<? super E> comparator, Iterable<? extends E> elements) { in copyOf() argument
161 checkNotNull(comparator); in copyOf()
162 return copyOfInternal(comparator, elements, false); in copyOf()
[all …]
DImmutableSortedMap.java63 private transient final Comparator<K> comparator; field in ImmutableSortedMap
70 this.comparator = (delegate.comparator() == null) in ImmutableSortedMap()
71 ? NATURAL_ORDER : delegate.comparator(); in ImmutableSortedMap()
76 Comparator<? super K> comparator, in create() argument
78 checkNotNull(comparator); in create()
79 SortedMap<K, V> delegate = Maps.newTreeMap(comparator); in create()
127 Map<? extends K, ? extends V> map, Comparator<? super K> comparator) { in copyOf() argument
128 return copyOfInternal(map, checkNotNull(comparator)); in copyOf()
136 Comparator<? super K> comparator = in copyOfSorted() local
137 (map.comparator() == null) ? NATURAL_ORDER : map.comparator(); in copyOfSorted()
[all …]
/external/replicaisland/src/com/replica/replicaisland/
DQuickSorter.java22 public void sort(Type[] array, int count, Comparator<Type> comparator) { in sort() argument
23 quicksort(array, 0, count - 1, comparator); in sort()
45 public void quicksort(Type[] a, int left, int right, Comparator<Type> comparator) { in quicksort() argument
47 int i = partition(a, left, right, comparator); in quicksort()
48 quicksort(a, left, i - 1, comparator); in quicksort()
49 quicksort(a, i + 1, right, comparator); in quicksort()
53 private int partition(Type[] a, int left, int right, Comparator<Type> comparator) { in partition() argument
57 while (comparator.compare(a[++i], a[right]) < 0) { // find item on left to swap in partition()
59 while (comparator.compare(a[right], a[--j]) < 0) { // find item on right to swap in partition()
DShellSorter.java30 public void sort(Type[] array, int count, Comparator<Type> comparator) { in sort() argument
36 insertionSort(array, count, start, increment, comparator); in sort()
44 insertionSort(array, count, 0, 1, comparator ); in sort()
59 Comparator<Type> comparator) { in insertionSort() argument
67 int delta = comparator.compare(array[j], array[k]); in insertionSort()
77 } while ( j != start && comparator.compare(array[k], temp) > 0 ); in insertionSort()
DFixedSizeArray.java51 public FixedSizeArray(int size, Comparator<T> comparator) { in FixedSizeArray() argument
56 mComparator = comparator; in FixedSizeArray()
198 final Comparator comparator = mComparator;
201 if (comparator != null) {
202 index = Arrays.binarySearch(contents, object, comparator);
214 if (comparator != null && !ignoreComparator) {
216 final int result = comparator.compare(contents[x], object);
269 public void setComparator(Comparator<T> comparator) {
270 mComparator = comparator;
/external/easymock/src/org/easymock/internal/matchers/
DCompare.java30 private Comparator<? super T> comparator; field in Compare
34 public Compare(T expected, Comparator<? super T> comparator, LogicalOperator result) { in Compare() argument
36 this.comparator = comparator; in Compare()
41 buffer.append(comparator + "(" + expected + ") " + operator.getSymbol() in appendTo()
50 return operator.matchResult(comparator.compare((T) actual, expected)); in matches()
/external/jmonkeyengine/engine/src/core/com/jme3/renderer/queue/
DGeometryList.java54 private GeometryComparator comparator; field in GeometryList
62 public GeometryList(GeometryComparator comparator) { in GeometryList() argument
66 this.comparator = comparator; in GeometryList()
76 this.comparator.setCamera(cam); in setCamera()
138 SortUtil.msort(geometries2, geometries, 0, size-1, comparator); in sort()
/external/webkit/Source/WebCore/inspector/front-end/
DCookiesTable.js165 var comparator;
167 case 0: comparator = localeCompare.bind(this, "name"); break;
168 case 1: comparator = localeCompare.bind(this, "value"); break;
169 case 2: comparator = localeCompare.bind(this, "domain"); break;
170 case 3: comparator = localeCompare.bind(this, "path"); break;
171 case 4: comparator = expiresCompare; break;
172 case 5: comparator = numberCompare.bind(this, "size"); break;
173 case 6: comparator = localeCompare.bind(this, "httpOnly"); break;
174 case 7: comparator = localeCompare.bind(this, "secure"); break;
178 cookies.sort(comparator);
DProfileDataGridTree.js121 sort: function(/*Function*/ comparator, /*Boolean*/ force) argument
134 if (!force && (!gridNode.expanded || gridNode.lastComparator === comparator)) {
140 gridNode.lastComparator = comparator;
146 children.sort(comparator);
368 var comparator = this.propertyComparators[(isAscending ? 1 : 0)][property];
370 if (!comparator) {
372 comparator = function(lhs, rhs) function
383 comparator = function(lhs, rhs)
395 this.propertyComparators[(isAscending ? 1 : 0)][property] = comparator;
398 return comparator;
/external/emma/core/java12/com/vladium/emma/report/
DItemComparator.java45 …final Comparator comparator = IItemAttribute.Factory.getAttribute (attributeID, unitsID).comparato… in create() local
46 …ators [a >> 1] = attributeIDsWithDir [a + 1] < 0 ? new ReverseComparator (comparator) : comparator; in create()
70 ReverseComparator (final Comparator comparator)
72 m_comparator = comparator;
/external/guava/guava-testlib/src/com/google/common/collect/testing/
DSafeTreeSet.java51 public SafeTreeSet(Comparator<? super E> comparator) { in SafeTreeSet() argument
52 this(new TreeSet<E>(comparator)); in SafeTreeSet()
86 @Override public Comparator<? super E> comparator() { in comparator() method in SafeTreeSet
87 Comparator<? super E> comparator = delegate.comparator(); in comparator() local
88 if (comparator == null) { in comparator()
89 comparator = NATURAL_ORDER; in comparator()
91 return comparator; in comparator()
202 comparator().compare(e, e); in checkValid()
/external/guava/guava-tests/test/com/google/common/collect/
DImmutableSortedMapTest.java543 assertSame(Ordering.natural(), copy.comparator()); in testCopyOfEmptyMap()
551 assertSame(Ordering.natural(), copy.comparator()); in testCopyOfSingletonMap()
564 assertSame(Ordering.natural(), copy.comparator()); in testCopyOf()
568 Comparator<String> comparator = Ordering.natural().reverse(); in testCopyOfExplicitComparator() local
575 = ImmutableSortedMap.copyOf(original, comparator); in testCopyOfExplicitComparator()
577 assertSame(copy, ImmutableSortedMap.copyOf(copy, comparator)); in testCopyOfExplicitComparator()
578 assertSame(comparator, copy.comparator()); in testCopyOfExplicitComparator()
582 Comparator<String> comparator = Ordering.natural().reverse(); in testCopyOfImmutableSortedSetDifferentComparator() local
586 = ImmutableSortedMap.copyOf(original, comparator); in testCopyOfImmutableSortedSetDifferentComparator()
588 assertSame(copy, ImmutableSortedMap.copyOf(copy, comparator)); in testCopyOfImmutableSortedSetDifferentComparator()
[all …]

1234567