當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。