Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 126 for comparators (0.06 sec)

  1. guava/src/com/google/common/collect/Ordering.java

       * there is no need to use this method.
       *
       * @param comparator the comparator that defines the order
       * @return comparator itself if it is already an {@code Ordering}; otherwise an ordering that
       *     wraps that comparator
       */
      @GwtCompatible(serializable = true)
      public static <T extends @Nullable Object> Ordering<T> from(Comparator<T> comparator) {
        return (comparator instanceof Ordering)
            ? (Ordering<T>) comparator
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 30 16:15:19 UTC 2024
    - 39.4K bytes
    - Viewed (0)
  2. android/guava-tests/test/com/google/common/collect/ComparatorsTest.java

    import static com.google.common.collect.Comparators.emptiesFirst;
    import static com.google.common.collect.Comparators.emptiesLast;
    import static com.google.common.collect.Comparators.isInOrder;
    import static com.google.common.collect.Comparators.isInStrictOrder;
    import static com.google.common.collect.Comparators.max;
    import static com.google.common.collect.Comparators.min;
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 30 16:15:19 UTC 2024
    - 6.4K bytes
    - Viewed (0)
  3. android/guava/src/com/google/common/collect/Ordering.java

       * there is no need to use this method.
       *
       * @param comparator the comparator that defines the order
       * @return comparator itself if it is already an {@code Ordering}; otherwise an ordering that
       *     wraps that comparator
       */
      @GwtCompatible(serializable = true)
      public static <T extends @Nullable Object> Ordering<T> from(Comparator<T> comparator) {
        return (comparator instanceof Ordering)
            ? (Ordering<T>) comparator
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 30 16:15:19 UTC 2024
    - 39.4K bytes
    - Viewed (0)
  4. guava/src/com/google/common/collect/TreeBasedTable.java

      private final Comparator<? super C> columnComparator;
    
      private static class Factory<C, V> implements Supplier<Map<C, V>>, Serializable {
        final Comparator<? super C> comparator;
    
        Factory(Comparator<? super C> comparator) {
          this.comparator = comparator;
        }
    
        @Override
        public Map<C, V> get() {
          return new TreeMap<>(comparator);
        }
    
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 30 16:15:19 UTC 2024
    - 11.5K bytes
    - Viewed (0)
  5. guava-tests/test/com/google/common/collect/TreeMultimapExplicitTest.java

      private static final Comparator<@Nullable Integer> DECREASING_INT_COMPARATOR =
          Ordering.<Integer>natural().reverse().<Integer>nullsFirst();
    
      private SetMultimap<String, Integer> create() {
        return TreeMultimap.create(StringLength.COMPARATOR, DECREASING_INT_COMPARATOR);
      }
    
      /** Create and populate a {@code TreeMultimap} with explicit comparators. */
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Sat Oct 19 00:05:46 UTC 2024
    - 8.4K bytes
    - Viewed (0)
  6. guava-tests/test/com/google/common/collect/TreeMultimapNaturalTest.java

        assertEquals(multimap, copy);
      }
    
      private static final Comparator<Double> KEY_COMPARATOR = Ordering.natural();
    
      private static final Comparator<Double> VALUE_COMPARATOR =
          Ordering.<Double>natural().reverse().nullsFirst();
    
      /**
       * Test that creating one TreeMultimap from another does not copy the comparators from the source
       * TreeMultimap.
       */
      public void testCreateFromTreeMultimap() {
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 30 16:15:19 UTC 2024
    - 22.3K bytes
    - Viewed (0)
  7. android/guava/src/com/google/common/collect/ImmutableTable.java

       * @since 11.0
       */
      @DoNotMock
      public static final class Builder<R, C, V> {
        private final List<Cell<R, C, V>> cells = Lists.newArrayList();
        @CheckForNull private Comparator<? super R> rowComparator;
        @CheckForNull private Comparator<? super C> columnComparator;
    
        /**
         * Creates a new builder. The returned builder is equivalent to the builder generated by {@link
         * ImmutableTable#builder}.
         */
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 30 16:15:19 UTC 2024
    - 17.5K bytes
    - Viewed (0)
  8. android/guava/src/com/google/common/primitives/Booleans.java

          return toString;
        }
      }
    
      /**
       * Returns a {@code Comparator<Boolean>} that sorts {@code true} before {@code false}.
       *
       * <p>This is particularly useful in Java 8+ in combination with {@code Comparator.comparing},
       * e.g. {@code Comparator.comparing(Foo::hasBar, trueFirst())}.
       *
       * @since 21.0
       */
      public static Comparator<Boolean> trueFirst() {
        return BooleanComparator.TRUE_FIRST;
      }
    
      /**
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Oct 18 19:07:49 UTC 2024
    - 20.4K bytes
    - Viewed (0)
  9. guava/src/com/google/common/primitives/Booleans.java

          return toString;
        }
      }
    
      /**
       * Returns a {@code Comparator<Boolean>} that sorts {@code true} before {@code false}.
       *
       * <p>This is particularly useful in Java 8+ in combination with {@code Comparator.comparing},
       * e.g. {@code Comparator.comparing(Foo::hasBar, trueFirst())}.
       *
       * @since 21.0
       */
      public static Comparator<Boolean> trueFirst() {
        return BooleanComparator.TRUE_FIRST;
      }
    
      /**
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Oct 18 19:07:49 UTC 2024
    - 20.4K bytes
    - Viewed (0)
  10. guava-tests/test/com/google/common/collect/ImmutableSortedSetTest.java

        Comparator<Comparable<?>> comparator = Ordering.natural().reverse();
        SortedSet<String> set =
            new ImmutableSortedSet.Builder<String>(comparator).add("a", "b", "c").build();
        SortedSet<String> copy = SerializableTester.reserializeAndAssert(set);
        assertTrue(elementsEqual(set, copy));
        assertEquals(set.comparator(), copy.comparator());
      }
    
      public void testReverseOrder() {
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 30 16:15:19 UTC 2024
    - 46.7K bytes
    - Viewed (0)
Back to top