本文整理了Java中java.util.Arrays.spliterator()
方法的一些代码示例,展示了Arrays.spliterator()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Arrays.spliterator()
方法的具体详情如下:
包路径:java.util.Arrays
类名称:Arrays
方法名:spliterator
暂无
代码示例来源:origin: google/guava
public void testMap() {
SpliteratorTester.of(
() ->
CollectSpliterators.map(
Arrays.spliterator(new String[] {"a", "b", "c", "d", "e"}), Ascii::toUpperCase))
.expect("A", "B", "C", "D", "E");
}
代码示例来源:origin: google/guava
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');
}
代码示例来源:origin: net.automatalib/automata-api
@Override
@SuppressWarnings("unchecked")
public Spliterator<I> spliterator() {
return Arrays.spliterator((I[]) storage, offset, offset + length);
}
代码示例来源:origin: net.automatalib/automata-util
/**
* 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);
}
代码示例来源:origin: LearnLib/automatalib
/**
* 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);
}
代码示例来源:origin: eu.fbk.pikes/pikes-naflib
@Override
public Spliterator<Path> spliterator() {
return Arrays.spliterator(Corpus.this.files);
}
代码示例来源:origin: LearnLib/automatalib
@Override
public Spliterator<I> spliterator() {
return Arrays.spliterator(storage, offset, offset + length);
}
代码示例来源:origin: stackoverflow.com
static <T> Stream<T> getStream(CompletableFuture<T[]> resp) {
return StreamSupport.stream(() -> Arrays.spliterator(resp.join()),
Spliterator.ORDERED|Spliterator.SIZED|Spliterator.SUBSIZED|Spliterator.IMMUTABLE,
false);
}
代码示例来源:origin: org.eclipse.jetty/jetty-http
public Stream<HttpField> stream()
{
return StreamSupport.stream(Arrays.spliterator(_fields,0,_size),false);
}
代码示例来源:origin: jenkinsci/winstone
public Stream<HttpField> stream()
{
return StreamSupport.stream(Arrays.spliterator(_fields,0,_size),false);
}
代码示例来源:origin: hypercube1024/firefly
public Stream<HttpField> stream() {
return StreamSupport.stream(Arrays.spliterator(_fields, 0, _size), false);
}
代码示例来源:origin: one.util/streamex
/**
* 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));
}
代码示例来源:origin: one.util/streamex
/**
* 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));
}
代码示例来源:origin: com.atlassian.plugins.test/atlassian-plugins-test
@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);
}
代码示例来源:origin: one.util/streamex
/**
* 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));
}
代码示例来源:origin: eu.fbk.pikes/pikes-naflib
@Override
public Spliterator<KAFDocument> spliterator() {
return spliteratorHelper(Arrays.spliterator(this.files));
}
代码示例来源:origin: batfish/batfish
/** Set-theoretic intersection of multiple IpSpaces */
public static @Nullable IpSpace intersection(IpSpace... ipSpaces) {
return intersection(Arrays.spliterator(ipSpaces));
}
代码示例来源:origin: lesfurets/dOOv
@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);
}
代码示例来源:origin: com.google.guava/guava-tests
public void testMap() {
SpliteratorTester.of(
()
-> CollectSpliterators.map(
Arrays.spliterator(new String[] {"a", "b", "c", "d", "e"}), Ascii::toUpperCase))
.expect("A", "B", "C", "D", "E");
}
代码示例来源:origin: com.google.guava/guava-tests
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');
}
内容来源于网络,如有侵权,请联系作者删除!