Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 46 for getLast (0.05 sec)

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

        assertEquals("c", Iterables.getLast(list));
      }
    
      public void testGetLast_emptyList() {
        List<String> list = emptyList();
        assertThrows(NoSuchElementException.class, () -> Iterables.getLast(list));
      }
    
      public void testGetLast_sortedSet() {
        SortedSet<String> sortedSet = ImmutableSortedSet.of("b", "c", "a");
        assertEquals("c", Iterables.getLast(sortedSet));
      }
    
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 30 19:12:33 UTC 2024
    - 45K bytes
    - Viewed (0)
  2. guava/src/com/google/common/collect/TreeTraverser.java

        }
    
        @Override
        public boolean hasNext() {
          return !stack.isEmpty();
        }
    
        @Override
        public T next() {
          Iterator<T> itr = stack.getLast(); // throws NSEE if empty
          T result = checkNotNull(itr.next());
          if (!itr.hasNext()) {
            stack.removeLast();
          }
          Iterator<T> childItr = children(result).iterator();
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 30 16:15:19 UTC 2024
    - 8.9K bytes
    - Viewed (0)
  3. guava-tests/test/com/google/common/collect/IteratorsTest.java

        assertEquals("foo", Iterators.getLast(iterator, "bar"));
      }
    
      public void testGetLast_withDefault_empty() {
        Iterator<String> iterator = emptyIterator();
        assertEquals("bar", Iterators.getLast(iterator, "bar"));
      }
    
      public void testGetLast_withDefault_empty_null() {
        Iterator<String> iterator = emptyIterator();
        assertNull(Iterators.<@Nullable String>getLast(iterator, null));
      }
    
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 30 16:15:19 UTC 2024
    - 54.1K bytes
    - Viewed (0)
  4. android/guava-tests/test/com/google/common/collect/IteratorsTest.java

        assertEquals("foo", Iterators.getLast(iterator, "bar"));
      }
    
      public void testGetLast_withDefault_empty() {
        Iterator<String> iterator = emptyIterator();
        assertEquals("bar", Iterators.getLast(iterator, "bar"));
      }
    
      public void testGetLast_withDefault_empty_null() {
        Iterator<String> iterator = emptyIterator();
        assertNull(Iterators.<@Nullable String>getLast(iterator, null));
      }
    
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 30 16:15:19 UTC 2024
    - 54.1K bytes
    - Viewed (0)
  5. guava/src/com/google/common/collect/ImmutableRangeSet.java

        private final boolean positiveBoundedAbove;
    
        private final int size;
    
        ComplementRanges() {
          this.positiveBoundedBelow = ranges.get(0).hasLowerBound();
          this.positiveBoundedAbove = Iterables.getLast(ranges).hasUpperBound();
    
          int size = ranges.size() - 1;
          if (positiveBoundedBelow) {
            size++;
          }
          if (positiveBoundedAbove) {
            size++;
          }
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 30 16:15:19 UTC 2024
    - 27K bytes
    - Viewed (0)
  6. android/guava/src/com/google/common/collect/Iterators.java

       * @return the last element of {@code iterator}
       * @since 3.0
       */
      @ParametricNullness
      public static <T extends @Nullable Object> T getLast(
          Iterator<? extends T> iterator, @ParametricNullness T defaultValue) {
        return iterator.hasNext() ? getLast(iterator) : defaultValue;
      }
    
      /**
       * Calls {@code next()} on {@code iterator}, either {@code numberToAdvance} times or until {@code
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 30 16:15:19 UTC 2024
    - 50.3K bytes
    - Viewed (0)
  7. android/guava/src/com/google/common/collect/Synchronized.java

        @Override
        public E getFirst() {
          synchronized (mutex) {
            return delegate().getFirst();
          }
        }
    
        @Override
        public E getLast() {
          synchronized (mutex) {
            return delegate().getLast();
          }
        }
    
        @Override
        @CheckForNull
        public E peekFirst() {
          synchronized (mutex) {
            return delegate().peekFirst();
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 30 16:15:19 UTC 2024
    - 53.4K bytes
    - Viewed (0)
  8. guava/src/com/google/common/collect/Synchronized.java

        @Override
        public E getFirst() {
          synchronized (mutex) {
            return delegate().getFirst();
          }
        }
    
        @Override
        public E getLast() {
          synchronized (mutex) {
            return delegate().getLast();
          }
        }
    
        @Override
        @CheckForNull
        public E peekFirst() {
          synchronized (mutex) {
            return delegate().peekFirst();
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 30 16:15:19 UTC 2024
    - 57.2K bytes
    - Viewed (0)
  9. android/guava-testlib/src/com/google/common/collect/testing/testers/ListListIteratorTester.java

            resetCollection();
            return getList().listIterator();
          }
    
          @Override
          protected void verify(List<E> elements) {
            expectContents(elements);
          }
        }.test();
      }
    
      public void testListIterator_tooLow() {
        assertThrows(IndexOutOfBoundsException.class, () -> getList().listIterator(-1));
      }
    
      public void testListIterator_tooHigh() {
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 30 16:15:19 UTC 2024
    - 5K bytes
    - Viewed (0)
  10. android/guava-testlib/src/com/google/common/collect/testing/testers/ListReplaceAllTester.java

      @ListFeature.Require(SUPPORTS_SET)
      public void testReplaceAll() {
        getList().replaceAll(e -> samples.e3());
        expectContents(Collections.nCopies(getNumElements(), samples.e3()));
      }
    
      @ListFeature.Require(SUPPORTS_SET)
      public void testReplaceAll_changesSome() {
        getList().replaceAll(e -> e.equals(samples.e0()) ? samples.e3() : e);
        E[] expected = createSamplesArray();
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Thu Oct 31 14:51:04 UTC 2024
    - 2.5K bytes
    - Viewed (0)
Back to top