/** * Take an unsorted list of descriptors and sort it so that the order is maintained. */ private List<ClassDescriptor> buildSortedListOfDescriptors(List<ClassDescriptor> descriptors) { List returnDescriptors = Helper.addAllUniqueToList(new ArrayList(descriptors.size()), descriptors); Object[] descriptorsArray = new Object[returnDescriptors.size()]; for (int index = 0; index < returnDescriptors.size(); index++) { descriptorsArray[index] = returnDescriptors.get(index); } Arrays.sort(descriptorsArray, new DescriptorCompare()); returnDescriptors = new ArrayList(descriptorsArray.length); for (Object descriptor : descriptorsArray) { returnDescriptors.add(descriptor); } return returnDescriptors; }
private static int doCompare(Object o1, Object o2) { // I don't care if they're equal, and I want to sort largest first. int first; // I don't care if they're equal, and I want to sort largest first. int second; first = ((CommitOrderDependencyNode)o1).getFinishingTime(); second = ((CommitOrderDependencyNode)o2).getFinishingTime(); if (first == second) { return new DescriptorCompare().compare( ((CommitOrderDependencyNode)o1).getDescriptor(), ((CommitOrderDependencyNode)o2).getDescriptor()); } if (first > second) { return 1; } else { return -1; } }
/** * Take an unsorted vector of descriptors and sort it so that the order is maintained. */ private Vector buildSortedVectorOfDescriptors(Vector descriptors) { Vector returnDescriptors = Helper.addAllUniqueToVector(new Vector(descriptors.size()), descriptors); Object[] descriptorsArray = new Object[returnDescriptors.size()]; for (int index = 0; index < returnDescriptors.size(); index++) { descriptorsArray[index] = returnDescriptors.elementAt(index); } Arrays.sort(descriptorsArray, new DescriptorCompare()); returnDescriptors = new Vector(returnDescriptors.size()); for (int index = 0; index < descriptorsArray.length; index++) { returnDescriptors.addElement(descriptorsArray[index]); } return returnDescriptors; }
private static int doCompare(Object o1, Object o2) { // I don't care if they're equal, and I want to sort largest first. int first; // I don't care if they're equal, and I want to sort largest first. int second; first = ((CommitOrderDependencyNode)o1).getFinishingTime(); second = ((CommitOrderDependencyNode)o2).getFinishingTime(); if (first == second) { return new DescriptorCompare().compare( ((CommitOrderDependencyNode)o1).getDescriptor(), ((CommitOrderDependencyNode)o2).getDescriptor()); } if (first > second) { return 1; } else { return -1; } }
/** * Take an unsorted list of descriptors and sort it so that the order is maintained. */ private List<ClassDescriptor> buildSortedListOfDescriptors(List<ClassDescriptor> descriptors) { List returnDescriptors = Helper.addAllUniqueToList(new ArrayList(descriptors.size()), descriptors); Object[] descriptorsArray = new Object[returnDescriptors.size()]; for (int index = 0; index < returnDescriptors.size(); index++) { descriptorsArray[index] = returnDescriptors.get(index); } Arrays.sort(descriptorsArray, new DescriptorCompare()); returnDescriptors = new ArrayList(descriptorsArray.length); for (Object descriptor : descriptorsArray) { returnDescriptors.add(descriptor); } return returnDescriptors; }
public Vector withAllSubclasses(CommitOrderDependencyNode node) { Vector results = new Vector(); results.addElement(node); if (node.getDescriptor().hasInheritance()) { InheritancePolicy policy = node.getDescriptor().getInheritancePolicy(); // For bug 3019934 replace getChildDescriptors with getAllChildDescriptors. List<ClassDescriptor> childDescriptors = new ArrayList<ClassDescriptor>(); childDescriptors.addAll(policy.getAllChildDescriptors()); // Sort Child Descriptors before adding them to related nodes. Collections.sort(childDescriptors, new DescriptorCompare()); for (ClassDescriptor child : childDescriptors) { results.add(getOwner().nodeFor(child)); } } return results; } }
public Vector withAllSubclasses(CommitOrderDependencyNode node) { Vector results = new Vector(); results.addElement(node); if (node.getDescriptor().hasInheritance()) { InheritancePolicy policy = node.getDescriptor().getInheritancePolicy(); // For bug 3019934 replace getChildDescriptors with getAllChildDescriptors. List<ClassDescriptor> childDescriptors = new ArrayList<ClassDescriptor>(); childDescriptors.addAll(policy.getAllChildDescriptors()); // Sort Child Descriptors before adding them to related nodes. Collections.sort(childDescriptors, new DescriptorCompare()); for (ClassDescriptor child : childDescriptors) { results.add(getOwner().nodeFor(child)); } } return results; } }
descriptorsArray[index] = descriptors.elementAt(index); Arrays.sort(descriptorsArray, new DescriptorCompare()); descriptors = new Vector(descriptors.size()); for (int index = 0; index < descriptorsArray.length; index++) {
descriptorsArray[index] = descriptors.elementAt(index); Arrays.sort(descriptorsArray, new DescriptorCompare()); descriptors = new Vector(descriptors.size()); for (int index = 0; index < descriptorsArray.length; index++) {
descriptorsArray[index] = descriptors.elementAt(index); Arrays.sort(descriptorsArray, new DescriptorCompare()); descriptors = new Vector(descriptors.size()); for (int index = 0; index < descriptorsArray.length; index++) {