本文整理汇总了Java中com.sun.hotspot.igv.data.Pair类的典型用法代码示例。如果您正苦于以下问题:Java Pair类的具体用法?Java Pair怎么用?Java Pair使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Pair类属于com.sun.hotspot.igv.data包,在下文中一共展示了Pair类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: organize
import com.sun.hotspot.igv.data.Pair; //导入依赖的package包/类
public List<Pair<String, List<Group>>> organize(List<String> subFolders, List<Group> groups) {
List<Pair<String, List<Group>>> result = new ArrayList<Pair<String, List<Group>>>();
if (groups.size() == 1 && subFolders.size() > 0) {
result.add(new Pair<String, List<Group>>("", groups));
} else {
for (Group g : groups) {
List<Group> children = new ArrayList<Group>();
children.add(g);
Pair<String, List<Group>> p = new Pair<String, List<Group>>();
p.setLeft(g.getName());
p.setRight(children);
result.add(p);
}
}
return result;
}
示例2: organize
import com.sun.hotspot.igv.data.Pair; //导入依赖的package包/类
public List<Pair<String, List<Group>>> organize(List<String> subFolders, List<Group> groups) {
List<Pair<String, List<Group>>> result = new ArrayList<Pair<String, List<Group>>>();
if (subFolders.size() == 0) {
buildResult(result, groups, packageNameProvider);
} else if (subFolders.size() == 1) {
buildResult(result, groups, classNameProvider);
} else if (subFolders.size() == 2) {
for (Group g : groups) {
List<Group> children = new ArrayList<Group>();
children.add(g);
Pair<String, List<Group>> p = new Pair<String, List<Group>>();
p.setLeft(reducedNameProvider.getName(g));
p.setRight(children);
result.add(p);
}
} else {
result.add(new Pair<String, List<Group>>("", groups));
}
return result;
}
示例3: buildResult
import com.sun.hotspot.igv.data.Pair; //导入依赖的package包/类
private void buildResult(List<Pair<String, List<Group>>> result, List<Group> groups, NameProvider provider) {
HashMap<String, List<Group>> map = new HashMap<String, List<Group>>();
for (Group g : groups) {
String s = provider.getName(g);
if (!map.containsKey(s)) {
List<Group> list = new ArrayList<Group>();
Pair<String, List<Group>> pair = new Pair<String, List<Group>>(s, list);
result.add(pair);
map.put(s, list);
}
List<Group> curList = map.get(s);
curList.add(g);
}
Collections.sort(result, new Comparator<Pair<String, List<Group>>>() {
public int compare(Pair<String, List<Group>> a, Pair<String, List<Group>> b) {
return a.getLeft().compareTo(b.getLeft());
}
});
}
示例4: changed
import com.sun.hotspot.igv.data.Pair; //导入依赖的package包/类
public void changed(Group source) {
List<Pair<String, List<Group>>> newStructure = new ArrayList<Pair<String, List<Group>>>();
for(Pair<String, List<Group>> p : parent.structure) {
refreshKey(p);
}
}
示例5: organize
import com.sun.hotspot.igv.data.Pair; //导入依赖的package包/类
public List<Pair<String, List<Group>>> organize(List<String> subFolders, List<Group> groups);