Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 7 of 7 for copyOfSorted (0.05 sec)

  1. guava-tests/test/com/google/common/collect/ImmutableSortedMapTest.java

        original.put("one", 1);
        original.put("two", 2);
        original.put("three", 3);
    
        ImmutableSortedMap<String, Integer> copy = ImmutableSortedMap.copyOfSorted(original);
        assertMapEquals(copy, "one", 1, "three", 3, "two", 2);
        assertSame(copy, ImmutableSortedMap.copyOfSorted(copy));
        assertSame(Ordering.natural(), copy.comparator());
      }
    
      public void testCopyOfSortedExplicit() {
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Thu Aug 07 16:05:33 UTC 2025
    - 27.6K bytes
    - Viewed (0)
  2. android/guava/src/com/google/common/collect/ImmutableSortedSet.java

       * When multiple elements are equivalent according to {@code compareTo()}, only the first one
       * specified is included. To create a copy of a {@code SortedSet} that preserves the comparator,
       * call {@link #copyOfSorted} instead. This method iterates over {@code elements} at most once.
       *
       * <p>Note that if {@code s} is a {@code Set<String>}, then {@code ImmutableSortedSet.copyOf(s)}
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Thu Aug 07 16:05:33 UTC 2025
    - 36.8K bytes
    - Viewed (0)
  3. guava-gwt/src-super/com/google/common/collect/super/com/google/common/collect/ImmutableSortedMap.java

        checkNotNull(mergeFunction);
        return Collectors.collectingAndThen(
            Collectors.toMap(
                keyFunction, valueFunction, mergeFunction, () -> new TreeMap<K, V>(comparator)),
            ImmutableSortedMap::copyOfSorted);
      }
    
      // unsafe, comparator() returns a comparator on the specified type
      @SuppressWarnings("unchecked")
      public static <K, V> ImmutableSortedMap<K, V> of() {
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Wed Aug 06 18:32:41 UTC 2025
    - 16.1K bytes
    - Viewed (0)
  4. guava-tests/test/com/google/common/collect/ImmutableSortedSetTest.java

        SortedSet<String> set = ImmutableSortedSet.copyOfSorted(input);
        assertThat(set).containsExactly("a", "in", "jumped", "over", "quick", "the").inOrder();
      }
    
      public void testCopyOfSorted_natural_comparator() {
        SortedSet<String> input = Sets.newTreeSet(asList("in", "the", "quick", "jumped", "over", "a"));
        SortedSet<String> set = ImmutableSortedSet.copyOfSorted(input);
        assertSame(Ordering.natural(), set.comparator());
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Thu Aug 07 16:05:33 UTC 2025
    - 46.7K bytes
    - Viewed (0)
  5. guava-gwt/src-super/com/google/common/collect/super/com/google/common/collect/ImmutableSortedSet.java

        return copyOfInternal(comparator, elements);
      }
    
      // We use NATURAL_ORDER only if the input was already using natural ordering.
      @SuppressWarnings("unchecked")
      public static <E> ImmutableSortedSet<E> copyOfSorted(SortedSet<E> sortedSet) {
        Comparator<? super E> comparator = sortedSet.comparator();
        if (comparator == null) {
          comparator = (Comparator<? super E>) NATURAL_ORDER;
        }
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Wed Aug 06 18:32:41 UTC 2025
    - 15.5K bytes
    - Viewed (0)
  6. android/guava/src/com/google/common/collect/ImmutableCollection.java

     * usually include:
     *
     * <ul>
     *   <li>Static methods named {@code of}, accepting an explicit list of elements or entries.
     *   <li>Static methods named {@code copyOf} (or {@code copyOfSorted}), accepting an existing
     *       collection whose contents should be copied.
     *   <li>A static nested {@code Builder} class which can be used to populate a new immutable
     *       instance.
     * </ul>
     *
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Thu Aug 07 16:05:33 UTC 2025
    - 21.4K bytes
    - Viewed (0)
  7. guava/src/com/google/common/collect/ImmutableCollection.java

     * usually include:
     *
     * <ul>
     *   <li>Static methods named {@code of}, accepting an explicit list of elements or entries.
     *   <li>Static methods named {@code copyOf} (or {@code copyOfSorted}), accepting an existing
     *       collection whose contents should be copied.
     *   <li>A static nested {@code Builder} class which can be used to populate a new immutable
     *       instance.
     * </ul>
     *
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Thu Aug 07 16:05:33 UTC 2025
    - 18.7K bytes
    - Viewed (0)
Back to top