public StructureFilter() { myMap = AreaMap.create( new PairProcessor<String, String>() { public boolean process(final String candidate, final String key) { return key.startsWith(candidate); } }); myMemoryFilter = new MemoryFilter() { public boolean applyInMemory(GitHeavyCommit commit) { if (myMap.isEmpty()) return true; final List<FilePath> pathList = commit.getPathsList(); final Ref<Boolean> found = new Ref<Boolean>(); for (FilePath filePath : pathList) { myMap.getSimiliar( FilePathsHelper.convertWithLastSeparator(filePath), new PairProcessor<String, VirtualFile>() { public boolean process(String s, VirtualFile virtualFile) { found.set(true); // take only first.. should be only first return true; } }); if (Boolean.TRUE.equals(found.get())) break; } return Boolean.TRUE.equals(found.get()); } }; }
public boolean isEmpty() { return myMap.isEmpty(); }
public void removePath(final VirtualFile vf) { myMap.removeByValue(vf); }
public boolean containsFile(final VirtualFile vf) { return myMap.contains(FilePathsHelper.convertWithLastSeparator(vf)); }
public void addFiles(final Collection<VirtualFile> files) { for (VirtualFile file : files) { myMap.put(FilePathsHelper.convertWithLastSeparator(file), file); } }