public void testMap() { SpliteratorTester.of( () -> CollectSpliterators.map( Arrays.spliterator(new String[] {"a", "b", "c", "d", "e"}), Ascii::toUpperCase)) .expect("A", "B", "C", "D", "E"); }
public void testFlatMap() { SpliteratorTester.of( () -> CollectSpliterators.flatMap( Arrays.spliterator(new String[] {"abc", "", "de", "f", "g", ""}), (String str) -> Lists.charactersOf(str).spliterator(), Spliterator.SIZED | Spliterator.DISTINCT | Spliterator.NONNULL, 7)) .expect('a', 'b', 'c', 'd', 'e', 'f', 'g'); }
@Override @SuppressWarnings("unchecked") public Spliterator<I> spliterator() { return Arrays.spliterator((I[]) storage, offset, offset + length); }
/** * Retrieves a spliterator for the contents of the given block. * * @param b * the block * * @return a spliterator for the contents of the specified block */ public Spliterator.OfInt statesInBlockSpliterator(Block b) { return Arrays.spliterator(blockData, b.low, b.high); }
/** * Retrieves a spliterator for the contents of the given block. * * @param b * the block * * @return a spliterator for the contents of the specified block */ public Spliterator.OfInt statesInBlockSpliterator(Block b) { return Arrays.spliterator(blockData, b.low, b.high); }
@Override public Spliterator<Path> spliterator() { return Arrays.spliterator(Corpus.this.files); }
@Override public Spliterator<I> spliterator() { return Arrays.spliterator(storage, offset, offset + length); }
static <T> Stream<T> getStream(CompletableFuture<T[]> resp) { return StreamSupport.stream(() -> Arrays.spliterator(resp.join()), Spliterator.ORDERED|Spliterator.SIZED|Spliterator.SUBSIZED|Spliterator.IMMUTABLE, false); }
public Stream<HttpField> stream() { return StreamSupport.stream(Arrays.spliterator(_fields,0,_size),false); }
public Stream<HttpField> stream() { return StreamSupport.stream(Arrays.spliterator(_fields,0,_size),false); }
public Stream<HttpField> stream() { return StreamSupport.stream(Arrays.spliterator(_fields, 0, _size), false); }
/** * Returns a sequential ordered {@code IntStreamEx} whose elements are the * specified values. * * @param elements the elements of the new stream * @return the new stream */ public static IntStreamEx of(int... elements) { return of(Arrays.spliterator(elements)); }
/** * Returns a sequential ordered {@code LongStreamEx} whose elements are the * specified values. * * @param elements the elements of the new stream * @return the new stream */ public static LongStreamEx of(long... elements) { return of(Arrays.spliterator(elements)); }
@SuppressWarnings("unchecked") static Matcher<String> containsAllStrings(final String... substrings) { Matcher<String>[] matchers = stream(spliterator(substrings), false) .map(org.hamcrest.Matchers::containsString) .toArray(Matcher[]::new); return allOf(matchers); }
/** * Returns a sequential ordered {@code DoubleStreamEx} whose elements are * the specified values. * * @param elements the elements of the new stream * @return the new stream */ public static DoubleStreamEx of(double... elements) { return of(Arrays.spliterator(elements)); }
@Override public Spliterator<KAFDocument> spliterator() { return spliteratorHelper(Arrays.spliterator(this.files)); }
/** Set-theoretic intersection of multiple IpSpaces */ public static @Nullable IpSpace intersection(IpSpace... ipSpaces) { return intersection(Arrays.spliterator(ipSpaces)); }
@Override @SuppressWarnings("unchecked") public Spliterator<Map.Entry<FieldId, Object>> spliterator() { Map.Entry<FieldId, Object>[] entries = new Map.Entry[fieldRegistry.runtimeFields().size()]; for (int i = 0; i < fieldRegistry.runtimeFields().size(); i++) { RuntimeField<M, Object> runtimeField = fieldRegistry.runtimeFields().get(i); entries[i] = new SupplierEntry<>(runtimeField, model); } return Arrays.spliterator(entries, 0, entries.length); }
public void testMap() { SpliteratorTester.of( () -> CollectSpliterators.map( Arrays.spliterator(new String[] {"a", "b", "c", "d", "e"}), Ascii::toUpperCase)) .expect("A", "B", "C", "D", "E"); }
public void testFlatMap() { SpliteratorTester.of( () -> CollectSpliterators.flatMap( Arrays.spliterator(new String[] {"abc", "", "de", "f", "g", ""}), (String str) -> Lists.charactersOf(str).spliterator(), Spliterator.SIZED | Spliterator.DISTINCT | Spliterator.NONNULL, 7)) .expect('a', 'b', 'c', 'd', 'e', 'f', 'g'); }