本文整理匯總了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();
}
}
}
示例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();
}
}
示例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);
}
}
示例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;
}
示例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);
}
}