Search Options

Results per page
Sort
Preferred Languages
Advance

Results 41 - 50 of 314 for comparator (0.1 sec)

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

      final Comparator<? super T>[] comparators;
    
      @SuppressWarnings("unchecked") // Generic array creation
      CompoundOrdering(Comparator<? super T> primary, Comparator<? super T> secondary) {
        this.comparators = (Comparator<? super T>[]) new Comparator<?>[] {primary, secondary};
      }
    
      @SuppressWarnings("unchecked") // Generic array creation
      CompoundOrdering(Iterable<? extends Comparator<? super T>> comparators) {
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Thu Feb 22 21:19:52 UTC 2024
    - 2.4K bytes
    - Viewed (0)
  2. android/guava-testlib/src/com/google/common/collect/testing/Helpers.java

       * the given {@code comparator}.
       *
       * @see #testComparator(Comparator, List)
       */
      public static <T extends @Nullable Object> void testComparator(
          Comparator<? super T> comparator, T... valuesInExpectedOrder) {
        testComparator(comparator, asList(valuesInExpectedOrder));
      }
    
      /**
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 30 16:15:19 UTC 2024
    - 17.5K bytes
    - Viewed (0)
  3. android/guava-testlib/src/com/google/common/collect/testing/DerivedCollectionGenerators.java

        final E lastInclusive;
        private final Comparator<? super E> comparator;
        private final TestSortedSetGenerator<E> delegate;
    
        public SortedSetSubsetTestSetGenerator(
            TestSortedSetGenerator<E> delegate, Bound to, Bound from) {
          this.to = to;
          this.from = from;
          this.delegate = delegate;
    
          SortedSet<E> emptySet = delegate.create();
          this.comparator = emptySet.comparator();
    
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 30 16:15:19 UTC 2024
    - 18.2K bytes
    - Viewed (0)
  4. guava/src/com/google/common/collect/Range.java

        checkNotNull(values);
        if (values instanceof SortedSet) {
          SortedSet<C> set = (SortedSet<C>) values;
          Comparator<?> comparator = set.comparator();
          if (Ordering.<C>natural().equals(comparator) || comparator == null) {
            return closed(set.first(), set.last());
          }
        }
        Iterator<C> valueIterator = values.iterator();
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 16 17:21:56 UTC 2024
    - 27.8K bytes
    - Viewed (0)
  5. guava-tests/test/com/google/common/collect/TreeMultisetTest.java

        assertEquals("a", elementSet.last());
        assertEquals(comparator, elementSet.comparator());
      }
    
      public void testNullAcceptingComparator() throws Exception {
        Comparator<@Nullable String> comparator = Ordering.<String>natural().<String>nullsFirst();
        TreeMultiset<@Nullable String> ms = TreeMultiset.create(comparator);
    
        ms.add("b");
        ms.add(null);
        ms.add("a");
        ms.add("b");
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Sat Oct 19 00:05:46 UTC 2024
    - 12.9K bytes
    - Viewed (0)
  6. android/guava/src/com/google/common/collect/ImmutableSortedSet.java

        @SuppressWarnings({"unchecked", "nullness"})
        Comparator<@Nullable Object> unsafeComparator = (Comparator<@Nullable Object>) comparator;
        return unsafeComparator.compare(a, b);
      }
    
      final transient Comparator<? super E> comparator;
    
      ImmutableSortedSet(Comparator<? super E> comparator) {
        this.comparator = comparator;
      }
    
      /**
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 30 16:15:19 UTC 2024
    - 36.9K bytes
    - Viewed (0)
  7. android/guava-tests/test/com/google/common/collect/OrderingTest.java

        Ordering<@Nullable Object> comparator = Ordering.allEqual();
        assertSame(comparator, comparator.reverse());
    
        assertEquals(0, comparator.compare(null, null));
        assertEquals(0, comparator.compare(new Object(), new Object()));
        assertEquals(0, comparator.compare("apples", "oranges"));
        assertSame(comparator, reserialize(comparator));
        assertEquals("Ordering.allEqual()", comparator.toString());
    
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 30 16:15:19 UTC 2024
    - 42.6K bytes
    - Viewed (0)
  8. guava-tests/test/com/google/common/collect/OrderingTest.java

        Ordering<@Nullable Object> comparator = Ordering.allEqual();
        assertSame(comparator, comparator.reverse());
    
        assertEquals(0, comparator.compare(null, null));
        assertEquals(0, comparator.compare(new Object(), new Object()));
        assertEquals(0, comparator.compare("apples", "oranges"));
        assertSame(comparator, reserialize(comparator));
        assertEquals("Ordering.allEqual()", comparator.toString());
    
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 30 16:15:19 UTC 2024
    - 42.6K bytes
    - Viewed (0)
  9. guava-testlib/src/com/google/common/collect/testing/SafeTreeMap.java

      }
    
      @Override
      public void clear() {
        delegate.clear();
      }
    
      @Override
      public Comparator<? super K> comparator() {
        Comparator<? super K> comparator = delegate.comparator();
        if (comparator == null) {
          comparator = (Comparator<? super K>) NATURAL_ORDER;
        }
        return comparator;
      }
    
      @Override
      public boolean containsKey(Object key) {
        try {
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Tue Feb 20 17:00:05 UTC 2024
    - 7.5K bytes
    - Viewed (0)
  10. guava/src/com/google/common/collect/ForwardingSortedMap.java

      @SuppressWarnings({"unchecked", "nullness"})
      static int unsafeCompare(
          @CheckForNull Comparator<?> comparator, @CheckForNull Object o1, @CheckForNull Object o2) {
        if (comparator == null) {
          return ((Comparable<@Nullable Object>) o1).compareTo(o2);
        } else {
          return ((Comparator<@Nullable Object>) comparator).compare(o1, o2);
        }
      }
    
      /**
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri May 12 15:26:39 UTC 2023
    - 5.6K bytes
    - Viewed (0)
Back to top