コード例 #1
0
 @Override
 public ScoredCandidates<Container> generate(Container content, ResultDescription desc) {
   OptionalMap<String, EquivalenceSummary> childSummaries =
       summaryStore.summariesForUris(Iterables.transform(content.getChildRefs(), ChildRef.TO_URI));
   Multiset<String> parents = HashMultiset.create();
   for (EquivalenceSummary summary : Optional.presentInstances(childSummaries.values())) {
     Iterables.addAll(
         parents,
         Iterables.filter(
             Iterables.transform(summary.getEquivalents().values(), TO_PARENT),
             Predicates.notNull()));
   }
   return scoreContainers(parents, childSummaries.size(), desc);
 }
コード例 #2
0
ファイル: Args.java プロジェクト: billwei/commons
 private static Iterable<Field> filterFields(Iterable<ArgInfo> infos, Predicate<Field> filter) {
   return Iterables.filter(
       Optional.presentInstances(Iterables.transform(infos, TO_FIELD)), filter);
 }