o2 = temp;
}
// Need to get statistic for comparison
if (!selectedSortOption.equals(SortingType.SortOption.ALPHABETICAL)) {
WordStatistic wordStatistic1;
WordStatistic wordStatistic2;
if (selectedVersionId == null) {
wordStatistic1 = getStatisticsForLocale(o1.getLocaleId());
wordStatistic2 = getStatisticsForLocale(o2.getLocaleId());
} else {
wordStatistic1 =
statisticMap.get(new VersionLocaleKey(
selectedVersionId, o1.getLocaleId()));
wordStatistic2 =
statisticMap.get(new VersionLocaleKey(
selectedVersionId, o2.getLocaleId()));
}
switch (selectedSortOption) {
case PERCENTAGE:
return Double.compare(
wordStatistic1.getPercentTranslated(),
wordStatistic2.getPercentTranslated());
case HOURS:
return Double.compare(wordStatistic1.getRemainingHours(),
wordStatistic2.getRemainingHours());
case WORDS:
return Double.compare(wordStatistic1.getUntranslated(),
wordStatistic2.getUntranslated());
}
} else {
return o1.retrieveDisplayName().compareTo(
o2.retrieveDisplayName());
}