@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(); }
@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()); }
@Override public String getDescription() { return KeywordGroup.getDescriptionForPreview( searchField, searchExpression, caseSensitive, regExp); }