Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 651 for iterators (0.1 sec)

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

        checkNotNull(iterable);
        Iterators.checkNonnegative(position);
        if (iterable instanceof List) {
          List<? extends T> list = Lists.cast(iterable);
          return (position < list.size()) ? list.get(position) : defaultValue;
        } else {
          Iterator<? extends T> iterator = iterable.iterator();
          Iterators.advance(iterator, position);
          return Iterators.getNext(iterator, defaultValue);
        }
      }
    
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Apr 24 19:38:27 UTC 2024
    - 42.8K bytes
    - Viewed (0)
  2. guava-tests/test/com/google/common/eventbus/SubscriberRegistryTest.java

        assertEquals(1, Iterators.size(registry.getSubscribers(1)));
    
        registry.register(new IntegerSubscriber());
        assertEquals(3, Iterators.size(registry.getSubscribers("")));
        assertEquals(1, Iterators.size(registry.getSubscribers(new Object())));
        assertEquals(2, Iterators.size(registry.getSubscribers(1)));
      }
    
      public void testGetSubscribers_returnsImmutableSnapshot() {
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Sep 06 17:04:31 UTC 2023
    - 5.7K bytes
    - Viewed (0)
  3. doc/next/6-stdlib/99-minor/go/types/66626.md

    All `go/types` data structures that expose sequences using a pair of
    methods such as `Len() int` and `At(int) T` now also methods that
    return iterators, allowing you to simplify code such as this:
    
    ```go
    params := fn.Type.(*types.Signature).Params()
    for i := 0; i < params.Len(); i++ {
       use(params.At(i))
    }
    ```
    
    to this:
    
    ```go
    for param := range fn.Signature().Params().Variables() {
       use(param)
    }
    ```
    
    Registered: Tue Nov 05 11:13:11 UTC 2024
    - Last Modified: Wed Jul 31 22:54:09 UTC 2024
    - 1K bytes
    - Viewed (0)
  4. guava/src/com/google/common/graph/AbstractBaseGraph.java

                if (graph.isDirected()) {
                  return Iterators.unmodifiableIterator(
                      Iterators.concat(
                          Iterators.transform(
                              graph.predecessors(node).iterator(),
                              (N predecessor) -> EndpointPair.ordered(predecessor, node)),
                          Iterators.transform(
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Mon Jan 22 17:29:38 UTC 2024
    - 7.2K bytes
    - Viewed (0)
  5. guava-tests/test/com/google/common/collect/MapsTransformValuesUnmodifiableIteratorTest.java

            @Override
            protected Set<K> delegate() {
              return delegate.keySet();
            }
    
            @Override
            public Iterator<K> iterator() {
              return Iterators.unmodifiableIterator(delegate.keySet().iterator());
            }
    
            @Override
            public boolean removeAll(Collection<?> c) {
              return delegate.keySet().removeAll(c);
            }
    
            @Override
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 30 16:15:19 UTC 2024
    - 12.3K bytes
    - Viewed (0)
  6. android/guava-tests/test/com/google/common/collect/PeekingIteratorTest.java

        List<?> list = emptyList();
        Iterator<?> iterator = list.iterator();
        PeekingIterator<?> peekingIterator = Iterators.peekingIterator(iterator);
    
        assertThrows(NoSuchElementException.class, () -> peekingIterator.peek());
      }
    
      public void testPeekDoesntChangeIteration() {
        List<?> list = Lists.newArrayList("A", "B", "C");
        Iterator<?> iterator = list.iterator();
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 30 16:15:19 UTC 2024
    - 8.6K bytes
    - Viewed (0)
  7. guava/src/com/google/common/collect/AbstractNavigableMap.java

      public Entry<K, V> firstEntry() {
        return Iterators.<@Nullable Entry<K, V>>getNext(entryIterator(), null);
      }
    
      @Override
      @CheckForNull
      public Entry<K, V> lastEntry() {
        return Iterators.<@Nullable Entry<K, V>>getNext(descendingEntryIterator(), null);
      }
    
      @Override
      @CheckForNull
      public Entry<K, V> pollFirstEntry() {
        return Iterators.pollNext(entryIterator());
      }
    
      @Override
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Thu Jun 15 18:11:44 UTC 2023
    - 4.5K bytes
    - Viewed (0)
  8. android/guava/src/com/google/common/collect/ForwardingNavigableSet.java

      protected E standardHigher(@ParametricNullness E e) {
        return Iterators.getNext(tailSet(e, false).iterator(), null);
      }
    
      @Override
      @CheckForNull
      public E pollFirst() {
        return delegate().pollFirst();
      }
    
      /**
       * A sensible definition of {@link #pollFirst} in terms of the {@code iterator} method. If you
       * override {@link #iterator} you may wish to override {@link #pollFirst} to forward to this
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri May 12 15:26:39 UTC 2023
    - 9K bytes
    - Viewed (0)
  9. android/guava/src/com/google/common/collect/FluentIterable.java

          @Override
          public Iterator<T> iterator() {
            return Iterators.concat(
                /* lazily generate the iterators on each input only as needed */
                new AbstractIndexedListIterator<Iterator<? extends T>>(inputs.length) {
                  @Override
                  public Iterator<? extends T> get(int i) {
                    return inputs[i].iterator();
                  }
                });
          }
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Tue Sep 24 13:42:31 UTC 2024
    - 35.7K bytes
    - Viewed (0)
  10. doc/next/6-stdlib/99-minor/strings/61901.md

    The [strings] package adds several functions that work with iterators:
    - [Lines] returns an iterator over
      the newline-terminated lines in the string s.
    - [SplitSeq] returns an iterator over
      all substrings of s separated by sep.
    - [SplitAfterSeq] returns an iterator
      over substrings of s split after each instance of sep.
    - [FieldsSeq] returns an iterator over
      substrings of s split around runs of whitespace characters,
      as defined by unicode.IsSpace.
    Registered: Tue Nov 05 11:13:11 UTC 2024
    - Last Modified: Wed Aug 14 18:23:13 UTC 2024
    - 580 bytes
    - Viewed (0)
Back to top