当前位置: 首页>>代码示例>>Java>>正文


Java TObjectIntHashMap.containsKey方法代码示例

本文整理汇总了Java中gnu.trove.TObjectIntHashMap.containsKey方法的典型用法代码示例。如果您正苦于以下问题:Java TObjectIntHashMap.containsKey方法的具体用法?Java TObjectIntHashMap.containsKey怎么用?Java TObjectIntHashMap.containsKey使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在gnu.trove.TObjectIntHashMap的用法示例。


在下文中一共展示了TObjectIntHashMap.containsKey方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: generateUniqueVariableName

import gnu.trove.TObjectIntHashMap; //导入方法依赖的package包/类
private static String generateUniqueVariableName(@NonNls final String className, final TObjectIntHashMap<String> class2variableIndex,
                                                 final PsiClass aClass) {
  final String shortName;
  if (className.startsWith("javax.swing.J")) {
    shortName = className.substring("javax.swing.J".length());
  }
  else {
    final int idx = className.lastIndexOf('.');
    if (idx != -1) {
      shortName = className.substring(idx + 1);
    }
    else {
      shortName = className;
    }
  }

  if (!class2variableIndex.containsKey(className)) class2variableIndex.put(className, 0);
  String result;
  do {
    class2variableIndex.increment(className);
    int newIndex = class2variableIndex.get(className);

    result = Character.toLowerCase(shortName.charAt(0)) + shortName.substring(1) + newIndex;
  } while(aClass.findFieldByName(result, true) != null);
  return result;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:27,代码来源:FormSourceCodeGenerator.java

示例2: computeDistancesToTarget

import gnu.trove.TObjectIntHashMap; //导入方法依赖的package包/类
private void computeDistancesToTarget() {
  myNonTreeEdges = new MultiMap<Node, GraphEdge<Node>>();
  mySortedNodes = new ArrayList<Node>();
  myNextNodes = new HashMap<Node, Node>();
  TObjectIntHashMap<Node> distances = new TObjectIntHashMap<Node>();
  Deque<Node> nodes = new ArrayDeque<Node>();
  nodes.addLast(myFinish);
  distances.put(myFinish, 0);
  while (!nodes.isEmpty()) {
    myProgressIndicator.checkCanceled();
    Node node = nodes.removeFirst();
    mySortedNodes.add(node);
    int d = distances.get(node) + 1;
    Iterator<Node> iterator = myGraph.getIn(node);
    while (iterator.hasNext()) {
      Node prev = iterator.next();
      if (distances.containsKey(prev)) {
        int dPrev = distances.get(prev);
        myNonTreeEdges.putValue(prev, new GraphEdge<Node>(prev, node, d - dPrev));
        continue;
      }
      distances.put(prev, d);
      myNextNodes.put(prev, node);
      nodes.addLast(prev);
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:28,代码来源:KShortestPathsFinder.java

示例3: getResourceId

import gnu.trove.TObjectIntHashMap; //导入方法依赖的package包/类
@NotNull
public Integer getResourceId(ResourceType type, String name) {
  final TObjectIntHashMap<String> map = myResourceValueMap != null ? myResourceValueMap.get(type) : null;

  if (map == null || !map.containsKey(name)) {
    return getDynamicId(type, name);
  }
  return map.get(name);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:AppResourceRepository.java

示例4: generateUniqueVariableName

import gnu.trove.TObjectIntHashMap; //导入方法依赖的package包/类
private static String generateUniqueVariableName(@NonNls final String className,
		final TObjectIntHashMap<String> class2variableIndex,
		final PsiClass aClass)
{
	final String shortName;
	if(className.startsWith("javax.swing.J"))
	{
		shortName = className.substring("javax.swing.J".length());
	}
	else
	{
		final int idx = className.lastIndexOf('.');
		if(idx != -1)
		{
			shortName = className.substring(idx + 1);
		}
		else
		{
			shortName = className;
		}
	}

	if(!class2variableIndex.containsKey(className))
	{
		class2variableIndex.put(className, 0);
	}
	String result;
	do
	{
		class2variableIndex.increment(className);
		int newIndex = class2variableIndex.get(className);

		result = Character.toLowerCase(shortName.charAt(0)) + shortName.substring(1) + newIndex;
	}
	while(aClass.findFieldByName(result, true) != null);
	return result;
}
 
开发者ID:consulo,项目名称:consulo-ui-designer,代码行数:38,代码来源:FormSourceCodeGenerator.java

示例5: getTargetId

import gnu.trove.TObjectIntHashMap; //导入方法依赖的package包/类
public static Integer getTargetId(String targetTitle, TObjectIntHashMap<String> pagesByTitle, TIntIntHashMap redirectTargetsBySource) {
	
	String nTitle = normaliseTitle(targetTitle) ;
	
	if (!pagesByTitle.containsKey(nTitle))
		return null ;
	
	Integer target = pagesByTitle.get(nTitle) ;	
	HashSet<Integer> targetsSeen = new HashSet<Integer>() ;
	
    while (target != null && redirectTargetsBySource != null && redirectTargetsBySource.containsKey(target)){
		
    	if (targetsSeen.contains(target)) {
    		// seen this redirect before, and can't resolve a loop
    		return null ;
    	} else {
    		targetsSeen.add(target) ;
    		
    		if (redirectTargetsBySource.containsKey(target)) 
    			target = redirectTargetsBySource.get(target) ;
    		else
    			target = null ;
		}
    }
    
	return target ;
}
 
开发者ID:busk,项目名称:WikipediaMiner,代码行数:28,代码来源:Util.java

示例6: hashCode

import gnu.trove.TObjectIntHashMap; //导入方法依赖的package包/类
/**
 * Returns a hash code using the given map from vars to ints.
 */
public int hashCode(TObjectIntHashMap varMap) {
	// see if this already in map
	if (varMap.containsKey(this))
		return varMap.get(this);
	// otherwise add it
	int next = varMap.size() + 1;
	varMap.put(this, next);
	return next;
}
 
开发者ID:OpenCCG,项目名称:openccg,代码行数:13,代码来源:VarModality.java


注:本文中的gnu.trove.TObjectIntHashMap.containsKey方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。