@Override public int compare(VRMenuDef o1, VRMenuDef o2) { int x = Integer.compare(o1.getOrder(), o2.getOrder()); if (x != 0) { return x; } return o1.getName().compareTo(o2.getName()); }
public List<VRMenuDef> getChildren(String type) { List<VRMenuDef> all = new ArrayList<>(); for (VRMenuDef c : children) { if (c.getType().equals(type)) { all.add(c); } } return all; }
public List<VRMenuDef> getLeaves() { List<VRMenuDef> all = new ArrayList<>(); for (VRMenuDef c : children) { if (!c.getType().equals("package")) { all.add(c); } } Collections.sort(all, VR_MENU_DEF_COMPARATOR); return all; }