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


Java TIntObjectHashMap.get方法代码示例

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


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

示例1: getReachable

import gnu.trove.TIntObjectHashMap; //导入方法依赖的package包/类
private static LinkedHashSet<Integer> getReachable(final LinkedHashSet<Integer> fragmentInsns, final Instruction[] flow, TIntObjectHashMap<TIntHashSet> dfaResult, final int[] postorder) {
  final LinkedHashSet<Integer> result = new LinkedHashSet<Integer>();
  for (Instruction insn : flow) {
    if (insn instanceof ReadWriteVariableInstruction &&
        !((ReadWriteVariableInstruction) insn).isWrite()) {
      final int ref = insn.num();
      TIntHashSet defs = dfaResult.get(ref);
      defs.forEach(new TIntProcedure() {
        public boolean execute(int def) {
          if (fragmentInsns.contains(def)) {
            if (!fragmentInsns.contains(ref) || postorder[ref] < postorder[def]) {
              result.add(ref);
              return false;
            }
          }
          return true;
        }
      });
    }
  }

  return result;
}
 
开发者ID:internetisalie,项目名称:lua-for-idea,代码行数:24,代码来源:ReachingDefinitionsCollector.java

示例2: save

import gnu.trove.TIntObjectHashMap; //导入方法依赖的package包/类
public void save(@NotNull final DataOutput dataOutput, TIntObjectHashMap<TIntArrayList> classAndMethodsMap)
  throws IOException {
  DataInputOutputUtil.writeINT(dataOutput, classAndMethodsMap.size());
  final int[] classNameIds = classAndMethodsMap.keys();
  Arrays.sort(classNameIds);

  int prevClassNameId = 0;
  for(int classNameId:classNameIds) {
    DataInputOutputUtil.writeINT(dataOutput, classNameId - prevClassNameId);
    TIntArrayList value = classAndMethodsMap.get(classNameId);
    DataInputOutputUtil.writeINT(dataOutput, value.size());

    final int[] methodNameIds = value.toNativeArray();
    Arrays.sort(methodNameIds);
    int prevMethodNameId = 0;
    for (int methodNameId : methodNameIds) {
      DataInputOutputUtil.writeINT(dataOutput, methodNameId - prevMethodNameId);
      prevMethodNameId = methodNameId;
    }
    prevClassNameId = classNameId;
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:TestDiscoveryIndex.java

示例3: fillMethodParameters

import gnu.trove.TIntObjectHashMap; //导入方法依赖的package包/类
public static String fillMethodParameters(final PsiMethod method, @Nullable final TIntObjectHashMap<SubLookupElement> replaceElements) {
  final TIntObjectHashMap<SubLookupElement> notNullReplaceElements = replaceElements == null ?
      new TIntObjectHashMap<SubLookupElement>(0) :
      replaceElements;

  final PsiParameter[] parameters = method.getParameterList().getParameters();
  final StringBuilder sb = new StringBuilder();
  for (int i = 0; i < parameters.length; i++) {
    if (i != 0) {
      sb.append(", ");
    }
    final PsiParameter parameter = parameters[i];
    final SubLookupElement replaceElement = notNullReplaceElements.get(i);
    if (replaceElement != null) {
      sb.append(replaceElement.getInsertString());
    } else {
      sb.append(parameter.getName());
    }
  }
  return sb.toString();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:ChainCompletionLookupElementUtil.java

示例4: getProfile

import gnu.trove.TIntObjectHashMap; //导入方法依赖的package包/类
@Nullable
public static DuplicatesProfile getProfile(@NotNull DupInfo dupInfo, int index) {
  TIntObjectHashMap<DuplicatesProfile> patternCache = ourProfileCache.get(dupInfo);
  if (patternCache == null) {
    patternCache = new TIntObjectHashMap<DuplicatesProfile>();
    ourProfileCache.put(dupInfo, patternCache);
  }
  DuplicatesProfile result = patternCache.get(index);
  if (result == null) {
    DuplicatesProfile[] profiles = Extensions.getExtensions(DuplicatesProfile.EP_NAME);
    DuplicatesProfile theProfile = null;
    for (DuplicatesProfile profile : profiles) {
      if (profile.isMyDuplicate(dupInfo, index)) {
        theProfile = profile;
        break;
      }
    }
    result = theProfile == null ? NULL_PROFILE : theProfile;
    patternCache.put(index, result);
  }
  return result == NULL_PROFILE ? null : result;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:DuplicatesProfileCache.java

示例5: patchIcon

import gnu.trove.TIntObjectHashMap; //导入方法依赖的package包/类
public Icon patchIcon(Icon baseIcon, VirtualFile file, int flags, Project project) {
  if (project == null) return baseIcon;

  final TIntObjectHashMap<Icon> icons = file.getUserData(ICON_KEY);
  if (icons != null) {
    final Icon icon = icons.get(flags);
    if (icon != null) {
      return icon;
    }
  }

  final PsiFile element = PsiManager.getInstance(project).findFile(file);
  if (element != null) {
    if (XsltSupport.isXsltFile(element)) {
      return cacheIcon(file, flags, icons, XsltSupport.createXsltIcon(baseIcon));
    }
  }
  return baseIcon;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:XsltIconProvider.java

示例6: get

import gnu.trove.TIntObjectHashMap; //导入方法依赖的package包/类
public List get (int key1, int key2)
{
  TIntObjectHashMap inner = (TIntObjectHashMap) backing.get (key1);
  if (inner == null) {
    return null;
  } else {
    return (List) inner.get (key2);
  }
}
 
开发者ID:mimno,项目名称:GRMM,代码行数:10,代码来源:CSIntInt2ObjectMultiMap.java

示例7: get

import gnu.trove.TIntObjectHashMap; //导入方法依赖的package包/类
public Object get (int key1, int key2)
{
  TIntObjectHashMap inner = (TIntObjectHashMap) backing.get (key1);
  if (inner == null) {
    return null;
  } else {
    return inner.get (key2);
  }
}
 
开发者ID:mimno,项目名称:GRMM,代码行数:10,代码来源:MIntInt2ObjectMap.java

示例8: addFileToProcess

import gnu.trove.TIntObjectHashMap; //导入方法依赖的package包/类
private static void addFileToProcess(TIntObjectHashMap<Set<String>> filesToProcess,
                                     final int rootIndex,
                                     final String path,
                                     Collection<String> deletedFiles) {
  if (deletedFiles.contains(path)) {
    return;
  }
  Set<String> paths = filesToProcess.get(rootIndex);
  if (paths == null) {
    paths = new THashSet<String>(FileUtil.PATH_HASHING_STRATEGY);
    filesToProcess.put(rootIndex, paths);
  }
  paths.add(path);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:IncArtifactBuilder.java

示例9: computeProperties

import gnu.trove.TIntObjectHashMap; //导入方法依赖的package包/类
private static Properties computeProperties(final Matcher matcher, final TIntObjectHashMap<String> offsetToProperty, Project project) {
  Properties properties = new Properties(FileTemplateManager.getInstance(project).getDefaultProperties());

  int[] offsets = offsetToProperty.keys();
  Arrays.sort(offsets);
  for (int i = 0; i < offsets.length; i++) {
    final int offset = offsets[i];
    String propName = offsetToProperty.get(offset);
    int groupNum = i + 2; // first group is whole doc comment
    String propValue = matcher.group(groupNum);
    properties.setProperty(propName, propValue);
  }

  return properties;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:FileHeaderChecker.java

示例10: removeFromMultiMap

import gnu.trove.TIntObjectHashMap; //导入方法依赖的package包/类
private void removeFromMultiMap(int key, int value) {
  final TIntObjectHashMap<TIntArrayList> map = myMultipleValuesMap;
  if (map == null) return;
  TIntArrayList list = map.get(key);
  if (list != null) {
    int offset = list.indexOf(value);
    if (offset != -1) {
      list.remove(offset);
      if (list.isEmpty()) {
        map.remove(key);
      }
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:SmartIntToIntArrayMap.java

示例11: prepareRefsToIndicesMap

import gnu.trove.TIntObjectHashMap; //导入方法依赖的package包/类
@NotNull
private TIntObjectHashMap<SmartList<VcsRef>> prepareRefsToIndicesMap(@NotNull Collection<VcsRef> refs) {
  TIntObjectHashMap<SmartList<VcsRef>> map = new TIntObjectHashMap<SmartList<VcsRef>>();
  for (VcsRef ref : refs) {
    int index = myHashMap.getCommitIndex(ref.getCommitHash());
    SmartList<VcsRef> list = map.get(index);
    if (list == null) map.put(index, list = new SmartList<VcsRef>());
    list.add(ref);
  }
  return map;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:RefsModel.java

示例12: checkUsages

import gnu.trove.TIntObjectHashMap; //导入方法依赖的package包/类
public static void checkUsages(final SliceUsage usage, final TIntObjectHashMap<IntArrayList> flownOffsets) {
  final List<SliceUsage> children = new ArrayList<SliceUsage>();
  boolean b = ProgressManager.getInstance().runProcessWithProgressSynchronously(new Runnable() {
    @Override
    public void run() {
      usage.processChildren(new CommonProcessors.CollectProcessor<SliceUsage>(children));
    }
  }, "Expanding", true, usage.getElement().getProject());
  assertTrue(b);
  int startOffset = usage.getElement().getTextOffset();
  IntArrayList list = flownOffsets.get(startOffset);
  int[] offsets = list == null ? new int[0] : list.toArray();
  Arrays.sort(offsets);

  int size = offsets.length;
  assertEquals(message(startOffset, usage), size, children.size());
  Collections.sort(children, new Comparator<SliceUsage>() {
    @Override
    public int compare(SliceUsage o1, SliceUsage o2) {
      return o1.compareTo(o2);
    }
  });

  for (int i = 0; i < children.size(); i++) {
    SliceUsage child = children.get(i);
    int offset = offsets[i];
    assertEquals(message(offset, child), offset, child.getUsageInfo().getElement().getTextOffset());

    checkUsages(child, flownOffsets);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:32,代码来源:SliceTestUtil.java

示例13: push

import gnu.trove.TIntObjectHashMap; //导入方法依赖的package包/类
void push(final int value, final TIntObjectHashMap map){
  final String stringRepresentation = (String)map.get(value);
  if (stringRepresentation != null) {
    checkParameter();
    myBuffer.append(stringRepresentation);
  }
  else {
    push(value);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:FormSourceCodeGenerator.java

示例14: get

import gnu.trove.TIntObjectHashMap; //导入方法依赖的package包/类
@Nullable
public static Icon get(@NotNull UserDataHolder holder, int flags) {
  TIntObjectHashMap<Icon> map = holder.getUserData(LAST_COMPUTED_ICON);
  return map == null ? null : map.get(flags);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:Iconable.java

示例15: getPotentialDefinitionsOfLocalIDBefore

import gnu.trove.TIntObjectHashMap; //导入方法依赖的package包/类
public List<SetLocal> getPotentialDefinitionsOfLocalIDBefore(Instruction instruction, int localID) {

		TIntObjectHashMap<List<SetLocal>> definitionsByInstruction = definitionsByInstructionIndexLocalID.get(localID);
		if(definitionsByInstruction == null) {
			definitionsByInstruction = new TIntObjectHashMap<List<SetLocal>>(4);
			definitionsByInstructionIndexLocalID.put(localID, definitionsByInstruction);
		}
		
		List<SetLocal> potentialDefs = definitionsByInstruction.get(instruction.getIndex());
		if(potentialDefs == null) {

			potentialDefs = new LinkedList<SetLocal>();
			definitionsByInstruction.put(instruction.getIndex(), potentialDefs);

			gnu.trove.TIntHashSet visited = new gnu.trove.TIntHashSet(64);

			Vector<Instruction> instructionsToAnalyze = new Vector<Instruction>(3);
			instructionsToAnalyze.add(instruction);

			while(!instructionsToAnalyze.isEmpty()) {

				Instruction instructionToAnalyze = instructionsToAnalyze.remove(instructionsToAnalyze.size() - 1);

				if(!visited.contains(instructionToAnalyze.getIndex())) {

					visited.add(instructionToAnalyze.getIndex());

					for(Instruction predecessor : instructionToAnalyze.getOrderedPredecessors())
						if(predecessor instanceof SetLocal && ((SetLocal)predecessor).getLocalID() == localID)
							potentialDefs.add((SetLocal)predecessor);
						else 
							instructionsToAnalyze.add(predecessor);
					
				}
				
			}
			
		}
			
		return potentialDefs;
		
	}
 
开发者ID:andyjko,项目名称:whyline,代码行数:43,代码来源:LocalDependencies.java


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