|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.languagecomputer.api.query.DefaultKeyword
public class DefaultKeyword
Default implementation of a Keyword.
Alternatively, the Keyword interface may be implemented in order
to be backed by a different mechanism (i.e., for speed and/or memory
performance based on the individual system).
| Constructor Summary | |
|---|---|
DefaultKeyword()
|
|
| Method Summary | |
|---|---|
String |
getRawString()
Returns the raw String (unstemmed) for this
Keyword (required). |
double |
getWeight()
Returns the weight for this Keyword (optional operation). |
boolean |
isExact()
Indicates this Keyword should not be stemmed (optional
operation). |
boolean |
isMandatory()
Indicates this Keyword is mandatory (optional operation). |
void |
setIsExact(boolean isExact)
Forces the DefaultKeyword to be exact or not (optional
operation). |
void |
setIsMandatory(boolean isMandatory)
Forces the DefaultKeyword to be mandatory or not (optional
operation). |
void |
setRawString(String rawString)
Sets the raw string of this DefaultKeyword. |
void |
setWeight(double weight)
Sets the weight of this DefaultKeyword (optional operation). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DefaultKeyword()
| Method Detail |
|---|
public void setRawString(String rawString)
DefaultKeyword.
rawString - The non-null String
representation of the keyword.
IllegalArgumentException - If the rawString is
null.public String getRawString()
String (unstemmed) for this
Keyword (required).
getRawString in interface KeywordString representation of this
Keyword.
IllegalStateException - If setRawString(java.lang.String) has not been called.public void setWeight(double weight)
DefaultKeyword (optional operation).
If not called, the default weight is 1.0.
weight - Weight value within range (0.0-1.0].
IllegalArgumentException - If the weight is outside the
expected range.getWeight()public double getWeight()
Keyword (optional operation).
The weight must be on a scale of 0.0 (exclusive) to 1.0 (inclusive). If
determining keyword weights is not possible, a weight of 1.0
should be given.
getWeight in interface KeywordKeyword.public void setIsMandatory(boolean isMandatory)
DefaultKeyword to be mandatory or not (optional
operation). If not called, the default is that the keyword is not
mandatory.
isMandatory - Whether or not the keyword should be mandatory.isMandatorypublic boolean isMandatory()
Keyword is mandatory (optional operation). The
default should be false.
isMandatory in interface Keywordtrue if this Keyword must be included in
any results to a Query, false otherwise.public void setIsExact(boolean isExact)
DefaultKeyword to be exact or not (optional
operation). If not called, the default is that the keyword is not
exact (stemmable).
isExact - Whether or not the keyword should be exact.isExactpublic boolean isExact()
Keyword should not be stemmed (optional
operation). The default should be false.
isExact in interface Keywordtrue if this Keyword should not be
stemmed for searches, false otherwise.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||