+ float value = ann.value;
+ boolean matched = false;
+
+ /*
+ * filter may have multiple conditions -
+ * these are or'd until a match is found
+ */
+ if (filterParams
+ .getThresholdType() == AnnotationFilterParameter.ThresholdType.ABOVE_THRESHOLD
+ && value > filterParams.getThresholdValue())
+ {
+ matched = true;
+ }
+
+ if (!matched && filterParams
+ .getThresholdType() == AnnotationFilterParameter.ThresholdType.BELOW_THRESHOLD
+ && value < filterParams.getThresholdValue())
+ {
+ matched = true;
+ }
+
+ if (!matched && filterParams.isFilterAlphaHelix()
+ && ann.secondaryStructure == 'H')
+ {
+ matched = true;
+ }
+
+ if (!matched && filterParams.isFilterBetaSheet()
+ && ann.secondaryStructure == 'E')
+ {
+ matched = true;
+ }
+
+ if (!matched && filterParams.isFilterTurn()
+ && ann.secondaryStructure == 'S')
+ {
+ matched = true;
+ }
+
+ String regexSearchString = filterParams.getRegexString();
+ if (!matched && regexSearchString != null)
+ {
+ List<SearchableAnnotationField> fields = filterParams
+ .getRegexSearchFields();
+ for (SearchableAnnotationField field : fields)
+ {
+ String compareTo = field == SearchableAnnotationField.DISPLAY_STRING
+ ? ann.displayCharacter // match 'Label'
+ : ann.description; // and/or 'Description'
+ if (compareTo != null)
+ {
+ try
+ {
+ if (compareTo.matches(regexSearchString))
+ {
+ matched = true;
+ }
+ } catch (PatternSyntaxException pse)
+ {
+ if (compareTo.equals(regexSearchString))
+ {
+ matched = true;
+ }
+ }
+ if (matched)
+ {
+ break;
+ }
+ }
+ }
+ }
+
+ if (matched)