@Override public int compare(FolderInfo lhs, FolderInfo rhs) { if (lhs.getNumOfTracks() > rhs.getNumOfTracks()) { return -1; } else if (lhs.getNumOfTracks() < rhs.getNumOfTracks()) { return 1; } else { return 0; } }
@Override public int compare(FolderInfo lhs, FolderInfo rhs) { first_l = lhs.getFolderName().charAt(0); first_r = rhs.getFolderName().charAt(0); if (StringHelper.checkType(first_l) == StringHelper.CharType.CHINESE) { first_l = StringHelper.getPinyinFirstLetter(first_l); } if (StringHelper.checkType(first_r) == StringHelper.CharType.CHINESE) { first_r = StringHelper.getPinyinFirstLetter(first_r); } if (first_l > first_r) { return 1; } else if (first_l < first_r) { return -1; } else { return 0; } }