public int compare(T o1, T o2) { return sorter.compare(describeChild(o1), describeChild(o2)); } };
public void sort(Sorter sorter) { sorter.apply(fRunner); }
/** * Sorts the tests methods using the given sorter. The resulting order may not be totally * conform to the sorter specification, since this method will ensure that dependencies * are still sorted before dependant tests. * * @param sorter the sorter to use for sorting tests. */ @Override public void sort(final Sorter sorter) { final FrameworkMethod[] children = getFilteredChildren(); for (final FrameworkMethod method : children) { sorter.apply(method); } Arrays.sort(children, (FrameworkMethod o1, FrameworkMethod o2) -> sorter.compare(describeChild(o1), describeChild(o2))); sortDependantTestsLast(children); filteredChildren = children; }
void mySortingFunc(Point[] points) { Arrays.sort(points, new Sorter()); }
private static Sorter sorter = new Sorter(); case 0: sorter.InsertionSort(are); sorter.print(arr); break; case 1: sorter.QuickSort(arr); sorter.print(arr); break;
public class StrategyPattern { public static void main(String[] args) { Sorter sorter = new Sorter(); int[] input = new int[] {7,1,23,22,22,11,0,21,1,2,334,45,6,11,2}; System.out.print("Input is : "); for (int i : input) { System.out.print(i + ","); } System.out.println(); sorter.sort(input, Speed.SLOW); } }
public static void main(String args[]) { IntNode head = new IntNode(-1, null); Sorter sorter = new Sorter(); head.addAfter(4); head.addAfter(5); head.addAfter(2); head.addAfter(3); head.addAfter(6); head.addAfter(9); head.addAfter(8); head.addAfter(10); sorter.selectionSort(head); for (IntNode i = head; i != null; i = i.getLink()) { System.out.println(i.getData()); } }
Sorter sorter = new Sorter(); Collections.sort(etapes, sorter);
@Test public testPresortedValues() { List<Integer> data = Lists.newArrayList(1, 1, 1, 2, 25, 30); List<Integer> expected = Lists.newArrayList(1, 1, 1, 2, 25, 30); Sorter sorter = new Sorter(); sorter.sort(data); for (int i = 0; i < data.size(); ++i) { Asser.assertEquals(data.get(i), expected.get(i); } }
public int compare(Method o1, Method o2) { return sorter.compare(methodDescription(o1), methodDescription(o2)); } });
public void sort(Sorter sorter) { sorter.apply(fRunner); } }
List<Type> data_source,order; Collections.sort(data_source); //or Collections.sort(data_source, new Sorter(order));
public int compare(T o1, T o2) { return fSorter.compare(describeChild(o1), describeChild(o2)); } };
private void sortChild(T child) { fSorter.apply(child); }
words = readline.split(" "); List<String> input = Arrays.asList(words); sorter = new Sorter(input);
public int compare(Method o1, Method o2) { return sorter.compare(methodDescription(o1), methodDescription(o2)); } });
public void sort(Sorter sorter) { childrenLock.lock(); try { for (T each : getFilteredChildren()) { sorter.apply(each); } List<T> sortedChildren = new ArrayList<T>(getFilteredChildren()); Collections.sort(sortedChildren, comparator(sorter)); filteredChildren = Collections.unmodifiableList(sortedChildren); } finally { childrenLock.unlock(); } }