当前位置: 首页>>代码示例>>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;未经允许,请勿转载。