Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 1 - 10 of 28 for CollectSpliterators (0.21 seconds)

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

    import java.util.stream.IntStream;
    import org.jspecify.annotations.Nullable;
    
    /** Spliterator utilities for {@code common.collect} internals. */
    @GwtCompatible
    final class CollectSpliterators {
      private CollectSpliterators() {}
    
      static <T extends @Nullable Object> Spliterator<T> indexed(
          int size, int extraCharacteristics, IntFunction<T> function) {
        return indexed(size, extraCharacteristics, function, null);
    Created: Fri Apr 03 12:43:13 GMT 2026
    - Last Modified: Mon Nov 17 22:50:48 GMT 2025
    - 19.9K bytes
    - Click Count (0)
  2. android/guava/src/com/google/common/collect/CollectSpliterators.java

    import org.jspecify.annotations.Nullable;
    
    /** Spliterator utilities for {@code common.collect} internals. */
    @GwtCompatible
    @IgnoreJRERequirement // used only from APIs that work with Stream
    final class CollectSpliterators {
      private CollectSpliterators() {}
    
      static <T extends @Nullable Object> Spliterator<T> indexed(
          int size, int extraCharacteristics, IntFunction<T> function) {
        return indexed(size, extraCharacteristics, function, null);
    Created: Fri Apr 03 12:43:13 GMT 2026
    - Last Modified: Sat Aug 09 01:14:59 GMT 2025
    - 20.5K bytes
    - Click Count (0)
  3. android/guava-tests/test/com/google/common/collect/CollectSpliteratorsTest.java

    import junit.framework.TestCase;
    import org.jspecify.annotations.NullMarked;
    
    /** Tests for {@code CollectSpliterators}. */
    @GwtCompatible
    @NullMarked
    public class CollectSpliteratorsTest extends TestCase {
      public void testMap() {
        SpliteratorTester.of(
                () ->
                    CollectSpliterators.map(
                        Arrays.spliterator(new String[] {"a", "b", "c", "d", "e"}), Ascii::toUpperCase))
    Created: Fri Apr 03 12:43:13 GMT 2026
    - Last Modified: Tue May 13 17:27:14 GMT 2025
    - 4.1K bytes
    - Click Count (0)
  4. guava-tests/test/com/google/common/collect/CollectSpliteratorsTest.java

    import junit.framework.TestCase;
    import org.jspecify.annotations.NullMarked;
    
    /** Tests for {@code CollectSpliterators}. */
    @GwtCompatible
    @NullMarked
    public class CollectSpliteratorsTest extends TestCase {
      @GwtIncompatible
      public void testMap() {
        SpliteratorTester.of(
                () ->
                    CollectSpliterators.map(
                        Arrays.spliterator(new String[] {"a", "b", "c", "d", "e"}),
                        0,
    Created: Fri Apr 03 12:43:13 GMT 2026
    - Last Modified: Mon Nov 17 22:50:48 GMT 2025
    - 4.2K bytes
    - Click Count (0)
  5. guava/src/com/google/common/collect/ArrayTable.java

              return getEntry(index);
            }
          };
        }
    
        @Override
        @GwtIncompatible // Spliterator
        Spliterator<Entry<K, V>> entrySpliterator() {
          return CollectSpliterators.indexed(
              size(), Spliterator.ORDERED | Spliterator.DISTINCT | Spliterator.NONNULL, this::getEntry);
        }
    
        // TODO(lowasser): consider an optimized values() implementation
    
        @Override
    Created: Fri Apr 03 12:43:13 GMT 2026
    - Last Modified: Sun Mar 08 16:16:42 GMT 2026
    - 26.9K bytes
    - Click Count (0)
  6. guava/src/com/google/common/collect/ImmutableMapValues.java

          @Override
          public V next() {
            return entryItr.next().getValue();
          }
        };
      }
    
      @Override
      @GwtIncompatible // Spliterator
      public Spliterator<V> spliterator() {
        return CollectSpliterators.map(
            map.entrySet().spliterator(),
            Spliterator.ORDERED | Spliterator.IMMUTABLE | Spliterator.NONNULL,
            Entry::getValue);
      }
    
      @Override
    Created: Fri Apr 03 12:43:13 GMT 2026
    - Last Modified: Sun Mar 08 16:16:42 GMT 2026
    - 4.1K bytes
    - Click Count (0)
  7. android/guava/src/com/google/common/collect/Streams.java

          characteristics &= splitr.characteristics();
          estimatedSize = LongMath.saturatedAdd(estimatedSize, splitr.estimateSize());
        }
        return StreamSupport.stream(
                CollectSpliterators.flatMap(
                    splitrsBuilder.build().spliterator(),
                    splitr -> (Spliterator<T>) splitr,
                    characteristics,
                    estimatedSize),
                isParallel)
    Created: Fri Apr 03 12:43:13 GMT 2026
    - Last Modified: Mon Feb 23 19:19:10 GMT 2026
    - 36.8K bytes
    - Click Count (0)
  8. guava/src/com/google/common/collect/ImmutableEnumMap.java

        return Maps.unmodifiableEntryIterator(delegate.entrySet().iterator());
      }
    
      @Override
      @GwtIncompatible // Spliterator
      Spliterator<Entry<K, V>> entrySpliterator() {
        return CollectSpliterators.map(
            delegate.entrySet().spliterator(),
            Spliterator.DISTINCT | Spliterator.ORDERED | Spliterator.IMMUTABLE | Spliterator.NONNULL,
            Maps::unmodifiableEntry);
      }
    
      @Override
    Created: Fri Apr 03 12:43:13 GMT 2026
    - Last Modified: Sun Mar 08 16:16:42 GMT 2026
    - 4.3K bytes
    - Click Count (0)
  9. guava/src/com/google/common/collect/IndexedImmutableSet.java

      abstract E get(int index);
    
      @Override
      public UnmodifiableIterator<E> iterator() {
        return asList().iterator();
      }
    
      @Override
      public Spliterator<E> spliterator() {
        return CollectSpliterators.indexed(size(), SPLITERATOR_CHARACTERISTICS, this::get);
      }
    
      @Override
      public void forEach(Consumer<? super E> consumer) {
        checkNotNull(consumer);
        int n = size();
        for (int i = 0; i < n; i++) {
    Created: Fri Apr 03 12:43:13 GMT 2026
    - Last Modified: Thu Aug 07 16:05:33 GMT 2025
    - 2.6K bytes
    - Click Count (0)
  10. guava/src/com/google/common/collect/AbstractMapBasedMultimap.java

      @Override
      Spliterator<Entry<K, V>> entrySpliterator() {
        return CollectSpliterators.flatMap(
            map.entrySet().spliterator(),
            keyToValueCollectionEntry -> {
              K key = keyToValueCollectionEntry.getKey();
              Collection<V> valueCollection = keyToValueCollectionEntry.getValue();
              return CollectSpliterators.map(
                  valueCollection.spliterator(),
    Created: Fri Apr 03 12:43:13 GMT 2026
    - Last Modified: Mon Nov 17 22:50:48 GMT 2025
    - 48.4K bytes
    - Click Count (0)
Back to Top