Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 176 for comparator (0.13 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/src/com/google/common/collect/TreeMultiset.java

        // reading data stored by writeObject
        Comparator<? super E> comparator = (Comparator<? super E>) requireNonNull(stream.readObject());
        Serialization.getFieldSetter(AbstractSortedMultiset.class, "comparator").set(this, comparator);
        Serialization.getFieldSetter(TreeMultiset.class, "range")
            .set(this, GeneralRange.all(comparator));
        Serialization.getFieldSetter(TreeMultiset.class, "rootReference")
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Oct 18 20:24:49 UTC 2024
    - 34.1K bytes
    - Viewed (0)
  5. 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)
  6. android/guava/src/com/google/common/collect/SortedLists.java

              Comparator<? super E> comparator,
              @ParametricNullness E key,
              List<? extends E> list,
              int foundIndex) {
            return FIRST_PRESENT.resultIndex(comparator, key, list, foundIndex) - 1;
          }
        };
    
        abstract <E extends @Nullable Object> int resultIndex(
            Comparator<? super E> comparator,
            @ParametricNullness E key,
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Sat Oct 19 00:05:46 UTC 2024
    - 11K bytes
    - Viewed (0)
  7. 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)
  8. 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)
  9. android/guava/src/com/google/common/collect/Collections2.java

          Iterable<E> elements, Comparator<? super E> comparator) {
        return new OrderedPermutationCollection<E>(elements, comparator);
      }
    
      private static final class OrderedPermutationCollection<E> extends AbstractCollection<List<E>> {
        final ImmutableList<E> inputList;
        final Comparator<? super E> comparator;
        final int size;
    
        OrderedPermutationCollection(Iterable<E> input, Comparator<? super E> comparator) {
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Oct 18 20:24:49 UTC 2024
    - 22.8K bytes
    - Viewed (0)
  10. 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)
Back to top