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


Java ImmutableMap.values方法代码示例

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


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

示例1: isFieldMappingMissingField

import com.google.common.collect.ImmutableMap; //导入方法依赖的package包/类
/**
 * Helper method to find out if the only included fieldmapping metadata is typed NULL, which means
 * that type and index exist, but the field did not
 */
private boolean isFieldMappingMissingField(ImmutableMap<String, ImmutableMap<String, ImmutableMap<String, FieldMappingMetaData>>> mappingsByIndex) throws IOException {
    if (mappingsByIndex.size() != 1) {
        return false;
    }

    for (ImmutableMap<String, ImmutableMap<String, FieldMappingMetaData>> value : mappingsByIndex.values()) {
        for (ImmutableMap<String, FieldMappingMetaData> fieldValue : value.values()) {
            for (Map.Entry<String, FieldMappingMetaData> fieldMappingMetaDataEntry : fieldValue.entrySet()) {
                if (fieldMappingMetaDataEntry.getValue().isNull()) {
                    return true;
                }
            }
        }
    }
    return false;
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:21,代码来源:RestGetFieldMappingAction.java

示例2: writeBootstrappedOutput

import com.google.common.collect.ImmutableMap; //导入方法依赖的package包/类
private void writeBootstrappedOutput(final List<EALScorer2015Style.Result> perDocResults,
    final File baseOutputDir) throws IOException {
  if (doBootstrapping) {
    // boostrapped result writers are stateful, so we need to get new ones each time
    final ImmutableMap.Builder<String, BootstrappedResultWriter> builder = ImmutableMap.builder();
    for (final Map.Entry<String, BootstrappedResultWriterSource> source : bootstrappedResultWriterSources
        .entrySet()) {
      builder.put(source.getKey(), source.getValue().getResultWriter());
    }
    final ImmutableMap<String, BootstrappedResultWriter> bootstrappedWriters = builder.build();

    // this will produce an infinite sequence of bootstrapped samples of the corpus
    final Iterator<Collection<EALScorer2015Style.Result>>
        bootstrapIt = BootstrapIterator.forData(perDocResults, new Random(bootstrapSeed));
    // a bootstrap iterator always has .next()
    for (int i = 0; i < numBootstrapSamples; ++i) {
      // be sure to use the same sample for all observers
      final Collection<EALScorer2015Style.Result> sample = bootstrapIt.next();
      for (final KBP2015Scorer.BootstrappedResultWriter bootstrappedResultWriter : bootstrappedWriters
          .values()) {
        bootstrappedResultWriter.observeSample(sample);
      }
    }

    for (final Map.Entry<String, BootstrappedResultWriter> resultWriterEntry : bootstrappedWriters
        .entrySet()) {
      final File outputDir = new File(baseOutputDir, resultWriterEntry.getKey());
      outputDir.mkdirs();
      resultWriterEntry.getValue().writeResult(outputDir);
    }
  }
}
 
开发者ID:isi-nlp,项目名称:tac-kbp-eal,代码行数:33,代码来源:KBP2015Scorer.java

示例3: buildQuads

import com.google.common.collect.ImmutableMap; //导入方法依赖的package包/类
private static ImmutableList<BakedQuad> buildQuads(ImmutableMap<Optional<BlockRenderLayer>, IBakedModel> models, Optional<EnumFacing> side)
{
    ImmutableList.Builder<BakedQuad> builder = ImmutableList.builder();
    for(IBakedModel model : models.values())
    {
        builder.addAll(model.getQuads(null, side.orNull(), 0));
    }
    return builder.build();
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:10,代码来源:MultiLayerModel.java


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