本文整理汇总了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);
}
}
}
示例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);
}
}
}
示例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;
}
示例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;
}
示例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;
}