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


Java MutableInt.decrement方法代碼示例

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


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

示例1: collectTerm

import org.apache.commons.lang.mutable.MutableInt; //導入方法依賴的package包/類
private void collectTerm(int fieldId,
    MiruTermId termId,
    boolean fieldTermIn,
    List<MiruTermId> fieldTermIds,
    Map<FieldAndTermId, MutableInt> termCollector) throws Exception {

    fieldTermIds.add(termId);

    if (termCollector != null) {
        MutableInt count = termCollector.computeIfAbsent(new FieldAndTermId(fieldId, termId), key -> new MutableInt());
        if (fieldTermIn) {
            count.increment();
        } else {
            count.decrement();
        }
    }
}
 
開發者ID:jivesoftware,項目名稱:miru,代碼行數:18,代碼來源:MiruAggregateUtil.java

示例2: run

import org.apache.commons.lang.mutable.MutableInt; //導入方法依賴的package包/類
@Override
public void run() {
    //let the players update smoother
    int remainingUpdates = getNextUpdates();
    for (Map.Entry<Player, MutableInt> entry : queue.entrySet()) {
        Player player = entry.getKey();
        MutableInt remainingTicks = entry.getValue();
        if (remainingTicks.intValue() == 0) {
            if (remainingUpdates != 0) {
                //Smoother refreshing; limit the updates
                plugin.getScoreboardManager().onUpdate(player);
                remainingTicks.setValue(20 * Settings.getInterval());
                remainingUpdates--;
            }
        } else {
            remainingTicks.decrement();
        }
    }

    nextGlobalUpdate--;
    if (nextGlobalUpdate == 0) {
        nextGlobalUpdate = 20 * Settings.getInterval();
        //update globals
        plugin.getReplaceManager().updateGlobals();
    }
}
 
開發者ID:games647,項目名稱:ScoreboardStats,代碼行數:27,代碼來源:RefreshTask.java

示例3: enableBehaviour

import org.apache.commons.lang.mutable.MutableInt; //導入方法依賴的package包/類
@Override
public void enableBehaviour(NodeRef nodeRef)
{
    ParameterCheck.mandatory("nodeRef",  nodeRef);
    
    if (logger.isDebugEnabled())
    {
        logger.debug("Behaviour: ENABLE (" + AlfrescoTransactionSupport.getTransactionId() + "): " + nodeRef + "/ALL");
    }
    
    TransactionalResourceHelper.decrementCount(KEY_FILTER_COUNT, false);
    
    if (!TransactionalResourceHelper.isResourcePresent(KEY_INSTANCE_FILTERS))
    {
        // Nothing was disabled
        return;
    }
    nodeRef = tenantService.getName(nodeRef);

    Map<NodeRef, MutableInt> instanceFilters = TransactionalResourceHelper.getMap(KEY_INSTANCE_FILTERS);
    MutableInt filter = instanceFilters.get(nodeRef);
    if (filter == null)
    {
        // Instance was not disabled
        return;
    }
    else if (filter.intValue() <= 0)
    {
        // Can't go below zero for this
    }
    else
    {
        filter.decrement();
    }
    
    if (logger.isDebugEnabled())
    {
        logger.debug("   Now:" + filter);
    }
}
 
開發者ID:Alfresco,項目名稱:alfresco-repository,代碼行數:41,代碼來源:BehaviourFilterImpl.java

示例4: decrement

import org.apache.commons.lang.mutable.MutableInt; //導入方法依賴的package包/類
private boolean decrement(Map<Object, MutableInt> map, Object obj) {
    MutableInt i = map.get(obj);
    if(i == null) {
        return false;
    }

    i.decrement();

    if(i.intValue() == 0) {
        map.remove(obj);
    }

    return true;
}
 
開發者ID:Netflix,項目名稱:zeno,代碼行數:15,代碼來源:TypeDiffOperation.java

示例5: decrVertexTaskCount

import org.apache.commons.lang.mutable.MutableInt; //導入方法依賴的package包/類
private void decrVertexTaskCount(Priority priority, RequestPriorityStats stats, int vertexIndex) {
  Integer vertexIndexInt = vertexIndex;
  MutableInt taskCount = stats.vertexTaskCount.get(vertexIndexInt);
  taskCount.decrement();
  if (taskCount.intValue() <= 0) {
    removeVertexFromRequestStats(priority, stats, vertexIndexInt);
  }
}
 
開發者ID:apache,項目名稱:tez,代碼行數:9,代碼來源:DagAwareYarnTaskScheduler.java


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