com.sun.hotspot.igv.data.Pair Java Examples

The following examples show how to use com.sun.hotspot.igv.data.Pair. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: StandardGroupOrganizer.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
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;
    }
 
Example #2
Source File: JavaGroupOrganizer.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
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());
        }
    });
}
 
Example #3
Source File: JavaGroupOrganizer.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
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;
    }
 
Example #4
Source File: StandardGroupOrganizer.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
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;
    }
 
Example #5
Source File: JavaGroupOrganizer.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
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());
        }
    });
}
 
Example #6
Source File: JavaGroupOrganizer.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
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;
    }
 
Example #7
Source File: StandardGroupOrganizer.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
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;
    }
 
Example #8
Source File: JavaGroupOrganizer.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
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());
        }
    });
}
 
Example #9
Source File: JavaGroupOrganizer.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
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;
    }
 
Example #10
Source File: StandardGroupOrganizer.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
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;
    }
 
Example #11
Source File: JavaGroupOrganizer.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
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());
        }
    });
}
 
Example #12
Source File: JavaGroupOrganizer.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
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;
    }
 
Example #13
Source File: StandardGroupOrganizer.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
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;
    }
 
Example #14
Source File: JavaGroupOrganizer.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
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());
        }
    });
}
 
Example #15
Source File: JavaGroupOrganizer.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
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;
    }
 
Example #16
Source File: StandardGroupOrganizer.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
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;
    }
 
Example #17
Source File: JavaGroupOrganizer.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
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());
        }
    });
}
 
Example #18
Source File: JavaGroupOrganizer.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
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;
    }
 
Example #19
Source File: JavaGroupOrganizer.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
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;
    }
 
Example #20
Source File: StandardGroupOrganizer.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
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;
    }
 
Example #21
Source File: JavaGroupOrganizer.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
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());
        }
    });
}
 
Example #22
Source File: FolderNode.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
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);
    }
}
 
Example #23
Source File: FolderNode.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
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);
    }
}
 
Example #24
Source File: FolderNode.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
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);
    }
}
 
Example #25
Source File: FolderNode.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
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);
    }
}
 
Example #26
Source File: FolderNode.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
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);
    }
}
 
Example #27
Source File: FolderNode.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
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);
    }
}
 
Example #28
Source File: FolderNode.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
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);
    }
}
 
Example #29
Source File: GroupOrganizer.java    From TencentKona-8 with GNU General Public License v2.0 votes vote down vote up
public List<Pair<String, List<Group>>> organize(List<String> subFolders, List<Group> groups); 
Example #30
Source File: GroupOrganizer.java    From openjdk-8 with GNU General Public License v2.0 votes vote down vote up
public List<Pair<String, List<Group>>> organize(List<String> subFolders, List<Group> groups);