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


Java TObjectIntHashMap.clear方法代码示例

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


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

示例1: remove

import gnu.trove.TObjectIntHashMap; //导入方法依赖的package包/类
public synchronized void remove(@Nullable final String groupName,
                                @NotNull final NotificationSource notificationSource,
                                @NotNull final ProjectSystemId projectSystemId) {
  final Map<String, Map<NotificationSource, TObjectIntHashMap<NotificationCategory>>> groupMap =
    ContainerUtil.getOrCreate(
      map,
      projectSystemId,
      ContainerUtil.<String, Map<NotificationSource, TObjectIntHashMap<NotificationCategory>>>newHashMap());
  if (groupName != null) {
    final TObjectIntHashMap<NotificationCategory> counter = ContainerUtil.getOrCreate(
      ContainerUtil.getOrCreate(
        groupMap,
        groupName,
        ContainerUtil.<NotificationSource, TObjectIntHashMap<NotificationCategory>>newHashMap()
      ),
      notificationSource,
      new MyTObjectIntHashMap<NotificationCategory>()
    );
    counter.clear();
  }
  else {
    for (Map<NotificationSource, TObjectIntHashMap<NotificationCategory>> sourceMap : groupMap.values()) {
      sourceMap.remove(notificationSource);
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:27,代码来源:MessageCounter.java

示例2: remove

import gnu.trove.TObjectIntHashMap; //导入方法依赖的package包/类
public synchronized void remove(@javax.annotation.Nullable final String groupName,
                                @Nonnull final NotificationSource notificationSource,
                                @Nonnull final ProjectSystemId projectSystemId) {
  final Map<String, Map<NotificationSource, TObjectIntHashMap<NotificationCategory>>> groupMap =
          ContainerUtil.getOrCreate(
                  map,
                  projectSystemId,
                  ContainerUtil.<String, Map<NotificationSource, TObjectIntHashMap<NotificationCategory>>>newHashMap());
  if (groupName != null) {
    final TObjectIntHashMap<NotificationCategory> counter = ContainerUtil.getOrCreate(
            ContainerUtil.getOrCreate(
                    groupMap,
                    groupName,
                    ContainerUtil.<NotificationSource, TObjectIntHashMap<NotificationCategory>>newHashMap()
            ),
            notificationSource,
            new TObjectIntHashMap<NotificationCategory>()
    );
    counter.clear();
  }
  else {
    for (Map<NotificationSource, TObjectIntHashMap<NotificationCategory>> sourceMap : groupMap.values()) {
      sourceMap.remove(notificationSource);
    }
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:27,代码来源:MessageCounter.java

示例3: getOverriddenMethods

import gnu.trove.TObjectIntHashMap; //导入方法依赖的package包/类
@NotNull
public List<JavaArrangementOverriddenMethodsInfo> getOverriddenMethods() {
  List<JavaArrangementOverriddenMethodsInfo> result = new ArrayList<JavaArrangementOverriddenMethodsInfo>();
  final TObjectIntHashMap<PsiMethod> weights = new TObjectIntHashMap<PsiMethod>();
  Comparator<Pair<PsiMethod, PsiMethod>> comparator = new Comparator<Pair<PsiMethod, PsiMethod>>() {
    @Override
    public int compare(Pair<PsiMethod, PsiMethod> o1, Pair<PsiMethod, PsiMethod> o2) {
      return weights.get(o1.first) - weights.get(o2.first);
    }
  };
  for (Map.Entry<PsiClass, List<Pair<PsiMethod, PsiMethod>>> entry : myOverriddenMethods.entrySet()) {
    JavaArrangementOverriddenMethodsInfo info = new JavaArrangementOverriddenMethodsInfo(entry.getKey().getName());
    weights.clear();
    int i = 0;
    for (PsiMethod method : entry.getKey().getMethods()) {
      weights.put(method, i++);
    }
    ContainerUtil.sort(entry.getValue(), comparator);
    for (Pair<PsiMethod, PsiMethod> pair : entry.getValue()) {
      JavaElementArrangementEntry overridingMethodEntry = myMethodEntriesMap.get(pair.second);
      if (overridingMethodEntry != null) {
        info.addMethodEntry(overridingMethodEntry);
      }
    }
    if (!info.getMethodEntries().isEmpty()) {
      result.add(info);
    }
  }

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

示例4: getOverriddenMethods

import gnu.trove.TObjectIntHashMap; //导入方法依赖的package包/类
@NotNull
public List<JavaArrangementOverriddenMethodsInfo> getOverriddenMethods() {
  List<JavaArrangementOverriddenMethodsInfo> result = new ArrayList<JavaArrangementOverriddenMethodsInfo>();
  final TObjectIntHashMap<PsiMethod> weights = new TObjectIntHashMap<PsiMethod>();
  Comparator<Pair<PsiMethod, PsiMethod>> comparator = new Comparator<Pair<PsiMethod, PsiMethod>>() {
    @Override
    public int compare(Pair<PsiMethod, PsiMethod> o1, Pair<PsiMethod, PsiMethod> o2) {
      return weights.get(o1.first) - weights.get(o2.first);
    }
  };
  for (Map.Entry<PsiClass, List<Pair<PsiMethod, PsiMethod>>> entry : myOverriddenMethods.entrySet()) {
    JavaArrangementOverriddenMethodsInfo info = new JavaArrangementOverriddenMethodsInfo(entry.getKey().getName());
    weights.clear();
    int i = 0;
    for (PsiMethod method : entry.getKey().getMethods()) {
      weights.put(method, i++);
    }
    ContainerUtil.sort(entry.getValue(), comparator);
    for (Pair<PsiMethod, PsiMethod> pair : entry.getValue()) {
      JavaElementArrangementEntry overridingMethodEntry = myMethodEntriesMap.get(pair.second);
      if (overridingMethodEntry != null) {
        info.addMethodEntry(overridingMethodEntry);
      }
    }
    if (!info.getMethodEntries().isEmpty()) {
      result.add(info);
    }
  }
  
  return result;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:32,代码来源:JavaArrangementParseInfo.java

示例5: getOverriddenMethods

import gnu.trove.TObjectIntHashMap; //导入方法依赖的package包/类
@NotNull
public List<JavaArrangementOverriddenMethodsInfo> getOverriddenMethods()
{
	List<JavaArrangementOverriddenMethodsInfo> result = new ArrayList<JavaArrangementOverriddenMethodsInfo>();
	final TObjectIntHashMap<PsiMethod> weights = new TObjectIntHashMap<PsiMethod>();
	Comparator<Pair<PsiMethod, PsiMethod>> comparator = new Comparator<Pair<PsiMethod, PsiMethod>>()
	{
		@Override
		public int compare(Pair<PsiMethod, PsiMethod> o1, Pair<PsiMethod, PsiMethod> o2)
		{
			return weights.get(o1.first) - weights.get(o2.first);
		}
	};
	for(Map.Entry<PsiClass, List<Pair<PsiMethod, PsiMethod>>> entry : myOverriddenMethods.entrySet())
	{
		JavaArrangementOverriddenMethodsInfo info = new JavaArrangementOverriddenMethodsInfo(entry.getKey().getName());
		weights.clear();
		int i = 0;
		for(PsiMethod method : entry.getKey().getMethods())
		{
			weights.put(method, i++);
		}
		ContainerUtil.sort(entry.getValue(), comparator);
		for(Pair<PsiMethod, PsiMethod> pair : entry.getValue())
		{
			JavaElementArrangementEntry overridingMethodEntry = myMethodEntriesMap.get(pair.second);
			if(overridingMethodEntry != null)
			{
				info.addMethodEntry(overridingMethodEntry);
			}
		}
		if(!info.getMethodEntries().isEmpty())
		{
			result.add(info);
		}
	}

	return result;
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:40,代码来源:JavaArrangementParseInfo.java


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