|
|
@ -35,7 +35,7 @@ import java.util.Map; |
|
|
|
public class RecentSearchManager extends XMLFileManager implements AlphaFineSearchProcessor { |
|
|
|
public class RecentSearchManager extends XMLFileManager implements AlphaFineSearchProcessor { |
|
|
|
|
|
|
|
|
|
|
|
private static final String XML_TAG = "AlphafineRecent"; |
|
|
|
private static final String XML_TAG = "AlphafineRecent"; |
|
|
|
private static final int COUNT = 3; |
|
|
|
private static final int MAX_SIZE = 3; |
|
|
|
private static RecentSearchManager recentSearchManager = null; |
|
|
|
private static RecentSearchManager recentSearchManager = null; |
|
|
|
private static File recentFile = null; |
|
|
|
private static File recentFile = null; |
|
|
|
private List<String> fileList; |
|
|
|
private List<String> fileList; |
|
|
@ -250,8 +250,8 @@ public class RecentSearchManager extends XMLFileManager implements AlphaFineSear |
|
|
|
if (ComparatorUtils.equals(key, searchText)) { |
|
|
|
if (ComparatorUtils.equals(key, searchText)) { |
|
|
|
recentModelList = recentKVModelMap.get(searchText); |
|
|
|
recentModelList = recentKVModelMap.get(searchText); |
|
|
|
int size = recentModelList.size(); |
|
|
|
int size = recentModelList.size(); |
|
|
|
if (size > COUNT) { |
|
|
|
if (size > MAX_SIZE) { |
|
|
|
return recentModelList.subList(size - COUNT, size); |
|
|
|
return recentModelList.subList(size - MAX_SIZE, size); |
|
|
|
} |
|
|
|
} |
|
|
|
return recentModelList; |
|
|
|
return recentModelList; |
|
|
|
} |
|
|
|
} |
|
|
|