HiRISE

HiRISE.HiCat.HiTList
Interface SearchInterface

All Known Implementing Classes:
AllTargetsList, FirstHalfStereoList, HighStabilityNadirList, HighStabilityNIOList, NoninteractiveObservationsList, OffNadirIOList, SecondHalfStereoList, TargetList

public interface SearchInterface

The Target_Search interface defines the methods that need to be implemented to search and retrieve lists of targets. Classes that implement this interface may implement various restrictions depending on the specifics of the type of searches to be performed and the target lists that need to be created.

Author:
Rodney Heyd UA/HiRISE

Field Summary
static String ID
           
static String IGNORE_FILTER_UPDATES_NAME
           
static String MAX_LATITUDE_FIELDNAME
           
static String MAX_LONG_FIELDNAME
           
static String MAX_LSUBS_FIELDNAME
           
static String MIN_LATITUDE_FIELDNAME
           
static String MIN_LONG_FIELDNAME
           
static String MIN_LSUBS_FIELDNAME
           
static String PRIORITY_LISTNAME
           
static String ROW_LIMIT_ENABLENAME
           
static String ROW_LIMIT_FIELDNAME
           
static String SCIENCE_THEME_LISTNAME
           
static String SPECIAL_TARGETS_ADDED_PROPERTY
           
static String SPECIAL_TARGETS_REMOVED_PROPERTY
           
static String THEME_COUNT_FIELDNAME
           
 
Method Summary
 Vector<Integer> addedSuggestionsNotFound()
          If any of the suggestions ID's found in the list passed to the addSuggestions(Vector) were not found, they will be in the Vector of Integers returned by this method.
 void addSuggestions(Vector<Integer> add_list)
          A list of suggestions that should be included in the list.
 String constructSearchQuery()
          Constructs the base search query specific to the list being generated.
 String constructSecondaryQuery()
          Constructs the secondary query that will query for special target requests to add to the search list.
 void enableRowLimits(boolean enable_row_limits)
          Enable or disable row limits.
 Vector<Vector<String>> executeAddedSuggestionsSearch(Vector<Vector<String>> dataTable)
          This method executes a secondary database search for special targets.
 Vector<Vector<String>> executeSearch()
          A method executing a database search for suggested targets, and will usually execure the query returned by the constructSearchQuery() method.
 Vector<Integer> getAddedSuggestions()
          Returns the list of specially added suggestions.
 double getMaximumLatitude()
          Get the current setting of the maximum latitude
 double getMaximumLongitude()
          Get the current maximum longitude setting.
 double getMaximumLs()
          Get the current maximum solar longitude setting.
 double getMinimumLatitude()
          Get the current minimum latitude setting.
 double getMinimumLongitude()
          Get the current minimum longitude setting
 double getMinimumLs()
          Get the current minimum solar longitude setting.
 boolean getRetrieveNearestNeighborList()
          Indicates if the nearest neighbor list should be generated.
 int getRowLimit()
          Get the current row limit setting.
 Vector<PriorityList> getSelectedPriorities()
          The list of priorities currently selected for the list.
 Vector<String> getSelectedScienceThemes()
          Get the list of science themes currently selected for the list.
 int getSuggestionsPerThemeLimit()
          Get the current suggestions per theme limit
 boolean hasRowLimitsEnabled()
          Indicates if row limits have been enabled.
 void initOrderingSettings(Configuration config)
          The column ordering controls are expected to be set for the entire session based on the hard-coded defaults, or by reading the settings from a configuration.
 void setMaximumLatitude(double max_latitude)
          Sets the maximum latitude of the search region.
 void setMaximumLongitude(double max_longitude)
          Sets the maximum longitude of the search region for which targets will be searched for in the search query.
 void setMaximumLs(double maxLs)
          Sets the maximum solar longitude that targets must overlap or be less than to be included in the list.
 void setMinimumLatitude(double min_latitude)
          Sets the minimum latitude of the search region for which targets will be searched for in the search query.
 void setMinimumLongitude(double min_longitude)
          Sets the minimum longitude of the search region for which targets will be searched for in the search query.
 void setMinimumLs(double minLs)
          Sets the minimum solar longitude that targets must overlap to be included in the list.
 void setPriorities(Vector<PriorityList> priorities)
          The list of priorities to be included in the list.
 void setRetrieveNearestNeighborList(boolean include_nearest)
          Setting to optionally include the nearest neighbor list.
 void setRowLimit(int row_limit)
          Set the maximum number of records (targets) to retrieve from the database.
 void setScienceThemes(Vector<String> theme_list)
          Sets the science themes to be included in the search.
 void setSuggestionsPerThemeLimit(int suggestions_per_theme)
          Sets the maximum number of suggestions per science theme that can appear in the list.
 Vector<Vector<String>> updateAddedSuggestions(Vector<Vector<String>> dataTable)
          Update the input dataTable with additional targets.
 

Field Detail

ID

static final String ID
See Also:
Constant Field Values

PRIORITY_LISTNAME

static final String PRIORITY_LISTNAME
See Also:
Constant Field Values

SCIENCE_THEME_LISTNAME

static final String SCIENCE_THEME_LISTNAME
See Also:
Constant Field Values

MIN_LATITUDE_FIELDNAME

static final String MIN_LATITUDE_FIELDNAME
See Also:
Constant Field Values

MAX_LATITUDE_FIELDNAME

static final String MAX_LATITUDE_FIELDNAME
See Also:
Constant Field Values

MIN_LONG_FIELDNAME

static final String MIN_LONG_FIELDNAME
See Also:
Constant Field Values

MAX_LONG_FIELDNAME

static final String MAX_LONG_FIELDNAME
See Also:
Constant Field Values

MIN_LSUBS_FIELDNAME

static final String MIN_LSUBS_FIELDNAME
See Also:
Constant Field Values

MAX_LSUBS_FIELDNAME

static final String MAX_LSUBS_FIELDNAME
See Also:
Constant Field Values

ROW_LIMIT_FIELDNAME

static final String ROW_LIMIT_FIELDNAME
See Also:
Constant Field Values

ROW_LIMIT_ENABLENAME

static final String ROW_LIMIT_ENABLENAME
See Also:
Constant Field Values

IGNORE_FILTER_UPDATES_NAME

static final String IGNORE_FILTER_UPDATES_NAME
See Also:
Constant Field Values

THEME_COUNT_FIELDNAME

static final String THEME_COUNT_FIELDNAME
See Also:
Constant Field Values

SPECIAL_TARGETS_ADDED_PROPERTY

static final String SPECIAL_TARGETS_ADDED_PROPERTY
See Also:
Constant Field Values

SPECIAL_TARGETS_REMOVED_PROPERTY

static final String SPECIAL_TARGETS_REMOVED_PROPERTY
See Also:
Constant Field Values
Method Detail

constructSearchQuery

String constructSearchQuery()
Constructs the base search query specific to the list being generated.

Note: Many of the setters defined in this search interface are search criteria that are used to construct this query.

Returns:
An SQL search query string
See Also:
setMinimumLongitude(double), setMaximumLongitude(double), setMinimumLatitude(double), setMaximumLatitude(double), setMinimumLs(double), setMaximumLs(double), setPriorities(Vector), setScienceThemes(Vector), setSuggestionsPerThemeLimit(int), enableRowLimits(boolean), setRowLimit(int), setRetrieveNearestNeighborList(boolean)

constructSecondaryQuery

String constructSecondaryQuery()
Constructs the secondary query that will query for special target requests to add to the search list. This query is similar to the primary search query, however, all of the various restrictions on location, season, priority, theme, etc are ignored.

Returns:
An SQL search query string

executeSearch

Vector<Vector<String>> executeSearch()
                                     throws Database_Exception
A method executing a database search for suggested targets, and will usually execure the query returned by the constructSearchQuery() method. Note that many of the getter and setters defined as part of the search interface are used as parameters to define the search criteria

Returns:
A vector of vector strings representing the data table.
Throws:
Database_Exception - if an error occurs during query execution

executeAddedSuggestionsSearch

Vector<Vector<String>> executeAddedSuggestionsSearch(Vector<Vector<String>> dataTable)
                                                     throws Database_Exception
This method executes a secondary database search for special targets. This method will generally use the same base query and restrictions for a given target list type, however any seasonal, coordinate, theme, or priority constraints will be ignored. For example, an added suggestion that is a stereo still won't appear in a non-stereo list, however a added stereo suggestion with seasonal constraints outside the bounds of the settings in the GUI will still appear in the final list.

Parameters:
dataTable - - the dataTable to add the suggestion records to
Returns:
the list of added suggestions applicable for the current list type.
Throws:
Database_Exception

updateAddedSuggestions

Vector<Vector<String>> updateAddedSuggestions(Vector<Vector<String>> dataTable)
                                              throws Database_Exception
Update the input dataTable with additional targets.

Parameters:
dataTable - - the dataTable to update
Returns:
the updated dataTable
Throws:
Database_Exception - if an error occurs during the database interaction

setMinimumLongitude

void setMinimumLongitude(double min_longitude)
Sets the minimum longitude of the search region for which targets will be searched for in the search query. Defaults to 0.

Parameters:
min_longitude -
See Also:
constructSearchQuery()

getMinimumLongitude

double getMinimumLongitude()
Get the current minimum longitude setting

Returns:
the current minimum longitude as a double

setMaximumLongitude

void setMaximumLongitude(double max_longitude)
Sets the maximum longitude of the search region for which targets will be searched for in the search query. Defaults to 360.

Parameters:
max_longitude -
See Also:
constructSearchQuery()

getMaximumLongitude

double getMaximumLongitude()
Get the current maximum longitude setting.

Returns:
the current maximum longitude as a double.

setMinimumLatitude

void setMinimumLatitude(double min_latitude)
Sets the minimum latitude of the search region for which targets will be searched for in the search query. Defaults to -90.

Parameters:
min_latitude -
See Also:
constructSearchQuery()

getMinimumLatitude

double getMinimumLatitude()
Get the current minimum latitude setting.

Returns:
the minimum latitidue as a double.

setMaximumLatitude

void setMaximumLatitude(double max_latitude)
Sets the maximum latitude of the search region. Defaults to +90

Parameters:
max_latitude -
See Also:
constructSearchQuery()

getMaximumLatitude

double getMaximumLatitude()
Get the current setting of the maximum latitude

Returns:
the current maximum latitude as a double.

setMinimumLs

void setMinimumLs(double minLs)
Sets the minimum solar longitude that targets must overlap to be included in the list. Defaults to 0.

Parameters:
minLs -
See Also:
constructSearchQuery()

getMinimumLs

double getMinimumLs()
Get the current minimum solar longitude setting.

Returns:
the current minimum longitude as a double.

setMaximumLs

void setMaximumLs(double maxLs)
Sets the maximum solar longitude that targets must overlap or be less than to be included in the list. Defaults to 360.

Parameters:
maxLs -
See Also:
constructSearchQuery()

getMaximumLs

double getMaximumLs()
Get the current maximum solar longitude setting.

Returns:
the current maximum solar longitude as a double.

setSuggestionsPerThemeLimit

void setSuggestionsPerThemeLimit(int suggestions_per_theme)
Sets the maximum number of suggestions per science theme that can appear in the list. If set to a value of 0, no limits to the number of targets per theme will be enforced.

When the search results contain more than this number of targets in a theme, the additional targets will be discarded. Note that precisely which targets will be included may be significantly impacted by the order at which they come out of the database and any limits placed on the total number of targets to retrieve.

Parameters:
suggestions_per_theme - - an integer value, Default 0.
See Also:
constructSearchQuery(), initOrderingSettings(Configuration), enableRowLimits(boolean), setRowLimit(int)

getSuggestionsPerThemeLimit

int getSuggestionsPerThemeLimit()
Get the current suggestions per theme limit

Returns:
An integer value indicating the current limit
See Also:
setSuggestionsPerThemeLimit(int)

setRowLimit

void setRowLimit(int row_limit)
Set the maximum number of records (targets) to retrieve from the database.

Parameters:
row_limit - - an integer
See Also:
constructSearchQuery()

getRowLimit

int getRowLimit()
Get the current row limit setting.

Returns:
- an integer containing the row limit setting.

enableRowLimits

void enableRowLimits(boolean enable_row_limits)
Enable or disable row limits. Set to true to enable row limits. If set to false, the row limit setting will be ignored. Default: true

Parameters:
enable_row_limits -
See Also:
constructSearchQuery(), setRowLimit(int)

hasRowLimitsEnabled

boolean hasRowLimitsEnabled()
Indicates if row limits have been enabled. If true the value of the getRowLimit() method will be passed to the database to determine the total number of targets retrieved from the database.

Returns:
true if enabled, false otherwise.
See Also:
setRowLimit(int)

setScienceThemes

void setScienceThemes(Vector<String> theme_list)
Sets the science themes to be included in the search. Only targets with primary themes that appear on this will be included in the search results.

Parameters:
theme_list - a Vector of Strings containing the list of allowed science themes.
See Also:
constructSearchQuery()

getSelectedScienceThemes

Vector<String> getSelectedScienceThemes()
Get the list of science themes currently selected for the list.

Returns:
a Vector of Strings containing the selected science themes.

setPriorities

void setPriorities(Vector<PriorityList> priorities)
The list of priorities to be included in the list. Only targets having priorities that match those in the list will be included in the search results.

Note: if priority 10 is included, targets with priorities greater than 10 will also be included.

Parameters:
priorities - - A Vector of Strings holding the set of priorities to include.
See Also:
constructSearchQuery()

getSelectedPriorities

Vector<PriorityList> getSelectedPriorities()
The list of priorities currently selected for the list.

Returns:
a Vector of PriorityList items

initOrderingSettings

void initOrderingSettings(Configuration config)
                          throws Configuration_Exception
The column ordering controls are expected to be set for the entire session based on the hard-coded defaults, or by reading the settings from a configuration. If the configuration doesn't not contain the appropriate parameters, then the hard-coded defaults will be used.

To override this ordering, add a HiTList group to the configuration file, and specify the ordering fields as defined in the OrderingFields enum in the order that the columns should be ordered, eg:

GROUP = HiTList
GROUP = ORDERING_COLUMNS
THEME=ASC
PRIORITY_SECOND=DESC
ID_SECOND=ASC
END_GROUP
END_GROUP

Parameters:
config - A configuration that may contain column ordering information.
Throws:
Configuration_Exception
See Also:
constructSearchQuery(), TargetList.OrderingFields

setRetrieveNearestNeighborList

void setRetrieveNearestNeighborList(boolean include_nearest)
Setting to optionally include the nearest neighbor list. If set to true, this list will be one of the columns in the "CIPP" spreadsheet, but will not be included in the PTF. If set to false, the list will not be included, and the time to process the search results should improve by about 30%. Defaults to false.

Parameters:
include_nearest - a boolean value to indicate if the nearest neighbor list should be created and added to the data table.

getRetrieveNearestNeighborList

boolean getRetrieveNearestNeighborList()
Indicates if the nearest neighbor list should be generated.

Returns:
true if enabled, false otherwise. Defaults to false.

addSuggestions

void addSuggestions(Vector<Integer> add_list)
A list of suggestions that should be included in the list. The target ids found in this list will be included in the list even if they are outside of any latitude, longitude, LS, Priority, or Science Theme limits set. However, the listed targets may still not appear if they do not match the criteria for being included in the particular list type, or if the targets have been retired. In such cases, the targets that were not included can be determined by checking the vector returned by the addedSuggestionsNotFound() method after the call to executeSearch() has completed.

Parameters:
add_list - A Vector of Integer suggestion IDs.
See Also:
addedSuggestionsNotFound()

getAddedSuggestions

Vector<Integer> getAddedSuggestions()
Returns the list of specially added suggestions.

Returns:
a Vector of Integer suggestion Ids.
See Also:
addSuggestions(Vector)

addedSuggestionsNotFound

Vector<Integer> addedSuggestionsNotFound()
If any of the suggestions ID's found in the list passed to the addSuggestions(Vector) were not found, they will be in the Vector of Integers returned by this method.

Returns:
A Vector of Integers found in the addSuggestions(Vector) list that weren't included in the final list.
See Also:
addSuggestions(Vector)

HiRISE

Copyright (C) Arizona Board of Regents on behalf of the Planetary Image Research Laboratory, Lunar and Planetary Laboratory at the University of Arizona