synchronized(getLock()) { switch (searchOrder) { case DATE_DESCENDING: return mLuceneSortDateDesc; case DATE_ASCENDING: return mLuceneSortDateAsc; case SUBJ_DESCENDING: return mLuceneSortSubjectDesc; case SUBJ_ASCENDING: return mLuceneSortSubjectAsc; case NAME_DESCENDING: return mLuceneSortNameDesc; case NAME_ASCENDING: return mLuceneSortNameAsc; case SCORE_DESCENDING: return null; default: return mLuceneSortDateDesc;
synchronized(getLock()) { if (searchOrder != mLatestSortBy) { switch (searchOrder) { case DATE_DESCENDING: mLatestSort = new Sort(new SortField(LuceneFields.L_DATE, SortField.STRING, true)); mLatestSortBy = searchOrder; break; case DATE_ASCENDING: mLatestSort = new Sort(new SortField(LuceneFields.L_DATE, SortField.STRING, false)); mLatestSortBy = searchOrder; break; case SUBJ_DESCENDING: mLatestSort = new Sort(new SortField(LuceneFields.L_SORT_SUBJECT, SortField.STRING, true)); mLatestSortBy = searchOrder; break; case SUBJ_ASCENDING: mLatestSort = new Sort(new SortField(LuceneFields.L_SORT_SUBJECT, SortField.STRING, false)); mLatestSortBy = searchOrder; break; case NAME_DESCENDING: mLatestSort = new Sort(new SortField(LuceneFields.L_SORT_NAME, SortField.STRING, true)); mLatestSortBy = searchOrder; break; case NAME_ASCENDING: mLatestSort = new Sort(new SortField(LuceneFields.L_SORT_NAME, SortField.STRING, false)); mLatestSortBy = searchOrder; break; case SCORE_DESCENDING: return null; default: mLatestSort = new Sort(new SortField(LuceneFields.L_DATE, SortField.STRING, true)); mLatestSortBy = SortBy.DATE_ASCENDING; }
    Sort getSort(SortBy searchOrder) {        synchronized(getLock()) {                    switch (searchOrder) {                case DATE_DESCENDING:                    return mLuceneSortDateDesc;                case DATE_ASCENDING:                    return mLuceneSortDateAsc;                case SUBJ_DESCENDING:                    return mLuceneSortSubjectDesc;                case SUBJ_ASCENDING:                    return mLuceneSortSubjectAsc;                case NAME_DESCENDING:                    return mLuceneSortNameDesc;                case NAME_ASCENDING:                    return mLuceneSortNameAsc;                case SCORE_DESCENDING:                    return null;                default:                    return mLuceneSortDateDesc;            }        }    }