Lines Matching defs:comparator

45  * The ordering imposed by a comparator <tt>c</tt> on a set of elements
51 * Caution should be exercised when using a comparator capable of imposing an
53 * Suppose a sorted set (or sorted map) with an explicit comparator <tt>c</tt>
62 * to an empty {@code TreeSet} with comparator {@code c}.
72 * order for the data structure to serialize successfully, the comparator (if
76 * <i>imposed ordering</i> that a given comparator <tt>c</tt> imposes on a
92 * <p>Unlike {@code Comparable}, a comparator may optionally permit
100 * @param <T> the type of objects that may be compared by this comparator
136 * any comparator that violates this condition should clearly indicate
137 * this fact. The recommended language is "Note: this comparator
146 * comparator does not permit null arguments
148 * being compared by this comparator.
154 * comparator. This method must obey the general contract of
156 * <tt>true</tt> <i>only</i> if the specified object is also a comparator
157 * and it imposes the same ordering as this comparator. Thus,
169 * a comparator and it imposes the same ordering as this
170 * comparator.
177 * Returns a comparator that imposes the reverse ordering of this
178 * comparator.
180 * @return a comparator that imposes the reverse ordering of this
181 * comparator.
189 * Returns a lexicographic-order comparator with another comparator.
193 * <p>The returned comparator is serializable if the specified comparator
198 * and then case-insensitive natural ordering, the comparator can be
206 * @param other the other comparator to be used when this comparator
208 * @return a lexicographic-order comparator composed of this and then the
209 * other comparator
222 * Returns a lexicographic-order comparator with a function that
231 * @return a lexicographic-order comparator composed of this comparator
246 * Returns a lexicographic-order comparator with a function that
255 * @return a lexicographic-order comparator composed of this and then the
269 * Returns a lexicographic-order comparator with a function that
276 * @return a lexicographic-order comparator composed of this and then the
288 * Returns a lexicographic-order comparator with a function that
295 * @return a lexicographic-order comparator composed of this and then the
307 * Returns a lexicographic-order comparator with a function that
314 * @return a lexicographic-order comparator composed of this and then the
326 * Returns a comparator that imposes the reverse of the <em>natural
329 * <p>The returned comparator is serializable and throws {@link
333 * @return a comparator that imposes the reverse of the <i>natural
343 * Returns a comparator that compares {@link Comparable} objects in natural
346 * <p>The returned comparator is serializable and throws {@link
350 * @return a comparator that imposes the <i>natural ordering</i> on {@code
361 * Returns a null-friendly comparator that considers {@code null} to be
364 * to determine the order. If the specified comparator is {@code null},
365 * then the returned comparator considers all non-null values to be equal.
367 * <p>The returned comparator is serializable if the specified comparator
371 * @param comparator a {@code Comparator} for comparing non-null values
372 * @return a comparator that considers {@code null} to be less than
377 public static <T> Comparator<T> nullsFirst(Comparator<? super T> comparator) {
378 return new Comparators.NullComparator<>(true, comparator);
382 * Returns a null-friendly comparator that considers {@code null} to be
385 * to determine the order. If the specified comparator is {@code null},
386 * then the returned comparator considers all non-null values to be equal.
388 * <p>The returned comparator is serializable if the specified comparator
392 * @param comparator a {@code Comparator} for comparing non-null values
393 * @return a comparator that considers {@code null} to be greater than
398 public static <T> Comparator<T> nullsLast(Comparator<? super T> comparator) {
399 return new Comparators.NullComparator<>(false, comparator);
407 * <p>The returned comparator is serializable if the specified function
408 * and comparator are both serializable.
424 * @return a comparator that compares by an extracted key using the
445 * <p>The returned comparator is serializable if the specified function
460 * @return a comparator that compares by an extracted key
477 * <p>The returned comparator is serializable if the specified function
482 * @return a comparator that compares by an extracted key
498 * <p>The returned comparator is serializable if the specified function is
503 * @return a comparator that compares by an extracted key
519 * <p>The returned comparator is serializable if the specified function
524 * @return a comparator that compares by an extracted key