19 package org.sleuthkit.autopsy.keywordsearch;
21 import org.openide.util.NbBundle;
29 private String keywordString;
30 private boolean isLiteral;
31 private boolean isWholeword;
32 private BlackboardAttribute.ATTRIBUTE_TYPE keywordType = null;
39 Keyword(String query,
boolean isLiteral) {
40 this.keywordString = query;
41 this.isLiteral = isLiteral;
42 this.isWholeword =
true;
52 Keyword(String query,
boolean isLiteral,
boolean isWholeword) {
53 this.keywordString = query;
54 this.isLiteral = isLiteral;
55 this.isWholeword = isWholeword;
64 Keyword(String query,
boolean isLiteral, BlackboardAttribute.ATTRIBUTE_TYPE keywordType) {
65 this(query, isLiteral);
66 this.keywordType = keywordType;
69 void setType(BlackboardAttribute.ATTRIBUTE_TYPE keywordType) {
70 this.keywordType = keywordType;
73 BlackboardAttribute.ATTRIBUTE_TYPE getType() {
74 return this.keywordType;
89 boolean isWholeword() {
94 public String toString() {
95 return NbBundle.getMessage(this.getClass(),
"Keyword.toString.text", keywordString, isLiteral, keywordType);
99 public boolean equals(Object obj) {
103 if (getClass() != obj.getClass()) {
106 final Keyword other = (Keyword) obj;
107 if ((this.keywordString == null) ? (other.keywordString != null) : !this.keywordString.equals(other.keywordString)) {
110 if (this.isLiteral != other.isLiteral) {
117 public int hashCode() {
119 hash = 17 * hash + (this.keywordString != null ? this.keywordString.hashCode() : 0);
120 hash = 17 * hash + (this.isLiteral ? 1 : 0);