Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 19 for indexOf (0.16 sec)

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

        assertEquals(1, Iterators.indexOf(iterator, Predicates.equalTo("mo")));
        assertEquals("jack", iterator.next());
        assertFalse(iterator.hasNext());
      }
    
      public void testIndexOf_consumedDataWithDuplicates() {
        Iterator<String> iterator = Lists.newArrayList("manny", "mo", "mo", "jack").iterator();
        assertEquals(1, Iterators.indexOf(iterator, Predicates.equalTo("mo")));
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Thu Mar 07 18:34:03 GMT 2024
    - 55.7K bytes
    - Viewed (0)
  2. android/guava/src/com/google/common/collect/Synchronized.java

        @Override
        public void add(int index, E element) {
          synchronized (mutex) {
            delegate().add(index, element);
          }
        }
    
        @Override
        public boolean addAll(int index, Collection<? extends E> c) {
          synchronized (mutex) {
            return delegate().addAll(index, c);
          }
        }
    
        @Override
        public E get(int index) {
          synchronized (mutex) {
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Mon Apr 01 16:15:01 GMT 2024
    - 53.4K bytes
    - Viewed (0)
  3. android/guava-tests/test/com/google/common/collect/IteratorsTest.java

        assertEquals(1, Iterators.indexOf(iterator, Predicates.equalTo("mo")));
        assertEquals("jack", iterator.next());
        assertFalse(iterator.hasNext());
      }
    
      public void testIndexOf_consumedDataWithDuplicates() {
        Iterator<String> iterator = Lists.newArrayList("manny", "mo", "mo", "jack").iterator();
        assertEquals(1, Iterators.indexOf(iterator, Predicates.equalTo("mo")));
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Tue Apr 30 18:43:01 GMT 2024
    - 56.5K bytes
    - Viewed (0)
  4. android/guava/src/com/google/common/collect/ImmutableSortedMap.java

      }
    
      @Override
      public int size() {
        return valueList.size();
      }
    
      @Override
      @CheckForNull
      public V get(@CheckForNull Object key) {
        int index = keySet.indexOf(key);
        return (index == -1) ? null : valueList.get(index);
      }
    
      @Override
      boolean isPartialView() {
        return keySet.isPartialView() || valueList.isPartialView();
      }
    
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed May 01 18:44:57 GMT 2024
    - 53.2K bytes
    - Viewed (0)
  5. guava/src/com/google/common/collect/ImmutableSortedMap.java

          action.accept(keyList.get(i), valueList.get(i));
        }
      }
    
      @Override
      @CheckForNull
      public V get(@CheckForNull Object key) {
        int index = keySet.indexOf(key);
        return (index == -1) ? null : valueList.get(index);
      }
    
      @Override
      boolean isPartialView() {
        return keySet.isPartialView() || valueList.isPartialView();
      }
    
    Java
    - Registered: Fri Apr 05 12:43:09 GMT 2024
    - Last Modified: Thu Feb 22 21:19:52 GMT 2024
    - 50.3K bytes
    - Viewed (0)
  6. guava/src/com/google/common/collect/Iterators.java

             * of the array becomes null only when we iterate past it and then clear it.
             */
            I result = requireNonNull(elements[index]);
            elements[index] = null;
            index++;
            return result;
          }
        };
      }
    
      /**
       * Combines two iterators into a single iterator. The returned iterator iterates across the
    Java
    - Registered: Fri Apr 05 12:43:09 GMT 2024
    - Last Modified: Tue Jan 30 00:14:39 GMT 2024
    - 50.5K bytes
    - Viewed (0)
  7. android/guava/src/com/google/common/base/Preconditions.java

          throw new IndexOutOfBoundsException(badPositionIndex(index, size, desc));
        }
        return index;
      }
    
      private static String badPositionIndex(int index, int size, String desc) {
        if (index < 0) {
          return lenientFormat("%s (%s) must not be negative", desc, index);
        } else if (size < 0) {
          throw new IllegalArgumentException("negative size: " + size);
        } else { // index > size
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Thu Apr 11 11:52:14 GMT 2024
    - 52.9K bytes
    - Viewed (0)
  8. android/guava-tests/test/com/google/common/cache/CacheLoadingTest.java

       * the exception thrown.
       *
       * <p>As we iterate from {@code 0} to {@code nThreads}, threads with an even index will call
       * {@code getUnchecked}, and threads with an odd index will call {@code get}. If the cache throws
       * exceptions, this difference may be visible in the returned List.
       */
      private static <K> List<Object> doConcurrentGet(
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 86.2K bytes
    - Viewed (0)
  9. guava-tests/test/com/google/common/cache/CacheLoadingTest.java

       * the exception thrown.
       *
       * <p>As we iterate from {@code 0} to {@code nThreads}, threads with an even index will call
       * {@code getUnchecked}, and threads with an odd index will call {@code get}. If the cache throws
       * exceptions, this difference may be visible in the returned List.
       */
      private static <K> List<Object> doConcurrentGet(
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 86.2K bytes
    - Viewed (0)
  10. guava-tests/test/com/google/common/collect/MapsTest.java

              Maps.uniqueIndex(ImmutableSet.of("one", "uno"), Functions.constant(1));
          fail();
        } catch (IllegalArgumentException expected) {
          assertThat(expected.getMessage()).contains("Multimaps.index");
        }
      }
    
      /** Null values are not allowed. */
      public void testUniqueIndexNullValue() {
        List<@Nullable String> listWithNull = Lists.newArrayList((String) null);
        try {
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Mon Mar 04 16:06:01 GMT 2024
    - 67.2K bytes
    - Viewed (0)
Back to top