当前位置: 首页>>代码示例>>Java>>正文


Java FluentIterable.toList方法代码示例

本文整理汇总了Java中com.google.common.collect.FluentIterable.toList方法的典型用法代码示例。如果您正苦于以下问题:Java FluentIterable.toList方法的具体用法?Java FluentIterable.toList怎么用?Java FluentIterable.toList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.common.collect.FluentIterable的用法示例。


在下文中一共展示了FluentIterable.toList方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: includedTypes

import com.google.common.collect.FluentIterable; //导入方法依赖的package包/类
@Value.Lazy
List<TypeElement> includedTypes() {
  Optional<IncludeMirror> includes = include();

  ImmutableList<TypeMirror> typeMirrors = includes.isPresent()
      ? ImmutableList.copyOf(includes.get().valueMirror())
      : ImmutableList.<TypeMirror>of();

  FluentIterable<TypeElement> typeElements = FluentIterable.from(typeMirrors)
      .filter(DeclaredType.class)
      .transform(DeclatedTypeToElement.FUNCTION);

  ImmutableSet<String> uniqueTypeNames = typeElements
      .filter(IsPublic.PREDICATE)
      .transform(ElementToName.FUNCTION)
      .toSet();

  if (uniqueTypeNames.size() != typeMirrors.size()) {
    report().annotationNamed(IncludeMirror.simpleName())
        .warning("Some types were ignored, non-supported for inclusion: duplicates,"
            + " non declared reference types, non-public");
  }

  return typeElements.toList();
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:26,代码来源:Proto.java

示例2: builderIncludedTypes

import com.google.common.collect.FluentIterable; //导入方法依赖的package包/类
@Value.Lazy
List<TypeElement> builderIncludedTypes() {
  Optional<FIncludeMirror> includes = builderInclude();

  ImmutableList<TypeMirror> typeMirrors = includes.isPresent()
      ? ImmutableList.copyOf(includes.get().valueMirror())
      : ImmutableList.<TypeMirror>of();

  FluentIterable<TypeElement> typeElements = FluentIterable.from(typeMirrors)
      .filter(DeclaredType.class)
      .transform(DeclatedTypeToElement.FUNCTION);

  ImmutableSet<String> uniqueTypeNames = typeElements
      .filter(IsPublic.PREDICATE)
      .transform(ElementToName.FUNCTION)
      .toSet();

  if (uniqueTypeNames.size() != typeMirrors.size()) {
    report().annotationNamed(IncludeMirror.simpleName())
        .warning("Some types were ignored, non-supported for inclusion: duplicates,"
            + " non declared reference types, non-public");
  }

  return typeElements.toList();
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:26,代码来源:Proto.java

示例3: create

import com.google.common.collect.FluentIterable; //导入方法依赖的package包/类
@Override
public ProducerOperator create(FragmentExecutionContext fragmentExecContext, final OperatorContext context, EasySubScan config) throws ExecutionSetupException {
  final FileSystemStoragePlugin2 registry = (FileSystemStoragePlugin2) fragmentExecContext.getStoragePlugin(config.getPluginId());
  final FileSystemPlugin fsPlugin = registry.getFsPlugin();

  final FileSystemWrapper fs = registry.getFs();
  final FormatPluginConfig formatConfig = PhysicalDatasetUtils.toFormatPlugin(config.getFileConfig(), Collections.<String>emptyList());
  final EasyFormatPlugin<?> formatPlugin = (EasyFormatPlugin<?>)fsPlugin.getFormatPlugin(formatConfig);

  //final ImplicitFilesystemColumnFinder explorer = new ImplicitFilesystemColumnFinder(context.getOptions(), fs, config.getColumns());

  FluentIterable<SplitAndExtended> unorderedWork = FluentIterable.from(config.getSplits())
    .transform(new Function<DatasetSplit, SplitAndExtended>() {
      @Override
      public SplitAndExtended apply(DatasetSplit split) {
        return new SplitAndExtended(split);
      }
    });

  final boolean sortReaders = context.getOptions().getOption(ExecConstants.SORT_FILE_BLOCKS);
  final List<SplitAndExtended> workList = sortReaders ?  unorderedWork.toSortedList(SPLIT_COMPARATOR) : unorderedWork.toList();
  final boolean selectAllColumns = selectsAllColumns(config.getSchema(), config.getColumns());
  final CompositeReaderConfig readerConfig = CompositeReaderConfig.getCompound(config.getSchema(), config.getColumns(), config.getPartitionColumns());
  final List<SchemaPath> innerFields = selectAllColumns ? ImmutableList.of(ColumnUtils.STAR_COLUMN) : readerConfig.getInnerColumns();

  FluentIterable<RecordReader> readers = FluentIterable.from(workList).transform(new Function<SplitAndExtended, RecordReader>() {
    @Override
    public RecordReader apply(SplitAndExtended input) {
      try {
        RecordReader inner = formatPlugin.getRecordReader(context, fs, input.getExtended(), innerFields);
        return readerConfig.wrapIfNecessary(context.getAllocator(), inner, input.getSplit());
      } catch (ExecutionSetupException e) {
        throw new RuntimeException(e);
      }
    }});

  return new ScanOperator(fragmentExecContext.getSchemaUpdater(), config, context, readers.iterator());
}
 
开发者ID:dremio,项目名称:dremio-oss,代码行数:39,代码来源:EasyScanOperatorCreator.java

示例4: findDuplicates

import com.google.common.collect.FluentIterable; //导入方法依赖的package包/类
public Collection<Node> findDuplicates() {
  FluentIterable<Node> duplicates = FluentIterable.from(getConflictingChildren());
  for (Node child : children) {
    duplicates = duplicates.append(child.findDuplicates());
  }
  return duplicates.toList();
}
 
开发者ID:dremio,项目名称:dremio-oss,代码行数:8,代码来源:Node.java


注:本文中的com.google.common.collect.FluentIterable.toList方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。