Esempio n. 1
0
 @Override
 @NotNull
 public Map<TodoIndexEntry, Integer> map(final FileContent inputData) {
   final VirtualFile file = inputData.getFile();
   final DataIndexer<TodoIndexEntry, Integer, FileContent> indexer =
       IdTableBuilding.getTodoIndexer(inputData.getFileType(), file);
   if (indexer != null) {
     return indexer.map(inputData);
   }
   return Collections.emptyMap();
 }
 @NotNull
 @Override
 public Map<TodoIndexEntry, Integer> map(@NotNull FileContent inputData) {
   Map<TodoIndexEntry, Integer> result = ContainerUtil.newTroveMap();
   for (DataIndexer<TodoIndexEntry, Integer, FileContent> indexer : indexers) {
     for (Map.Entry<TodoIndexEntry, Integer> entry : indexer.map(inputData).entrySet()) {
       TodoIndexEntry key = entry.getKey();
       if (result.containsKey(key)) {
         result.put(key, result.get(key) + entry.getValue());
       } else {
         result.put(key, entry.getValue());
       }
     }
   }
   return result;
 }