312 ++lo;
313 --hi;
314 }
315 }
316
317 // If the right index has not reached the left side of array
318 // must now sort the left partition.
319 if (lo0 < hi) {
320 quickSort(v, lo0, hi);
321 }
322
323 // If the left index has not reached the right side of array
324 // must now sort the right partition.
325 if (lo < hi0) {
326 quickSort(v, lo, hi0);
327 }
328
329 }
330 }
331
332 private final void swap(final Vector<Object> a, final int i, final int j) {
333 final Object T = a.elementAt(i);
334 a.setElementAt(a.elementAt(j), i);
335 a.setElementAt(T, j);
336 }
337
338 protected abstract boolean lt(SortableFile a, SortableFile b);
339 }
340
341 class QuickSortNames extends QuickSort {
342 protected boolean lt(final SortableFile a, final SortableFile b) {
343 final String aLower = a.fName.toLowerCase();
344 final String bLower = b.fName.toLowerCase();
345 return aLower.compareTo(bLower) < 0;
346 }
347 }
348
349 class QuickSortDates extends QuickSort {
350 protected boolean lt(final SortableFile a, final SortableFile b) {
351 return a.fDateValue < b.fDateValue;
352 }
|
312 ++lo;
313 --hi;
314 }
315 }
316
317 // If the right index has not reached the left side of array
318 // must now sort the left partition.
319 if (lo0 < hi) {
320 quickSort(v, lo0, hi);
321 }
322
323 // If the left index has not reached the right side of array
324 // must now sort the right partition.
325 if (lo < hi0) {
326 quickSort(v, lo, hi0);
327 }
328
329 }
330 }
331
332 private void swap(final Vector<Object> a, final int i, final int j) {
333 final Object T = a.elementAt(i);
334 a.setElementAt(a.elementAt(j), i);
335 a.setElementAt(T, j);
336 }
337
338 protected abstract boolean lt(SortableFile a, SortableFile b);
339 }
340
341 class QuickSortNames extends QuickSort {
342 protected boolean lt(final SortableFile a, final SortableFile b) {
343 final String aLower = a.fName.toLowerCase();
344 final String bLower = b.fName.toLowerCase();
345 return aLower.compareTo(bLower) < 0;
346 }
347 }
348
349 class QuickSortDates extends QuickSort {
350 protected boolean lt(final SortableFile a, final SortableFile b) {
351 return a.fDateValue < b.fDateValue;
352 }
|