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


Java MutableInt.intValue方法代碼示例

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


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

示例1: getWord

import org.apache.commons.lang.mutable.MutableInt; //導入方法依賴的package包/類
private static String getWord(String line, MutableInt pos) {
	String word = "";
	boolean marker = false;
	boolean start = false;
	char ch;

	word = "";
	if (line.length() > 0) {
		do {
			ch = line.charAt(pos.intValue());
			start |=  ((ch != ' ') || (ch != '\t'));
			if (ch == '"') marker = !marker;

			if ((marker && start) || (start && (ch != ' ' && ch != '\t'))) {
				word += ch;
			}

			pos.increment();
		} while ((pos.intValue() < line.length()) && (marker || !start || (ch != ' ' && ch != '\t')));
	}

	if (word.length() == 0) word = null;
	return word;
}
 
開發者ID:ilsaul,項目名稱:PrisonArchitect-translation,代碼行數:25,代碼來源:Row.java

示例2: getAllFromPos

import org.apache.commons.lang.mutable.MutableInt; //導入方法依賴的package包/類
private String getAllFromPos(String line, MutableInt pos) {
	String word = "";
	boolean start = false;
	char ch;

	word = "";
	if (line.length() > 0) {
		do {
			ch = line.charAt(pos.intValue());
			start |=  ((ch != ' ') && (ch != '\t'));

			if (start || (ch != ' ' && ch != '\t')) {
				if (startValue == 0) startValue = pos.intValue();
				word += ch;
			}

			pos.increment();
		} while (pos.intValue() < line.length());

		endValue = pos.intValue();
	}

	if (word.length() == 0) word = null;
	return word;
}
 
開發者ID:ilsaul,項目名稱:PrisonArchitect-translation,代碼行數:26,代碼來源:Row.java

示例3: getNumFactTableInExpressions

import org.apache.commons.lang.mutable.MutableInt; //導入方法依賴的package包/類
/**
 * Get number of fact columns used in the an expression
 *
 * @param node
 * @param count
 * @return Number of fact columns used in expression
 */
protected int getNumFactTableInExpressions(ASTNode node, MutableInt count) {

  if (node == null) {
    log.debug("ASTNode is null ");
    return 0;
  }
  if (node.getToken().getType() == HiveParser.TOK_TABLE_OR_COL) {
    String factAlias = getFactAlias();
    String table = node.getChild(0).getText();
    if (table.equals(factAlias)) {
      count.add(1);
    }
  }
  for (int i = 0; i < node.getChildCount(); i++) {
    ASTNode child = (ASTNode) node.getChild(i);
    getNumFactTableInExpressions(child, count);
  }

  return count.intValue();
}
 
開發者ID:apache,項目名稱:lens,代碼行數:28,代碼來源:ColumnarSQLRewriter.java

示例4: traverseFilterQueryAndPopulateMap

import org.apache.commons.lang.mutable.MutableInt; //導入方法依賴的package包/類
private static FilterQuery traverseFilterQueryAndPopulateMap(FilterQueryTree tree,
    Map<Integer, FilterQuery> filterQueryMap, MutableInt currentId) {
  int currentNodeId = currentId.intValue();
  currentId.increment();

  final List<Integer> f = new ArrayList<Integer>();
  if (null != tree.getChildren()) {
    for (final FilterQueryTree c : tree.getChildren()) {
      int childNodeId = currentId.intValue();
      currentId.increment();

      f.add(childNodeId);
      final FilterQuery q = traverseFilterQueryAndPopulateMap(c, filterQueryMap, currentId);
      filterQueryMap.put(childNodeId, q);
    }
  }

  FilterQuery query = new FilterQuery();
  query.setColumn(tree.getColumn());
  query.setId(currentNodeId);
  query.setNestedFilterQueryIds(f);
  query.setOperator(tree.getOperator());
  query.setValue(tree.getValue());
  return query;
}
 
開發者ID:linkedin,項目名稱:pinot,代碼行數:26,代碼來源:RequestUtils.java

示例5: traverseHavingFilterQueryAndPopulateMap

import org.apache.commons.lang.mutable.MutableInt; //導入方法依賴的package包/類
private static HavingFilterQuery traverseHavingFilterQueryAndPopulateMap(HavingQueryTree tree,
    Map<Integer, HavingFilterQuery> filterQueryMap, MutableInt currentId) {
  int currentNodeId = currentId.intValue();
  currentId.increment();

  final List<Integer> filterIds = new ArrayList<Integer>();
  if (null != tree.getChildren()) {
    for (final HavingQueryTree child : tree.getChildren()) {
      int childNodeId = currentId.intValue();
      currentId.increment();
      filterIds.add(childNodeId);
      final HavingFilterQuery filterQuery = traverseHavingFilterQueryAndPopulateMap(child, filterQueryMap, currentId);
      filterQueryMap.put(childNodeId, filterQuery);
    }
  }

  HavingFilterQuery havingFilterQuery = new HavingFilterQuery();
  havingFilterQuery.setAggregationInfo(tree.getAggregationInfo());
  havingFilterQuery.setId(currentNodeId);
  havingFilterQuery.setNestedFilterQueryIds(filterIds);
  havingFilterQuery.setOperator(tree.getOperator());
  havingFilterQuery.setValue(tree.getValue());
  return havingFilterQuery;
}
 
開發者ID:linkedin,項目名稱:pinot,代碼行數:25,代碼來源:RequestUtils.java

示例6: 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

示例7: 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

示例8: getClassFilter

import org.apache.commons.lang.mutable.MutableInt; //導入方法依賴的package包/類
private ClassFilter getClassFilter(QName className)
{
    ParameterCheck.mandatory("className", className);

    // Check the global, first
    if (!isEnabled())
    {
        return null;
    }

    if (!TransactionalResourceHelper.isResourcePresent(KEY_CLASS_FILTERS))
    {
        // Nothing was disabled
        return null;
    }
    Map<ClassFilter, MutableInt> classFilters = TransactionalResourceHelper.getMap(KEY_CLASS_FILTERS);
    for (ClassFilter classFilter : classFilters.keySet())
    {
        if (classFilter.getClassName().equals(className))
        {
            MutableInt filterNumber = classFilters.get(classFilter);
            if (filterNumber != null && filterNumber.intValue() > 0 )
            {
                return classFilter;
            }
            break;
        }
    }
    return null;
}
 
開發者ID:Alfresco,項目名稱:alfresco-repository,代碼行數:31,代碼來源:BehaviourFilterImpl.java

示例9: isEnabled

import org.apache.commons.lang.mutable.MutableInt; //導入方法依賴的package包/類
@Override
public boolean isEnabled(NodeRef nodeRef)
{
    ParameterCheck.mandatory("nodeRef",  nodeRef);
    
    // Check the class (includes global) and instance, first
    if (!isEnabled())
    {
        return false;
    }
    
    if (!TransactionalResourceHelper.isResourcePresent(KEY_INSTANCE_FILTERS))
    {
        // Nothing was disabled
        return true;
    }
    nodeRef = tenantService.getName(nodeRef);

    Map<NodeRef, MutableInt> instanceFilters = TransactionalResourceHelper.getMap(KEY_INSTANCE_FILTERS);
    MutableInt filter = instanceFilters.get(nodeRef);
    if (filter != null && filter.intValue() > 0)
    {
        // Instance was disabled
        return false;
    }
    return true;
}
 
開發者ID:Alfresco,項目名稱:alfresco-repository,代碼行數:28,代碼來源:BehaviourFilterImpl.java

示例10: loadData

import org.apache.commons.lang.mutable.MutableInt; //導入方法依賴的package包/類
private void loadData(final int maxCount)
{
    final MutableInt doneCount = new MutableInt(0);
    // Batches of 1000 objects
    RetryingTransactionCallback<Integer> makeNodesCallback = new RetryingTransactionCallback<Integer>()
    {
        public Integer execute() throws Throwable
        {
            for (int i = 0; i < 1000; i++)
            {
                // We don't need to write anything
                String contentUrl = FileContentStore.createNewFileStoreUrl();
                ContentData contentData = new ContentData(contentUrl, MimetypeMap.MIMETYPE_TEXT_PLAIN, 10, "UTF-8");
                nodeHelper.makeNode(contentData);
                
                int count = doneCount.intValue();
                count++;
                doneCount.setValue(count);
                
                // Do some reporting
                if (count % 1000 == 0)
                {
                    System.out.println(String.format("   " + (new Date()) + "Total created: %6d", count));
                }
                
                // Double check for shutdown
                if (vmShutdownListener.isVmShuttingDown())
                {
                    break;
                }
            }
            return maxCount;
        }
    };
    int repetitions = (int) Math.floor((double)maxCount / 1000.0);
    for (int i = 0; i < repetitions; i++)
    {
        transactionService.getRetryingTransactionHelper().doInTransaction(makeNodesCallback);
    }
}
 
開發者ID:Alfresco,項目名稱:alfresco-repository,代碼行數:41,代碼來源:ContentStoreCleanerScalabilityRunner.java

示例11: processException

import org.apache.commons.lang.mutable.MutableInt; //導入方法依賴的package包/類
private void processException(Exception e, MethodInvocation invocation, MutableInt attempt) {
StringBuilder message = new StringBuilder("When invoking method \"").append(invocation.getMethod().getName())
	.append("\" caught \"").append(e.getMessage()).append("\". Attempt #").append(attempt);

attempt.increment();
if (attempt.intValue() <= TransactionRetryInterceptor.MAX_ATTEMPTS) {
    message.append(". Retrying.");
} else {
    message.append(". Giving up.");
}
TransactionRetryInterceptor.log.warn(message);
   }
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:13,代碼來源:TransactionRetryInterceptor.java

示例12: parseType

import org.apache.commons.lang.mutable.MutableInt; //導入方法依賴的package包/類
private Synonym.Type parseType(String value, MutableInt fromIndex) {
	Synonym.Type type = Synonym.Type.RELATED;
	
	while(fromIndex.intValue() < value.length() 
			&& Character.isWhitespace(value.charAt(fromIndex.intValue()))) {
		fromIndex.increment();
	}
	
	int start = fromIndex.intValue();
	
	while(fromIndex.intValue() < value.length() 
			&& Character.isLetter(value.charAt(fromIndex.intValue()))) {
		fromIndex.increment();
	}
	
	if(start < fromIndex.intValue()) {
		String scope = value.substring(start, fromIndex.intValue());
		try {
			type = Synonym.Type.valueOf(scope.toUpperCase());
		} catch(IllegalArgumentException e) {
			type = Synonym.Type.RELATED;
			fromIndex.setValue(start);
		}
	}
			
	return type;
}
 
開發者ID:Novartis,項目名稱:ontobrowser,代碼行數:28,代碼來源:SynonymTagHandler.java

示例13: getCount

import org.apache.commons.lang.mutable.MutableInt; //導入方法依賴的package包/類
public int getCount(T key)
{
  int ret = -1;
  MutableInt val = map.get(key);
  if (val != null) {
    ret = val.intValue();
  }
  return ret;
}
 
開發者ID:apache,項目名稱:apex-malhar,代碼行數:10,代碼來源:HashTestSink.java

示例14: getUnreadMessages

import org.apache.commons.lang.mutable.MutableInt; //導入方法依賴的package包/類
public int getUnreadMessages(Channel channel) {
    MutableInt result = unreadChannels.get(channel);
    if (result == null) {
        return -1;
    }

    return result.intValue();
}
 
開發者ID:games647,項目名稱:TabChannels,代碼行數:9,代碼來源:Subscriber.java

示例15: prepareCharge

import org.apache.commons.lang.mutable.MutableInt; //導入方法依賴的package包/類
@Override
public int prepareCharge(final AccountFeeLog log) {
    final Long[] groupIds = EntityHelper.toIds(log.getAccountFee().getGroups());
    if (ArrayUtils.isEmpty(groupIds)) {
        // No groups to charge
        return 0;
    }
    final MutableInt result = new MutableInt();
    runNative(new JDBCCallback() {
        @Override
        public void execute(final JDBCWrapper jdbc) throws SQLException {
            String[] placeHolders = new String[groupIds.length];
            Arrays.fill(placeHolders, "?");

            StringBuilder sql = new StringBuilder();
            sql.append(" insert into members_pending_charge");
            sql.append(" (account_fee_log_id, member_id)");
            sql.append(" select ?, id");
            sql.append(" from members m");
            sql.append(" where m.subclass = ?");
            sql.append(" and m.group_id in (").append(StringUtils.join(placeHolders, ",")).append(')');

            List<Object> args = new ArrayList<Object>(groupIds.length + 2);
            args.add(log.getId());
            args.add("M");
            CollectionUtils.addAll(args, groupIds);
            int totalMembers = jdbc.execute(sql.toString(), args.toArray());
            result.setValue(totalMembers);
        }
    });
    return result.intValue();
}
 
開發者ID:crypto-coder,項目名稱:open-cyclos,代碼行數:33,代碼來源:MemberAccountFeeLogDAOImpl.java


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