Example #1
0
 @Override
 public boolean equals(Object o) {
   if (!(o instanceof KeywordGroup)) {
     return false;
   }
   KeywordGroup other = (KeywordGroup) o;
   return name.equals(other.name)
       && searchField.equals(other.searchField)
       && searchExpression.equals(other.searchExpression)
       && caseSensitive == other.caseSensitive
       && regExp == other.regExp
       && getHierarchicalContext() == other.getHierarchicalContext();
 }
Example #2
0
 @Override
 public boolean contains(BibtexEntry entry) {
   String content = entry.getField(searchField);
   if (content == null) {
     return false;
   }
   if (regExp) {
     return pattern.matcher(content).find();
   }
   if (caseSensitive) {
     return KeywordGroup.containsWord(searchExpression, content);
   }
   return KeywordGroup.containsWord(searchExpression.toLowerCase(), content.toLowerCase());
 }
Example #3
0
 @Override
 public String getDescription() {
   return KeywordGroup.getDescriptionForPreview(
       searchField, searchExpression, caseSensitive, regExp);
 }