scala.collection.Iterator.filter()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(1.2k)|赞(0)|评价(0)|浏览(177)

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

Iterator.filter介绍

暂无

代码示例

代码示例来源:origin: org.locationtech.geomesa/geomesa-cqengine

private scala.collection.Iterator<SimpleFeature> getSimpleFeatureIteratorInternal(Intersects query,
                                         final QueryOptions queryOptions) {
  final Intersects intersects = query;
  Envelope queryEnvelope = intersects.getEnvelope();
  return index.query(queryEnvelope).filter(new AbstractFunction1<SimpleFeature, Object>() {
    @Override
    public Object apply(SimpleFeature feature) {
      try {
        Geometry geom = (Geometry) feature.getAttribute(geomAttributeIndex);
        return intersects.matchesValue(geom, queryOptions);
      } catch (Exception e) {
        LOGGER.warn("Caught exception while trying to look up geometry", e);
        return false;
      }
    }
  });
}

代码示例来源:origin: uk.gov.gchq.gaffer/spark-accumulo-library

@Override
  public Iterator<Element> apply(final Iterator<Map.Entry<Key, Value>> entryIterator) {
    final EntryToElement entryToElement = new EntryToElement(serialisedConf);
    return entryIterator
        .map(entryToElement)
        .filter(new FilterOutNull());
  }
}

相关文章