Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 99 for comparator (0.08 sec)

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

      public static <K, V> ImmutableSortedMap<K, V> copyOfSorted(SortedMap<K, ? extends V> map) {
        Comparator<? super K> comparator = map.comparator();
        if (comparator == null) {
          // If map has a null comparator, the keys should have a natural ordering,
          // even though K doesn't explicitly implement Comparable.
          comparator = (Comparator<? super K>) NATURAL_ORDER;
        }
        if (map instanceof ImmutableSortedMap) {
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 30 16:15:19 UTC 2024
    - 50.4K bytes
    - Viewed (0)
  2. android/guava-testlib/src/com/google/common/collect/testing/google/SetGenerators.java

        @Override
        protected List<String> create(String[] elements) {
          Comparator<String> comparator = createExplicitComparator(elements);
          ImmutableSet<String> set = ImmutableSortedSet.copyOf(comparator, asList(elements));
          return set.asList();
        }
      }
    
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 30 16:15:19 UTC 2024
    - 15.6K bytes
    - Viewed (0)
  3. 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. android/guava-testlib/src/com/google/common/collect/testing/testers/SortedMapNavigationTester.java

      public void testOrderedByComparator() {
        Comparator<? super K> comparator = navigableMap.comparator();
        if (comparator == null) {
          comparator =
              new Comparator<K>() {
                @SuppressWarnings("unchecked")
                @Override
                public int compare(K o1, K o2) {
                  return ((Comparable) o1).compareTo(o2);
                }
              };
        }
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 30 16:15:19 UTC 2024
    - 6.1K bytes
    - Viewed (0)
  5. android/guava-tests/test/com/google/common/collect/ComparatorsTest.java

    /**
     * Tests for {@code Comparators}.
     *
     * @author Louis Wasserman
     */
    @GwtCompatible
    @ElementTypesAreNonnullByDefault
    public class ComparatorsTest extends TestCase {
      public void testLexicographical() {
        Comparator<String> comparator = Ordering.natural();
        Comparator<Iterable<String>> lexy = Comparators.lexicographical(comparator);
    
        ImmutableList<String> empty = ImmutableList.of();
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 30 16:15:19 UTC 2024
    - 6.4K bytes
    - Viewed (0)
  6. android/guava/src/com/google/common/collect/RegularImmutableTable.java

           * provided but a row Comparator isn't, cellSet() iterates across the rows in the first
           * column, the rows in the second column, etc.
           */
          Comparator<Cell<R, C, V>> comparator =
              (Cell<R, C, V> cell1, Cell<R, C, V> cell2) -> {
                int rowCompare =
                    (rowComparator == null)
                        ? 0
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 30 16:15:19 UTC 2024
    - 7.1K bytes
    - Viewed (0)
  7. guava/src/com/google/common/collect/MinMaxPriorityQueue.java

         */
        private static final int UNSET_EXPECTED_SIZE = -1;
    
        private final Comparator<B> comparator;
        private int expectedSize = UNSET_EXPECTED_SIZE;
        private int maximumSize = Integer.MAX_VALUE;
    
        private Builder(Comparator<B> comparator) {
          this.comparator = checkNotNull(comparator);
        }
    
        /**
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 30 16:15:19 UTC 2024
    - 34.1K bytes
    - Viewed (0)
  8. 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)
  9. android/guava/src/com/google/common/collect/ImmutableSortedMap.java

      public static <K, V> ImmutableSortedMap<K, V> copyOfSorted(SortedMap<K, ? extends V> map) {
        Comparator<? super K> comparator = map.comparator();
        if (comparator == null) {
          // If map has a null comparator, the keys should have a natural ordering,
          // even though K doesn't explicitly implement Comparable.
          comparator = (Comparator<? super K>) NATURAL_ORDER;
        }
        if (map instanceof ImmutableSortedMap) {
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 30 16:15:19 UTC 2024
    - 53K bytes
    - Viewed (0)
  10. 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)
Back to top