Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 9 of 9 for binarySearch (0.05 sec)

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

          imports = "java.util.Collections")
      // We can't compatibly make this `final` now.
      @InlineMeValidationDisabled(
          "While binarySearch() is not final, the inlining is still safe as long as any overrides"
              + " follow the contract.")
      @Deprecated
      public int binarySearch(
          List<? extends T> sortedList, @ParametricNullness T key) {
    Registered: Fri Dec 26 12:43:10 UTC 2025
    - Last Modified: Tue Sep 23 17:50:58 UTC 2025
    - 39.5K bytes
    - Viewed (0)
  2. guava/src/com/google/common/collect/RegularImmutableSortedSet.java

          }
        } catch (NullPointerException | ClassCastException e) {
          return false;
        }
      }
    
      private int unsafeBinarySearch(Object key) throws ClassCastException {
        return Collections.binarySearch(elements, key, unsafeComparator());
      }
    
      @Override
      boolean isPartialView() {
        return elements.isPartialView();
      }
    
      @Override
      int copyIntoArray(@Nullable Object[] dst, int offset) {
    Registered: Fri Dec 26 12:43:10 UTC 2025
    - Last Modified: Mon Sep 22 21:07:18 UTC 2025
    - 9K bytes
    - Viewed (0)
  3. android/guava-tests/test/com/google/common/collect/SortedListsTest.java

            for (int key = 0; key <= 10; key++) {
              assertModelAgrees(
                  LIST_WITHOUT_DUPS,
                  key,
                  SortedLists.binarySearch(LIST_WITHOUT_DUPS, key, presentBehavior, absentBehavior),
                  presentBehavior,
                  absentBehavior);
            }
          }
        }
      }
    
      public void testWithDups() {
    Registered: Fri Dec 26 12:43:10 UTC 2025
    - Last Modified: Thu Aug 07 16:05:33 UTC 2025
    - 4K bytes
    - Viewed (0)
  4. guava/src/com/google/common/collect/ImmutableRangeMap.java

          return this;
        }
        int lowerIndex =
            SortedLists.binarySearch(
                ranges,
                Range::upperBound,
                range.lowerBound,
                KeyPresentBehavior.FIRST_AFTER,
                KeyAbsentBehavior.NEXT_HIGHER);
        int upperIndex =
            SortedLists.binarySearch(
                ranges,
                Range::lowerBound,
                range.upperBound,
    Registered: Fri Dec 26 12:43:10 UTC 2025
    - Last Modified: Tue Sep 23 17:50:58 UTC 2025
    - 14.8K bytes
    - Viewed (0)
  5. okhttp/src/commonJvmAndroid/kotlin/okhttp3/internal/publicsuffix/PublicSuffixDatabase.kt

        // will look like: [foo, bar, com], [bar, com], [com]. The longest matching rule wins.
        var exactMatch: String? = null
        for (i in domainLabelsUtf8Bytes.indices) {
          val rule = publicSuffixList.bytes.binarySearch(domainLabelsUtf8Bytes, i)
          if (rule != null) {
            exactMatch = rule
            break
          }
        }
    
        // In theory, wildcard rules are not restricted to having the wildcard in the leftmost position.
    Registered: Fri Dec 26 11:42:13 UTC 2025
    - Last Modified: Mon Jul 28 07:33:49 UTC 2025
    - 8.5K bytes
    - Viewed (0)
  6. android/guava/src/com/google/common/collect/ImmutableRangeSet.java

          fromIndex =
              SortedLists.binarySearch(
                  ranges,
                  Range::upperBound,
                  range.lowerBound,
                  KeyPresentBehavior.FIRST_AFTER,
                  KeyAbsentBehavior.NEXT_HIGHER);
        } else {
          fromIndex = 0;
        }
    
        int toIndex;
        if (range.hasUpperBound()) {
          toIndex =
              SortedLists.binarySearch(
                  ranges,
    Registered: Fri Dec 26 12:43:10 UTC 2025
    - Last Modified: Tue Sep 23 17:50:58 UTC 2025
    - 27.5K bytes
    - Viewed (0)
  7. android/guava-tests/test/com/google/common/collect/OrderingTest.java

          for (int i = 0; i < strictlyOrderedList.size(); i++) {
            assertEquals(i, ordering.binarySearch(strictlyOrderedList, strictlyOrderedList.get(i)));
          }
          List<T> newList = new ArrayList<>(strictlyOrderedList);
          T valueNotInList = newList.remove(1);
          assertEquals(-2, ordering.binarySearch(newList, valueNotInList));
        }
    
        void testSortedCopy() {
    Registered: Fri Dec 26 12:43:10 UTC 2025
    - Last Modified: Fri Oct 10 23:13:45 UTC 2025
    - 42.8K bytes
    - Viewed (0)
  8. guava-tests/test/com/google/common/collect/OrderingTest.java

          for (int i = 0; i < strictlyOrderedList.size(); i++) {
            assertEquals(i, ordering.binarySearch(strictlyOrderedList, strictlyOrderedList.get(i)));
          }
          List<T> newList = new ArrayList<>(strictlyOrderedList);
          T valueNotInList = newList.remove(1);
          assertEquals(-2, ordering.binarySearch(newList, valueNotInList));
        }
    
        void testSortedCopy() {
    Registered: Fri Dec 26 12:43:10 UTC 2025
    - Last Modified: Fri Oct 10 23:13:45 UTC 2025
    - 42.8K bytes
    - Viewed (0)
  9. android/guava/src/com/google/common/collect/ImmutableSortedMap.java

                }
                // requireNonNull is safe because the first `size` elements have been filled in.
                // We're careful to put only K instances in.
                int index =
                    Arrays.binarySearch((K[]) sortedKeys, (K) requireNonNull(keys[i]), comparator);
                sortedValues[index] = requireNonNull(values[i]);
              }
              return new ImmutableSortedMap<K, V>(
    Registered: Fri Dec 26 12:43:10 UTC 2025
    - Last Modified: Mon Sep 22 21:07:18 UTC 2025
    - 52.9K bytes
    - Viewed (0)
Back to top