Class SearchQuery

java.lang.Object
gov.usgs.earthquake.indexer.SearchQuery
All Implemented Interfaces:
Comparable<SearchQuery>
Direct Known Subclasses:
EventDetailQuery, EventsSummaryQuery, ProductDetailQuery, ProductsSummaryQuery

public abstract class SearchQuery extends Object implements Comparable<SearchQuery>
A search to execute against a ProductIndex, or ProductStorage.
  • Constructor Details

    • SearchQuery

      protected SearchQuery(SearchMethod type, ProductIndexQuery query)
      Construct a new SearchQuery object.
      Parameters:
      type - the type of search.
      query - the query parameters.
  • Method Details

    • getType

      public SearchMethod getType()
      Returns:
      type
    • getProductIndexQuery

      public ProductIndexQuery getProductIndexQuery()
      Returns:
      ProductIndexQuery
    • getResult

      public abstract 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 create
      query - the associated query
      Returns:
      a SearchQuery, or null if type is unknown.
    • equals

      public boolean equals(Object that)
      Overrides:
      equals in class Object
    • compareTo

      public int compareTo(SearchQuery that)
      Specified by:
      compareTo in interface Comparable<SearchQuery>
    • setError

      public void setError(String error)
      Parameters:
      error - the error to set
    • getError

      public String getError()
      Returns:
      the error or null if no error occurred.