1 20 21 package com.methodhead.util; 22 23 import java.util.Comparator ; 24 import java.io.File ; 25 26 29 public class Comparators { 30 31 33 35 37 private static class FileComparator 38 implements 39 Comparator { 40 41 public int compare( 42 Object o1, 43 Object o2 ) { 44 45 return 46 ( ( File )o1 ).getName().toLowerCase().compareTo( 47 ( ( File )o2 ).getName().toLowerCase() ); 48 } 49 } 50 51 53 54 public static Comparator fileComparator() { 55 return new FileComparator(); 56 } 57 58 60 } 62 | Popular Tags |