Package gov.usgs.earthquake.indexer
Class SearchQuery
- java.lang.Object
-
- gov.usgs.earthquake.indexer.SearchQuery
-
- All Implemented Interfaces:
java.lang.Comparable<SearchQuery>
- Direct Known Subclasses:
EventDetailQuery
,EventsSummaryQuery
,ProductDetailQuery
,ProductsSummaryQuery
public abstract class SearchQuery extends java.lang.Object implements java.lang.Comparable<SearchQuery>
A search to execute against a ProductIndex, or ProductStorage.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
SearchQuery(SearchMethod type, ProductIndexQuery query)
Construct a new SearchQuery object.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description int
compareTo(SearchQuery that)
boolean
equals(java.lang.Object that)
java.lang.String
getError()
ProductIndexQuery
getProductIndexQuery()
abstract java.lang.Object
getResult()
Get the result associated with a specific query type.static SearchQuery
getSearchQuery(SearchMethod type, ProductIndexQuery query)
Create a SearchQuery object based on a SearchType.SearchMethod
getType()
void
setError(java.lang.String error)
-
-
-
Constructor Detail
-
SearchQuery
protected SearchQuery(SearchMethod type, ProductIndexQuery query)
Construct a new SearchQuery object.- Parameters:
type
- the type of search.query
- the query parameters.
-
-
Method Detail
-
getType
public SearchMethod getType()
- Returns:
- type
-
getProductIndexQuery
public ProductIndexQuery getProductIndexQuery()
- Returns:
- ProductIndexQuery
-
getResult
public abstract java.lang.Object getResult()
Get the result associated with a specific query type.- Returns:
- the result, or null if the search has not yet executed.
-
getSearchQuery
public static SearchQuery getSearchQuery(SearchMethod type, ProductIndexQuery query)
Create a SearchQuery object based on a SearchType.- Parameters:
type
- the search type to createquery
- the associated query- Returns:
- a SearchQuery, or null if type is unknown.
-
equals
public boolean equals(java.lang.Object that)
- Overrides:
equals
in classjava.lang.Object
-
compareTo
public int compareTo(SearchQuery that)
- Specified by:
compareTo
in interfacejava.lang.Comparable<SearchQuery>
-
setError
public void setError(java.lang.String error)
- Parameters:
error
- the error to set
-
getError
public java.lang.String getError()
- Returns:
- the error or null if no error occurred.
-
-