java.util.Set.spliterator()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(5.4k)|赞(0)|评价(0)|浏览(245)

本文整理了Java中java.util.Set.spliterator()方法的一些代码示例,展示了Set.spliterator()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Set.spliterator()方法的具体详情如下:
包路径:java.util.Set
类名称:Set
方法名:spliterator

Set.spliterator介绍

暂无

代码示例

代码示例来源:origin: google/guava

@Override
public Spliterator<E> spliterator() {
 return Collections.singleton(element).spliterator();
}

代码示例来源:origin: prestodb/presto

@Override
public Spliterator<E> spliterator() {
 return Collections.singleton(element).spliterator();
}

代码示例来源:origin: google/guava

@Override
Spliterator<K> keySpliterator() {
 return delegate.keySet().spliterator();
}

代码示例来源:origin: google/guava

@Override
Spliterator<Entry<K, V>> entrySpliterator() {
 return CollectSpliterators.map(delegate.entrySet().spliterator(), Maps::unmodifiableEntry);
}

代码示例来源:origin: google/guava

@Override
Spliterator<Cell<R, C, V>> cellSpliterator() {
 return CollectSpliterators.flatMap(
   backingMap.entrySet().spliterator(),
   (Entry<R, Map<C, V>> rowEntry) ->
     CollectSpliterators.map(
       rowEntry.getValue().entrySet().spliterator(),
       (Entry<C, V> columnEntry) ->
         Tables.immutableCell(
           rowEntry.getKey(), columnEntry.getKey(), columnEntry.getValue())),
   Spliterator.DISTINCT | Spliterator.SIZED,
   size());
}

代码示例来源:origin: prestodb/presto

@Override
Spliterator<Entry<K, V>> entrySpliterator() {
 return CollectSpliterators.map(delegate.entrySet().spliterator(), Maps::unmodifiableEntry);
}

代码示例来源:origin: google/guava

@Override
Spliterator<Entry<K, V2>> entrySpliterator() {
 return CollectSpliterators.map(
   fromMap.entrySet().spliterator(), Maps.<K, V1, V2>asEntryToEntryFunction(transformer));
}

代码示例来源:origin: prestodb/presto

@Override
Spliterator<K> keySpliterator() {
 return delegate.keySet().spliterator();
}

代码示例来源:origin: google/guava

@Override
public Spliterator<Entry<Class<? extends B>, B>> spliterator() {
 return CollectSpliterators.map(
   delegate().spliterator(), MutableClassToInstanceMap::checkedEntry);
}

代码示例来源:origin: google/guava

@SuppressWarnings("unchecked")
 @Override
 Spliterator<Cell<C, R, V>> cellSpliterator() {
  return CollectSpliterators.map(original.cellSet().spliterator(), (Function) TRANSPOSE_CELL);
 }
}

代码示例来源:origin: google/guava

@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(), (V value) -> Maps.immutableEntry(key, value));
   },
   Spliterator.SIZED,
   size());
}

代码示例来源:origin: prestodb/presto

@Override
Spliterator<Cell<R, C, V>> cellSpliterator() {
 return CollectSpliterators.flatMap(
   backingMap.entrySet().spliterator(),
   (Entry<R, Map<C, V>> rowEntry) ->
     CollectSpliterators.map(
       rowEntry.getValue().entrySet().spliterator(),
       (Entry<C, V> columnEntry) ->
         Tables.immutableCell(
           rowEntry.getKey(), columnEntry.getKey(), columnEntry.getValue())),
   Spliterator.DISTINCT | Spliterator.SIZED,
   size());
}

代码示例来源:origin: prestodb/presto

@Override
Spliterator<Entry<K, V2>> entrySpliterator() {
 return CollectSpliterators.map(
   fromMap.entrySet().spliterator(), Maps.<K, V1, V2>asEntryToEntryFunction(transformer));
}

代码示例来源:origin: prestodb/presto

@Override
public Spliterator<Entry<Class<? extends B>, B>> spliterator() {
 return CollectSpliterators.map(
   delegate().spliterator(), MutableClassToInstanceMap::checkedEntry);
}

代码示例来源:origin: prestodb/presto

@SuppressWarnings("unchecked")
 @Override
 Spliterator<Cell<C, R, V>> cellSpliterator() {
  return CollectSpliterators.map(original.cellSet().spliterator(), (Function) TRANSPOSE_CELL);
 }
}

代码示例来源:origin: google/guava

@Override
Spliterator<Cell<R, C, V2>> cellSpliterator() {
 return CollectSpliterators.map(fromTable.cellSet().spliterator(), cellFunction());
}

代码示例来源:origin: prestodb/presto

@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(), (V value) -> Maps.immutableEntry(key, value));
   },
   Spliterator.SIZED,
   size());
}

代码示例来源:origin: prestodb/presto

@Override
Spliterator<Cell<R, C, V2>> cellSpliterator() {
 return CollectSpliterators.map(fromTable.cellSet().spliterator(), cellFunction());
}

代码示例来源:origin: google/guava

static <E> Spliterator<E> spliteratorImpl(Multiset<E> multiset) {
 Spliterator<Entry<E>> entrySpliterator = multiset.entrySet().spliterator();
 return CollectSpliterators.flatMap(
   entrySpliterator,
   entry -> Collections.nCopies(entry.getCount(), entry.getElement()).spliterator(),
   Spliterator.SIZED
     | (entrySpliterator.characteristics()
       & (Spliterator.ORDERED | Spliterator.NONNULL | Spliterator.IMMUTABLE)),
   multiset.size());
}

代码示例来源:origin: prestodb/presto

static <E> Spliterator<E> spliteratorImpl(Multiset<E> multiset) {
 Spliterator<Entry<E>> entrySpliterator = multiset.entrySet().spliterator();
 return CollectSpliterators.flatMap(
   entrySpliterator,
   entry -> Collections.nCopies(entry.getCount(), entry.getElement()).spliterator(),
   Spliterator.SIZED
     | (entrySpliterator.characteristics()
       & (Spliterator.ORDERED | Spliterator.NONNULL | Spliterator.IMMUTABLE)),
   multiset.size());
}

相关文章