Search Options

Results per page
Sort
Preferred Languages
Advance

Results 41 - 50 of 84 for getFirst (0.2 sec)

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

        }
      }
    
      /**
       * Returns the next element in {@code iterator} or {@code defaultValue} if the iterator is empty.
       * The {@link Iterables} analog to this method is {@link Iterables#getFirst}.
       *
       * @param defaultValue the default value to return if the iterator is empty
       * @return the next element of {@code iterator} or the default value
       * @since 7.0
       */
      @ParametricNullness
    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)
  2. android/guava/src/com/google/common/collect/Iterables.java

       * @return the first element of {@code iterable} or the default value
       * @since 7.0
       */
      @ParametricNullness
      public static <T extends @Nullable Object> T getFirst(
          Iterable<? extends T> iterable, @ParametricNullness T defaultValue) {
        return Iterators.getNext(iterable.iterator(), defaultValue);
      }
    
      /**
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Apr 24 19:38:27 GMT 2024
    - 42.8K bytes
    - Viewed (0)
  3. guava/src/com/google/common/cache/LocalCache.java

            if (weight > 0) {
              return e;
            }
          }
          throw new AssertionError();
        }
    
        /** Returns first entry of bin for given hash. */
        ReferenceEntry<K, V> getFirst(int hash) {
          // read this volatile field only once
          AtomicReferenceArray<ReferenceEntry<K, V>> table = this.table;
          return table.get(hash & (table.length() - 1));
        }
    
    Java
    - Registered: Fri Apr 05 12:43:09 GMT 2024
    - Last Modified: Thu Feb 22 17:40:56 GMT 2024
    - 150.3K bytes
    - Viewed (0)
  4. android/guava/src/com/google/common/cache/LocalCache.java

            if (weight > 0) {
              return e;
            }
          }
          throw new AssertionError();
        }
    
        /** Returns first entry of bin for given hash. */
        ReferenceEntry<K, V> getFirst(int hash) {
          // read this volatile field only once
          AtomicReferenceArray<ReferenceEntry<K, V>> table = this.table;
          return table.get(hash & (table.length() - 1));
        }
    
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Thu Feb 22 17:40:56 GMT 2024
    - 144.7K bytes
    - Viewed (0)
  5. android/guava-testlib/src/com/google/common/collect/testing/testers/ListAddAllAtIndexTester.java

        assertTrue(
            "addAll(n, allPresent) should return true",
            getList().addAll(0, MinimalCollection.of(e0())));
        expectAdded(0, e0());
      }
    
      @ListFeature.Require(absent = SUPPORTS_ADD_WITH_INDEX)
      @CollectionSize.Require(absent = ZERO)
      public void testAddAllAtIndex_unsupportedAllPresent() {
        try {
          getList().addAll(0, MinimalCollection.of(e0()));
          fail("addAll(n, allPresent) should throw");
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Tue Feb 20 17:00:05 GMT 2024
    - 6.5K bytes
    - Viewed (1)
  6. android/guava-testlib/src/com/google/common/collect/testing/testers/ListSubListTester.java

           */
        }
      }
    
      public void testSubList_empty() {
        assertEquals("subList(0, 0) should be empty", emptyList(), getList().subList(0, 0));
      }
    
      public void testSubList_entireList() {
        assertEquals(
            "subList(0, size) should be equal to the original list",
            getList(),
            getList().subList(0, getNumElements()));
      }
    
      @ListFeature.Require(SUPPORTS_REMOVE_WITH_INDEX)
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Feb 21 16:49:06 GMT 2024
    - 13.4K bytes
    - Viewed (0)
  7. android/guava-testlib/src/com/google/common/collect/testing/testers/ListListIteratorTester.java

          protected ListIterator<E> newTargetIterator() {
            resetCollection();
            return getList().listIterator();
          }
    
          @Override
          protected void verify(List<E> elements) {
            expectContents(elements);
          }
        }.test();
      }
    
      public void testListIterator_tooLow() {
        try {
          getList().listIterator(-1);
          fail();
        } catch (IndexOutOfBoundsException expected) {
        }
      }
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Feb 21 16:49:06 GMT 2024
    - 4.8K bytes
    - Viewed (0)
  8. android/guava-testlib/src/com/google/common/collect/testing/testers/ListAddAtIndexTester.java

       */
      public void testAddAtIndex_unsupportedPresent() {
        try {
          getList().add(0, e0());
          fail("add(n, present) should throw");
        } catch (UnsupportedOperationException expected) {
        }
        expectUnchanged();
      }
    
      @ListFeature.Require(SUPPORTS_ADD_WITH_INDEX)
      public void testAddAtIndex_supportedNotPresent() {
        getList().add(0, e3());
        expectAdded(0, e3());
      }
    
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Feb 21 16:49:06 GMT 2024
    - 5.6K bytes
    - Viewed (0)
  9. guava-testlib/src/com/google/common/collect/testing/testers/ListSubListTester.java

           */
        }
      }
    
      public void testSubList_empty() {
        assertEquals("subList(0, 0) should be empty", emptyList(), getList().subList(0, 0));
      }
    
      public void testSubList_entireList() {
        assertEquals(
            "subList(0, size) should be equal to the original list",
            getList(),
            getList().subList(0, getNumElements()));
      }
    
      @ListFeature.Require(SUPPORTS_REMOVE_WITH_INDEX)
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed Feb 21 16:49:06 GMT 2024
    - 13.4K bytes
    - Viewed (0)
  10. android/guava-testlib/src/com/google/common/collect/testing/testers/ListSetTester.java

        int index = aValidIndex();
        E initialValue = getList().get(index);
        assertEquals(
            "set(i, x) should return the old element at position i.",
            initialValue,
            getList().set(index, newValue));
        assertEquals("After set(i, x), get(i) should return x", newValue, getList().get(index));
        assertEquals("set() should not change the size of a list.", getNumElements(), getList().size());
      }
    
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Feb 21 16:49:06 GMT 2024
    - 5.3K bytes
    - Viewed (0)
Back to top