Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 8 of 8 for binarySearch (0.04 sec)

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

       * algorithm.
       *
       * <p>Equivalent to {@link #binarySearch(List, Function, Object, Comparator, KeyPresentBehavior,
       * KeyAbsentBehavior)} using {@link Ordering#natural}.
       */
      @SuppressWarnings("rawtypes") // https://github.com/google/guava/issues/989
      public static <E extends Comparable> int binarySearch(
          List<? extends E> list,
          E e,
          KeyPresentBehavior presentBehavior,
    Registered: Fri Dec 26 12:43:10 UTC 2025
    - Last Modified: Sun Dec 22 03:38:46 UTC 2024
    - 10.9K bytes
    - Viewed (0)
  2. android/guava/src/com/google/common/collect/SortedLists.java

       * algorithm.
       *
       * <p>Equivalent to {@link #binarySearch(List, Function, Object, Comparator, KeyPresentBehavior,
       * KeyAbsentBehavior)} using {@link Ordering#natural}.
       */
      @SuppressWarnings("rawtypes") // https://github.com/google/guava/issues/989
      public static <E extends Comparable> int binarySearch(
          List<? extends E> list,
          E e,
          KeyPresentBehavior presentBehavior,
    Registered: Fri Dec 26 12:43:10 UTC 2025
    - Last Modified: Sun Dec 22 03:38:46 UTC 2024
    - 10.9K bytes
    - Viewed (0)
  3. 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)
  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. 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)
  6. 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)
  7. 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. android/guava/src/com/google/common/collect/ImmutableSortedMultiset.java

                Arrays.copyOf(sortedElements, IntMath.saturatedAdd(length, length / 2 + 1));
          }
          int[] sortedCounts = new int[sortedElements.length];
          for (int i = 0; i < length; i++) {
            int index = Arrays.binarySearch(sortedElements, 0, uniques, elements[i], comparator);
            if (counts[i] >= 0) {
              sortedCounts[index] += counts[i];
            } else {
              sortedCounts[index] = ~counts[i];
            }
          }
    Registered: Fri Dec 26 12:43:10 UTC 2025
    - Last Modified: Tue May 13 17:27:14 UTC 2025
    - 35.2K bytes
    - Viewed (0)
Back to top