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


Java AtomicLong.longValue方法代碼示例

本文整理匯總了Java中java.util.concurrent.atomic.AtomicLong.longValue方法的典型用法代碼示例。如果您正苦於以下問題:Java AtomicLong.longValue方法的具體用法?Java AtomicLong.longValue怎麽用?Java AtomicLong.longValue使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在java.util.concurrent.atomic.AtomicLong的用法示例。


在下文中一共展示了AtomicLong.longValue方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: highestStampForDir

import java.util.concurrent.atomic.AtomicLong; //導入方法依賴的package包/類
private static boolean highestStampForDir(File file, AtomicReference<File> newestFile, AtomicLong result, AtomicInteger crc) {
    if (file.getName().equals(".nbattrs")) { // NOI18N
        return true;
    }

    File[] children = file.listFiles();
    if (children == null) {
        if (crc != null) {
            crc.addAndGet(file.getName().length());
        }
        long time = file.lastModified();
        if (time > result.longValue()) {
            newestFile.set(file);
            result.set(time);
        }
        return false;
    }
    
    for (File f : children) {
        highestStampForDir(f, newestFile, result, crc);
    }
    return true;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:24,代碼來源:Stamps.java

示例2: iterateTests

import java.util.concurrent.atomic.AtomicLong; //導入方法依賴的package包/類
private void iterateTests(TestResult result, StringBuffer times, TestSuite suite, AtomicLong min, AtomicLong max) {
    Enumeration en = suite.tests();
    while (en.hasMoreElements()) {
        Test t = (Test)en.nextElement();
        if (t instanceof Callable) {
            try {
                Long v = (Long)((Callable) t).call();
                long time = v.longValue();
                if (time < min.longValue()) {
                    min.set(time);
                }
                if (time > max.longValue()) {
                    max.set(time);
                }
                // append(t.toString()).append(" value: ")
                times.append("Run: ").append(v).append('\n');
            } catch (Exception ex) {
                result.addError(this, ex);
            }
        }
        if (t instanceof TestSuite) {
            iterateTests(result, times, (TestSuite)t, min, max);
        }
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:26,代碼來源:ExpandFolderTest.java

示例3: run

import java.util.concurrent.atomic.AtomicLong; //導入方法依賴的package包/類
@Override
public void run(TestResult result) {
    result.startTest(this);
    StringBuffer times = new StringBuffer("\n");
    AtomicLong min = new AtomicLong(Long.MAX_VALUE);
    AtomicLong max = new AtomicLong(Long.MIN_VALUE);
    iterateTests(result, times, suite, min, max);
    
    System.err.println(times.toString());
    
    if (max.longValue() > 3 * min.longValue()) {
        result.addFailure(this, new AssertionFailedError(times.toString()));
    }
    result.endTest(this);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:16,代碼來源:ExpandFolderTest.java

示例4: getImportsHashCodeForRoots

import java.util.concurrent.atomic.AtomicLong; //導入方法依賴的package包/類
public static long getImportsHashCodeForRoots(Collection<FileObject> roots) {
    long hash = 5;
    for(FileObject root : roots) {
        AtomicLong rootHash = computedImportsHashCodes.get(root);
        if(rootHash != null) {
            hash = hash * 51 + rootHash.longValue();
        }
    }
    return hash;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:11,代碼來源:CssIndexer.java

示例5: findMatchStatement

import java.util.concurrent.atomic.AtomicLong; //導入方法依賴的package包/類
public static QLMatchResult findMatchStatement(INodeTypeManager aManager,QLPatternNode pattern ,List<? extends IDataNode> nodes,int point) throws Exception{
	AtomicLong maxMatchPoint = new AtomicLong();
	QLMatchResult result = findMatchStatementWithAddRoot(aManager,pattern,nodes,point,true,maxMatchPoint);
	if(result == null || result.matchs.size() == 0){
		throw new Exception("程序錯誤,不滿足語法規範,沒有匹配到合適的語法,最大匹配致[0:" + (maxMatchPoint.longValue()-1) +"]");
	}else if(result != null && result.matchs.size() != 1){
		throw new Exception("程序錯誤,不滿足語法規範,必須有一個根節點:" + pattern + ",最大匹配致[0:" + (maxMatchPoint.longValue()-1) +"]");
	}
	return result;
}
 
開發者ID:alibaba,項目名稱:QLExpress,代碼行數:11,代碼來源:QLPattern.java

示例6: newLinearId

import java.util.concurrent.atomic.AtomicLong; //導入方法依賴的package包/類
/**
 * Creates new linear identification number from the provided parameter.
 * <p>
 * Used for session scope and router scope ids
 *
 * @param longValue start address of the identification number. Next number will be
 * this value plus 1
 * @return new id
 */
public static long newLinearId(AtomicLong longValue) {
	long candiateId = longValue.incrementAndGet();
	if (candiateId > IdGenerator.MAX) {
		longValue.set(1L);
		candiateId = longValue.longValue();
	}
	return candiateId;
}
 
開發者ID:ralscha,項目名稱:wamp2spring,代碼行數:18,代碼來源:IdGenerator.java


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