|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.languagecomputer.api.query.DefaultQuery
public class DefaultQuery
Default implementation of a Query
.
Alternatively, the Query
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 | |
---|---|
DefaultQuery()
|
Method Summary | |
---|---|
void |
addKeyword(Keyword keyword)
Adds a Keyword to the keyword representation of the
DefaultQuery . |
void |
addRequiredEntityType(String entityType)
Adds an entity type to the required entity type representation of the DefaultQuery . |
Set<Keyword> |
getKeywords()
Returns the keywords for this Query . |
String |
getNaturalLanguage()
Returns the natural language representation for this Query . |
Set<String> |
getRequiredEntityTypes()
Returns the required entity types for this Query . |
String |
getStructuredQuery()
Returns the structured data query for this Query . |
void |
setNaturalLanguage(String naturalLanguage)
Sets the natural language representation for the DefaultQuery . |
void |
setStructuredQuery(String structuredQuery)
Sets the structured query representation for the DefaultQuery . |
String |
toString()
Returns a String representation of a
DefaultQuery . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public DefaultQuery()
Method Detail |
---|
public void setNaturalLanguage(String naturalLanguage)
DefaultQuery
.
Does not need to be called if there is no such representation.
naturalLanguage
- Natural language query, or null
to
indicate none exists.getNaturalLanguage()
public String getNaturalLanguage()
Query
.
This could be a question, a command, or just traditional keywords.
getNaturalLanguage
in interface Query
String
representation of this Query
,
or null
if it has no natural language representation.public void addKeyword(Keyword keyword)
Keyword
to the keyword representation of the
DefaultQuery
. Does not need to be called if there is no such
representation.
keyword
- non-null
Keyword
to add.
IllegalArgumentException
- If the keyword is
null
.getKeywords()
public Set<Keyword> getKeywords()
Query
.
getKeywords
in interface Query
Set
of Keyword
s representing this
Query
, or null
if it has no keyword
representation.public void addRequiredEntityType(String entityType)
DefaultQuery
. Does not need to be called if there is no such
representation.
entityType
- non-null
entity type String
.
IllegalArgumentException
- If the entityType is
null
.getRequiredEntityTypes()
public Set<String> getRequiredEntityTypes()
Query
.
getRequiredEntityTypes
in interface Query
Set
of mandatory entity types representing this
Query
, or null
if it has no required entity
types representation.public void setStructuredQuery(String structuredQuery)
DefaultQuery
.
Does not need to be called if there is no such representation.
structuredQuery
- Structured query, or null
to indicate
none exists.getStructuredQuery()
public String getStructuredQuery()
Query
.
getStructuredQuery
in interface Query
String
-based structured query representing this
Query
, or null
if it has no structured query
representation.public String toString()
String
representation of a
DefaultQuery
.
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |