5367 fix size filter thresholds

This commit is contained in:
William Schaefer 2019-08-13 15:53:34 -04:00
parent 92983a0503
commit 1f027be77c

View File

@ -43,8 +43,7 @@ class FileSearchData {
"FileSearchData.Frequency.count_50.displayName=21 - 50",
"FileSearchData.Frequency.count_100.displayName=51 - 100",
"FileSearchData.Frequency.common.displayName=Common",
"FileSearchData.Frequency.unknown.displayName=Unknown",
})
"FileSearchData.Frequency.unknown.displayName=Unknown",})
enum Frequency {
UNIQUE(0, 1, Bundle.FileSearchData_Frequency_unique_displayName()),
RARE(1, 5, Bundle.FileSearchData_Frequency_rare_displayName()),
@ -122,15 +121,14 @@ class FileSearchData {
"FileSearchData.FileSize.OVER_50MB.displayName=50 - 200 MB",
"FileSearchData.FileSize.OVER_1MB.displayName=1 - 50 MB",
"FileSearchData.FileSize.OVER_100KB.displayName=100 KB - 1 MB",
"FileSearchData.FileSize.UNDER_100KB.displayName=Under 100 KB",
})
"FileSearchData.FileSize.UNDER_100KB.displayName=Under 100 KB",})
enum FileSize {
OVER_1GB(0, 1000 * BYTES_PER_MB, -1, Bundle.FileSearchData_FileSize_OVER_1GB_displayName()),
OVER_200MB(1, 200 * BYTES_PER_MB, 1000, Bundle.FileSearchData_FileSize_OVER_200MB_displayName()),
OVER_50MB(2, 50 * BYTES_PER_MB, 200, Bundle.FileSearchData_FileSize_OVER_50MB_displayName()),
OVER_1MB(3, 1 * BYTES_PER_MB, 50, Bundle.FileSearchData_FileSize_OVER_1MB_displayName()),
OVER_100KB(4, 1000, 1 * BYTES_PER_MB, Bundle.FileSearchData_FileSize_OVER_100KB_displayName()),
UNDER_100KB(5, 0, 1000, Bundle.FileSearchData_FileSize_UNDER_100KB_displayName());
OVER_200MB(1, 200 * BYTES_PER_MB, 1000 * BYTES_PER_MB, Bundle.FileSearchData_FileSize_OVER_200MB_displayName()),
OVER_50MB(2, 50 * BYTES_PER_MB, 200 * BYTES_PER_MB, Bundle.FileSearchData_FileSize_OVER_50MB_displayName()),
OVER_1MB(3, 1 * BYTES_PER_MB, 50 * BYTES_PER_MB, Bundle.FileSearchData_FileSize_OVER_1MB_displayName()),
OVER_100KB(4, 100000, 1 * BYTES_PER_MB, Bundle.FileSearchData_FileSize_OVER_100KB_displayName()),
UNDER_100KB(5, 0, 100000, Bundle.FileSearchData_FileSize_UNDER_100KB_displayName());
private final int ranking; // Must be unique for each value
private final long minBytes; // Note that the size must be strictly greater than this to match
@ -138,11 +136,11 @@ class FileSearchData {
private final String displayName;
final static long NO_MAXIMUM = -1;
FileSize(int ranking, long minMB, long maxMB, String displayName) {
FileSize(int ranking, long minB, long maxB, String displayName) {
this.ranking = ranking;
this.minBytes = minMB;
if (maxMB >= 0) {
this.maxBytes = maxMB;
this.minBytes = minB;
if (maxB >= 0) {
this.maxBytes = maxB;
} else {
this.maxBytes = NO_MAXIMUM;
}
@ -150,8 +148,8 @@ class FileSearchData {
}
/**
* Get the enum corresponding to the given file size.
* The file size must be strictly greater than minBytes.
* Get the enum corresponding to the given file size. The file size must
* be strictly greater than minBytes.
*
* @param size the file size
*
@ -207,10 +205,10 @@ class FileSearchData {
}
/**
* Enum representing the file type.
* We don't simply use FileTypeUtils.FileTypeCategory because:
* - Some file types categories overlap
* - It is convenient to have the "OTHER" option for files that don't match the given types
* Enum representing the file type. We don't simply use
* FileTypeUtils.FileTypeCategory because: - Some file types categories
* overlap - It is convenient to have the "OTHER" option for files that
* don't match the given types
*/
@NbBundle.Messages({
"FileSearchData.FileType.Audio.displayName=Audio",
@ -293,8 +291,7 @@ class FileSearchData {
@NbBundle.Messages({
"FileSearchData.Score.notable.displayName=Notable",
"FileSearchData.Score.interesting.displayName=Interesting",
"FileSearchData.Score.unknown.displayName=Unknown",
})
"FileSearchData.Score.unknown.displayName=Unknown",})
enum Score {
NOTABLE(0, Bundle.FileSearchData_Score_notable_displayName()),
INTERESTING(1, Bundle.FileSearchData_Score_interesting_displayName()),