public IIndexFile[] getFiles(IIndexFileLocation location) throws CoreException { if (location == null) { return IIndexFile.EMPTY_FILE_ARRAY; } Set<FileContentKey> keys = new HashSet<FileContentKey>(); ArrayList<IIndexFragmentFile> result = new ArrayList<IIndexFragmentFile>(); for (int i = 0; i < fPrimaryFragmentCount; i++) { IIndexFragmentFile[] candidates = fFragments[i].getFiles(location); for (IIndexFragmentFile candidate : candidates) { if (candidate.hasContent()) { if (keys.add( new FileContentKey( candidate.getLinkageID(), candidate.getLocation(), candidate.getSignificantMacros()))) { result.add(candidate); } } } } if (result.isEmpty()) { return IIndexFile.EMPTY_FILE_ARRAY; } return result.toArray(new IIndexFile[result.size()]); }
@Deprecated public IIndexFile getFile(int linkageID, IIndexFileLocation location) throws CoreException { for (int i = 0; i < fPrimaryFragmentCount; i++) { IIndexFragmentFile candidate = fFragments[i].getFile(linkageID, location); if (candidate != null && candidate.hasContent()) { return candidate; } } return null; }
public IIndexFile[] getAllFiles() throws CoreException { HashMap<IIndexFileLocation, IIndexFile> result = new HashMap<IIndexFileLocation, IIndexFile>(); for (IIndexFragment fragment : fFragments) { for (IIndexFragmentFile file : fragment.getAllFiles()) { if (file.hasContent()) { result.put(file.getLocation(), file); } } } return result.values().toArray(new IIndexFile[result.size()]); }
public IIndexFile resolveInclude(IIndexInclude include) throws CoreException { IIndexFragmentInclude fragmentInclude = (IIndexFragmentInclude) include; IIndexFragmentFile result = fragmentInclude.getIncludes(); if (result == null) return null; if (result.hasContent()) { return result; } return getFile(result.getLinkageID(), result.getLocation(), result.getSignificantMacros()); }
public IIndexFile[] getFiles(int linkageID, IIndexFileLocation location) throws CoreException { if (location == null) { return IIndexFile.EMPTY_FILE_ARRAY; } Set<ISignificantMacros> handled = new HashSet<ISignificantMacros>(); ArrayList<IIndexFragmentFile> result = new ArrayList<IIndexFragmentFile>(); for (int i = 0; i < fPrimaryFragmentCount; i++) { IIndexFragmentFile[] candidates = fFragments[i].getFiles(linkageID, location); for (IIndexFragmentFile candidate : candidates) { if (candidate.hasContent()) { ISignificantMacros macroKey = candidate.getSignificantMacros(); if (handled.add(macroKey)) { result.add(candidate); } } } } if (result.isEmpty()) { return IIndexFile.EMPTY_FILE_ARRAY; } return result.toArray(new IIndexFile[result.size()]); }