|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--org.bioquery.query.QuerySubmitter
This is the abstract root class of the QuerySubmitter. Every database type
should have a custom QuerySubmitter subclass that is returned by
the getQuerySubmitter method. A QuerySubmitter should never be directly
instantiated, but should rather be returned by a call to the
getQuerySubmitter method of a Query object.
A QuerySubmitter has 5 main responsibilities:
A QuerySubmitter's relationship with it's Query is determined
by the querys.xml file, where the subclass of QuerySubmitter
appropriate for each database is listed. When a Query for a specific database is created by the
QueryFactory, it is told the class of it's QuerySubmitter, which it
can then instantiate from it's getQuerySubmitter method.
| Field Summary | |
protected java.util.Date |
endDate
|
protected Query |
myQuery
|
protected java.util.Date |
startDate
|
| Constructor Summary | |
QuerySubmitter()
|
|
| Method Summary | |
static java.lang.String |
convertOperatorCase(java.lang.String initialText,
boolean toUpperCase)
Finds the textual Boolean operators AND, OR, NOT and NEAR surrounded
by spaces and converts them to either uppercase or lowercase. |
abstract java.io.BufferedReader |
getQueryData()
Finds the number of references returned by each line of the Query. |
abstract java.io.BufferedReader |
getQueryResults()
Submits this QuerySubmitter's Query object to the appropriate database and returns a BufferedReader containing the text results. |
static java.lang.String |
parseQueryLine(QueryLine queryLine)
Takes a QueryLine object and returns the queryText for that object with any references to other QueryLines fully expanded into the raw fields and boolean commands that make up the Query. |
void |
resetEndDate()
This method undoes the effects of calling setEndDate. |
void |
resetStartDate()
This method undoes the effects of calling setStartDate. |
boolean |
setEndDate(java.util.Date end)
Sets the ending date for the search. |
protected void |
setInitParams(java.util.HashMap parameters)
Empty method should be overridden in subclasses if custom parameters are used. |
protected void |
setQuery(Query myQuery)
Sets the Query object for this QuerySubmitter. |
boolean |
setStartDate(java.util.Date start)
Sets the starting date for the search. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected Query myQuery
protected java.util.Date startDate
protected java.util.Date endDate
| Constructor Detail |
public QuerySubmitter()
| Method Detail |
protected void setQuery(Query myQuery)
myQuery - The Query object that created this QuerySubmitter.protected void setInitParams(java.util.HashMap parameters)
public static java.lang.String parseQueryLine(QueryLine queryLine)
throws InvalidQueryLineException
queryLine - the QueryLine object whose query text should be
expanded.
public static java.lang.String convertOperatorCase(java.lang.String initialText,
boolean toUpperCase)
AND, OR, NOT and NEAR surrounded
by spaces and converts them to either uppercase or lowercase. This utility lets
subclasses of QuerySubmitter easily convert operators to the case understood by the
database for that subclass. This method only finds the operators if they have spaces on
both sides, and if they are in the same case. It does not find mixed-case operators.initialText - The search text in which all boolean operators should be converted to the
same case.toUpperCase - true if all operators should be converted to uppercase.
false if all operators should be converted to lowercase.
public abstract java.io.BufferedReader getQueryResults()
throws InvalidQueryException,
InvalidQueryLineException
public abstract java.io.BufferedReader getQueryData()
throws InvalidQueryException,
InvalidQueryLineException
public BufferedReader getQueryDate() {
return null;
}
This will have the effect of selectively disabling the ability of the
user to see the item count for each line of their query for that
Query type. Other Query types will not be affected.public boolean setStartDate(java.util.Date start)
Sets the starting date for the search. Results that are "dated" (or
were entered) prior to this date should not be returned when this
submitter runs the getQueryResults
method. This method is typically only used by
the AutoSubmitEngine to retrieve the latest update since
the last automated search. Users can directly control the search dates
by entering the appropriate fields in their queryLines
By default (until this method is called) there is no start date
and results with any entry date may be returned. This state can be
restored with the resetStartDate() method.
If a concrete implementation of QuerySubmitter cannot
utilize these dates in its getQueryResults and
getQueryData methods, it should override this method
to return false.
start - A Date representing the earliest (or
oldest) items that should be returned by any search.true if the start date was successfully set,
false otherwise.public void resetStartDate()
setStartDate.
Resets the start date to null, thus having no start date so results
with any entry date may be returned.public boolean setEndDate(java.util.Date end)
Sets the ending date for the search. Results that are "dated" (or
were entered) after this date should not be returned when this
submitter runs either the getQueryResults method.
By default (until this method is called) there is no end date
and results with any entry date may be returned. This state can be
restored with the resetEndDate() method.
If a concrete implementation of QuerySubmitter cannot
utilize these dates in its getQueryResults and
getQueryData methods, it should override this method
to return false.
end - A Date representing the latest (or
youngest) items that should be returned by any search.true if the end date was successfully set,
false otherwise.public void resetEndDate()
setEndDate.
Resets the end date to null, thus having no end date so results
with any entry date may be returned.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||