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