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


Java Functions.compose方法代码示例

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


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

示例1: createResponseMatchingStrategy

import com.google.common.base.Functions; //导入方法依赖的package包/类
private static ImmutableList<ResponseToEREAlignmentRule> createResponseMatchingStrategy(
    Optional<CoreNLPDocument> coreNLPDoc) {
  final ImmutableList.Builder<ResponseToEREAlignmentRule> ret = ImmutableList.builder();

  // if a CoreNLP analysis is available, we can use it to compute heads for both system and ERE
  // objects.
  final Function<Response, OffsetRange<CharOffset>> responseComputedHead;
  final Function<CandidateAlignmentTarget, OffsetRange<CharOffset>> ereComputedHead;
  if (coreNLPDoc.isPresent()) {
    final CoreNLPHeadExtractor coreNLPHeadExtractor = CoreNLPHeadExtractor.of(coreNLPDoc.get());
    responseComputedHead = Functions.compose(coreNLPHeadExtractor, CasExtractor.INSTANCE);
    ereComputedHead = Functions.compose(coreNLPHeadExtractor, ERE_HEAD_IF_DECLARED);
  } else {
    responseComputedHead = CasExtractor.INSTANCE;
    ereComputedHead = ERE_HEAD_IF_DECLARED;
  }

  ret.addAll(ImmutableList.of(
      // response CAS matches ERE extent exactly
      new SpansMatchExactly(CasExtractor.INSTANCE, offsets()),
      // response CAS matches ERE declared head exactly
      new SpansMatchExactly(CasExtractor.INSTANCE, ERE_HEAD_IF_DECLARED),
      // response CAS matches ERE computed head exactly
      new SpansMatchExactly(CasExtractor.INSTANCE, ereComputedHead),
      // response CAS head matches ERE extent exactly
      new SpansMatchExactly(responseComputedHead, offsets()),
      // response CAS head matches ERE declared head exactly
      new SpansMatchExactly(responseComputedHead, ERE_HEAD_IF_DECLARED),
      // response CAS head matches ERE computed head exactly
      new SpansMatchExactly(responseComputedHead, ereComputedHead),
      // finally we do a more aggressive alignment attempt by containment
      new ContainmentSpanChecker(CasExtractor.INSTANCE, responseComputedHead)
  ));
  return ret.build();
}
 
开发者ID:isi-nlp,项目名称:tac-kbp-eal,代码行数:36,代码来源:EREAligner.java

示例2: build

import com.google.common.base.Functions; //导入方法依赖的package包/类
public HiveDifferences build() {
  checkNotNull(diffListener, "diffListener is required");
  checkNotNull(comparatorRegistry, "comparatorRegistry is required");
  checkNotNull(sourceConfiguration, "sourceConfiguration is required");
  checkNotNull(sourceTable, "sourceTable is required");
  checkNotNull(sourcePartitionIterator, "sourcePartitionIterable is required");
  if (replicaTable.isPresent() && !replicaPartitionFetcher.isPresent()) {
    throw new IllegalStateException("replicaPartitionFetcher is required if replicaTable exists");
  }
  if (checksumFunction == null) {
    checksumFunction = Functions.compose(new PathDigest(), new PathToPathMetadata(sourceConfiguration));
  }
  return new HiveDifferences(comparatorRegistry, diffListener, sourceTable, sourcePartitionIterator, replicaTable,
      replicaPartitionFetcher, checksumFunction);
}
 
开发者ID:HotelsDotCom,项目名称:circus-train,代码行数:16,代码来源:HiveDifferences.java

示例3: InitializeRelyingPartyContext

import com.google.common.base.Functions; //导入方法依赖的package包/类
/** Constructor. */
public InitializeRelyingPartyContext() {
    relyingPartyContextCreationStrategy = new ChildContextLookup<>(RelyingPartyContext.class, true);
    oidcMetadataContextLookupStrategy = Functions.compose(new ChildContextLookup<>(OIDCMetadataContext.class),
            new InboundMessageContextLookup());
}
 
开发者ID:CSCfi,项目名称:shibboleth-idp-oidc-extension,代码行数:7,代码来源:InitializeRelyingPartyContext.java

示例4: AddClaimsToIDToken

import com.google.common.base.Functions; //导入方法依赖的package包/类
/** Constructor. */
AddClaimsToIDToken() {
    attributeContextLookupStrategy = Functions.compose(new ChildContextLookup<>(AttributeContext.class),
            new ChildContextLookup<ProfileRequestContext, RelyingPartyContext>(RelyingPartyContext.class));
}
 
开发者ID:CSCfi,项目名称:shibboleth-idp-oidc-extension,代码行数:6,代码来源:AddClaimsToIDToken.java

示例5: checksumFunction

import com.google.common.base.Functions; //导入方法依赖的package包/类
@Profile({ Modules.REPLICATION })
@Bean
Function<Path, String> checksumFunction(HiveConf sourceHiveConf) {
  return Functions.compose(new PathDigest(), new PathToPathMetadata(sourceHiveConf));
}
 
开发者ID:HotelsDotCom,项目名称:circus-train,代码行数:6,代码来源:CircusTrain.java


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