當前位置: 首頁>>代碼示例>>Java>>正文


Java IIndexFileLocation類代碼示例

本文整理匯總了Java中org.eclipse.cdt.core.index.IIndexFileLocation的典型用法代碼示例。如果您正苦於以下問題:Java IIndexFileLocation類的具體用法?Java IIndexFileLocation怎麽用?Java IIndexFileLocation使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


IIndexFileLocation類屬於org.eclipse.cdt.core.index包,在下文中一共展示了IIndexFileLocation類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: waitUntilFileIsIndexed

import org.eclipse.cdt.core.index.IIndexFileLocation; //導入依賴的package包/類
/**
 * Waits until the given file is indexed. Fails if this does not happen within the
 * given time.
 *
 * @param file
 * @param maxmillis
 * @throws Exception
 * @since 4.0
 */
public static void waitUntilFileIsIndexed(IIndex index, IFile file, int maxmillis) throws Exception {
    long fileTimestamp = file.getLocalTimeStamp();
    IIndexFileLocation indexFileLocation = IndexLocationFactory.getWorkspaceIFL(file);

    long endTime = System.currentTimeMillis() + maxmillis;
    int timeLeft = maxmillis;
    while (timeLeft >= 0) {
        Assert.assertTrue(CCorePlugin.getIndexManager().joinIndexer(timeLeft, new NullProgressMonitor()));
        index.acquireReadLock();
        try {
            IIndexFile[] files = index.getFiles(ILinkage.CPP_LINKAGE_ID, indexFileLocation);
            if (files.length > 0 && areAllFilesNotOlderThan(files, fileTimestamp)) {
                Assert.assertTrue(CCorePlugin.getIndexManager().joinIndexer(timeLeft, new NullProgressMonitor()));
                return;
            }
            files = index.getFiles(ILinkage.C_LINKAGE_ID, indexFileLocation);
            if (files.length > 0 && areAllFilesNotOlderThan(files, fileTimestamp)) {
                Assert.assertTrue(CCorePlugin.getIndexManager().joinIndexer(timeLeft, new NullProgressMonitor()));
                return;
            }
        } finally {
            index.releaseReadLock();
        }

        Thread.sleep(50);
        timeLeft = (int) (endTime - System.currentTimeMillis());
    }
    Assert.fail("Indexing of " + file.getFullPath() + " did not complete in " + maxmillis / 1000. + " sec");
}
 
開發者ID:magicsky,項目名稱:sya,代碼行數:39,代碼來源:TestSourceReader.java

示例2: get

import org.eclipse.cdt.core.index.IIndexFileLocation; //導入依賴的package包/類
@Override
public CodeReader get(String string, IIndexFileLocation iifl) throws CoreException, IOException {
    throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
 
開發者ID:dheraclio,項目名稱:dependometer,代碼行數:5,代碼來源:FileCodeReaderFactory.java


注:本文中的org.eclipse.cdt.core.index.IIndexFileLocation類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。