HiRISE

HiRISE.HiPlan.HiWeb
Class SuggestedObservation

java.lang.Object
  extended by java.util.AbstractMap<K,V>
      extended by java.util.HashMap
          extended by HiRISE.HiPlan.HiWeb.SuggestedObservation
All Implemented Interfaces:
Serializable, Cloneable, Map

public class SuggestedObservation
extends HashMap
implements Cloneable

Data model for a Suggestion Observation.

Version:
1.48
Author:
Guy McArthur - UA/PIRL
See Also:
Serialized Form

Nested Class Summary
static class SuggestedObservation.PriorityComparator
          A comparator for priority values that sorts them in a preferred order, via their numerical prefix.
 
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
 
Field Summary
static String[] ALLOWED_BINNING
          Maximum allowed binning.
static String APPROVAL_STATUS
           
static String[] APPROVAL_STATUSES
          Approval states.
static String CENTER_LATITUDE
           
static String CENTER_LONGITUDE
           
static String[] COLOR_PRIORITIES
          Color priorities.
static String CRISM_COORDINATION
           
static String DEFAULT_PRIORITY
          Default value for Priority.
static String DEFAULT_PRIORITY_BACKFILL
          Default value for Priority for backfills.
static String DEFAULT_THEME
          Default theme name.
static String DESCRIPTION
           
static String EXACT_AREA_REQUESTED
           
static String[] HIGHRES_PRIORITIES
          Overall priorities.
static String ID
          Class identification name with source code version and date.
static String KEY_ID
           
static String LAST_UPDATE
           
static String MAX_BINNING
           
static String MAX_EMISSION_ANGLE
           
static String MAX_INCIDENCE_ANGLE
           
static String MAX_LATITUDE
           
static String MAX_LONGITUDE
           
static String MAX_LSUBS
           
static String MAX_PHASE_ANGLE
           
static String MIN_EMISSION_ANGLE
           
static String MIN_INCIDENCE_ANGLE
           
static String MIN_LATITUDE
           
static String MIN_LONGITUDE
           
static String MIN_LSUBS
           
static String MIN_PHASE_ANGLE
           
static String NEED_COLOR
           
static String NEED_STEREO
           
static String NONE
          Target name for no target.
static String NULL_VALUE
          The value in a JComboBox that indicates a null should be used in the database record.
static String NUMBER_OF_OBSERVATIONS
           
static String[] OVERALL_PRIORITIES
          Overall priorities.
static String[] PRIORITIES_HICAT
          Suggestion priorities as represented in HiCat.
static String[] PRIORITIES_TEXT
          Suggestion priorities plain text.
static String PRIORITY
           
static String PRIORITY_COLOR
           
static String PRIORITY_HIGHRES
           
static String PRIORITY_OVERALL
           
static String PRIORITY_STEREO
           
static String ROI_VERTICES
           
static String SCIENCE_RATIONALE
           
static String SCIENCE_THEME
           
static String SCIENCE_THEME_ACTION_COMMAND
          The action command associated with the science theme combo box.
static String SECONDARY_THEME
           
static String SECONDARY_THEME_ACTION_COMMAND
          The action command associated with the science theme combo box.
static String SPECIAL_NOTES
           
static String[] STEREO_PRIORITIES
          Stereo priorities.
static String STL_COMMENTS_END
          The end of the STL comment component of the SPECIAL_NOTES.
static String STL_COMMENTS_START
          The start of the STL comment component of the SPECIAL_NOTES.
static String STL_CRISM_COORDINATION
           
static String STL_DESCRIPTION
           
static String STL_HIGH_STABILITY_NADIR
           
static String STL_MAX_BINNING
           
static String STL_MAX_EMISSION_ANGLE
           
static String STL_MAX_INCIDENCE_ANGLE
           
static String STL_MAX_LSUBS
           
static String STL_MAX_PHASE_ANGLE
           
static String STL_MIN_EMISSION_ANGLE
           
static String STL_MIN_INCIDENCE_ANGLE
           
static String STL_MIN_LSUBS
           
static String STL_MIN_PHASE_ANGLE
           
static String STL_MUST_HAVE
           
static String STL_NONINTERACTIVE
           
static String STL_NUMBER_OF_OBSERVATIONS
           
static String STL_OFF_NADIR_IO
           
static String STL_STEREO
           
static String SUGGESTER
           
static String SUGGESTION_DATE
           
static String TARGET_NAME
           
static String[] TARGET_NAMES
          Target names.
static String UNPRIORITIZED
          The value in the PRIORITY list that indicates a suggestion has not been prioritized.
static String VERSION
           
 
Constructor Summary
SuggestedObservation()
          Create a new SuggestedObservation model and view with the fields initialized to default values.
 
Method Summary
 Double centerLatitude()
          Gets the center planetocentric latitude of the suggestion.
 Double centerLongitude()
          Gets the center east-leading longitude of the suggestion.
 void clear()
          Clears and reinitializes the suggested observation UI elements.
 Object clone()
          Returns a clone of this suggestion.
 void enableAllEditableFields(boolean enabled)
           
 void enableEditorFields(boolean enabled)
          Enables or disables those fields that an editor of a suggestion is allowed to change.
 void enableOwnerFields(boolean enabled)
          Enables or disables those fields that the owner of a suggestion is allowed to change.
 void enableOwnerHitsFields(boolean enabled)
          Enables or disables those fields that the owner of a suggestion or the targeting specialists are allowed to change.
 void enableStlFields(boolean enabled)
          Enables or disables those fields that an STL of a suggestion is allowed to change.
 boolean equals(Object object)
          Indicates whether some other object is equal to this suggestion.
 Vector getFields()
          Gets all non-empty field names.
 Object getValue(String key)
          Gets the value given a field name.
 Vector getValues()
          Gets all non-empty values.
 Integer id()
          Gets the suggestion ID.
static boolean isNumericField(String field_name)
          Determines whether a given field name is a field defined as a numeric field in the Suggest_Observations table.
static boolean isYesNoField(String field_name)
          Determines whether a given field name is a field defined as a "yes/no" field in the Suggested_Observations table.
 Double maximumLatitude()
           
 Double maximumLongitude()
           
 Double minimumLatitude()
           
 Double minimumLongitude()
           
static Vector<String> numericFields()
          Gets the collection of numeric field names.
 Parameter parameter()
          Gets the suggestion record as a PVL parameter.
 String roiVertices()
           
 String scienceTheme()
          Gets the value of the science theme field.
 String secondaryTheme()
          Gets the value of the secondary science theme field.
 void setValue(String key, Object val)
          Set the value for a particular field (given by the key, which is the field name).
static void skipFields(String... field_names)
          Sets the collection of fields to be skipped during the equals(java.lang.Object) comparison.
 String suggester()
          Gets the value of the suggester field.
 String targetName()
           
 void targetName(String targetName)
           
 
Methods inherited from class java.util.HashMap
containsKey, containsValue, entrySet, get, isEmpty, keySet, put, putAll, remove, size, values
 
Methods inherited from class java.util.AbstractMap
hashCode, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
hashCode
 

Field Detail

ID

public static final String ID
Class identification name with source code version and date.

See Also:
Constant Field Values

KEY_ID

public static final String KEY_ID
See Also:
Constant Field Values

VERSION

public static final String VERSION
See Also:
Constant Field Values

SUGGESTER

public static final String SUGGESTER
See Also:
Constant Field Values

SCIENCE_THEME

public static final String SCIENCE_THEME
See Also:
Constant Field Values

SECONDARY_THEME

public static final String SECONDARY_THEME
See Also:
Constant Field Values

DESCRIPTION

public static final String DESCRIPTION
See Also:
Constant Field Values

STL_DESCRIPTION

public static final String STL_DESCRIPTION
See Also:
Constant Field Values

SCIENCE_RATIONALE

public static final String SCIENCE_RATIONALE
See Also:
Constant Field Values

SPECIAL_NOTES

public static final String SPECIAL_NOTES
See Also:
Constant Field Values

TARGET_NAME

public static final String TARGET_NAME
See Also:
Constant Field Values

NUMBER_OF_OBSERVATIONS

public static final String NUMBER_OF_OBSERVATIONS
See Also:
Constant Field Values

APPROVAL_STATUS

public static final String APPROVAL_STATUS
See Also:
Constant Field Values

SUGGESTION_DATE

public static final String SUGGESTION_DATE
See Also:
Constant Field Values

MAX_LATITUDE

public static final String MAX_LATITUDE
See Also:
Constant Field Values

CENTER_LATITUDE

public static final String CENTER_LATITUDE
See Also:
Constant Field Values

MIN_LATITUDE

public static final String MIN_LATITUDE
See Also:
Constant Field Values

MAX_LONGITUDE

public static final String MAX_LONGITUDE
See Also:
Constant Field Values

CENTER_LONGITUDE

public static final String CENTER_LONGITUDE
See Also:
Constant Field Values

MIN_LONGITUDE

public static final String MIN_LONGITUDE
See Also:
Constant Field Values

ROI_VERTICES

public static final String ROI_VERTICES
See Also:
Constant Field Values

EXACT_AREA_REQUESTED

public static final String EXACT_AREA_REQUESTED
See Also:
Constant Field Values

NEED_STEREO

public static final String NEED_STEREO
See Also:
Constant Field Values

PRIORITY_STEREO

public static final String PRIORITY_STEREO
See Also:
Constant Field Values

NEED_COLOR

public static final String NEED_COLOR
See Also:
Constant Field Values

PRIORITY_COLOR

public static final String PRIORITY_COLOR
See Also:
Constant Field Values

PRIORITY_HIGHRES

public static final String PRIORITY_HIGHRES
See Also:
Constant Field Values

PRIORITY_OVERALL

public static final String PRIORITY_OVERALL
See Also:
Constant Field Values

PRIORITY

public static final String PRIORITY
See Also:
Constant Field Values

MAX_BINNING

public static final String MAX_BINNING
See Also:
Constant Field Values

STL_MAX_BINNING

public static final String STL_MAX_BINNING
See Also:
Constant Field Values

MAX_EMISSION_ANGLE

public static final String MAX_EMISSION_ANGLE
See Also:
Constant Field Values

MIN_EMISSION_ANGLE

public static final String MIN_EMISSION_ANGLE
See Also:
Constant Field Values

STL_MAX_EMISSION_ANGLE

public static final String STL_MAX_EMISSION_ANGLE
See Also:
Constant Field Values

STL_MIN_EMISSION_ANGLE

public static final String STL_MIN_EMISSION_ANGLE
See Also:
Constant Field Values

MAX_INCIDENCE_ANGLE

public static final String MAX_INCIDENCE_ANGLE
See Also:
Constant Field Values

MIN_INCIDENCE_ANGLE

public static final String MIN_INCIDENCE_ANGLE
See Also:
Constant Field Values

STL_MAX_INCIDENCE_ANGLE

public static final String STL_MAX_INCIDENCE_ANGLE
See Also:
Constant Field Values

STL_MIN_INCIDENCE_ANGLE

public static final String STL_MIN_INCIDENCE_ANGLE
See Also:
Constant Field Values

MAX_LSUBS

public static final String MAX_LSUBS
See Also:
Constant Field Values

MIN_LSUBS

public static final String MIN_LSUBS
See Also:
Constant Field Values

STL_MAX_LSUBS

public static final String STL_MAX_LSUBS
See Also:
Constant Field Values

STL_MIN_LSUBS

public static final String STL_MIN_LSUBS
See Also:
Constant Field Values

MAX_PHASE_ANGLE

public static final String MAX_PHASE_ANGLE
See Also:
Constant Field Values

MIN_PHASE_ANGLE

public static final String MIN_PHASE_ANGLE
See Also:
Constant Field Values

STL_MAX_PHASE_ANGLE

public static final String STL_MAX_PHASE_ANGLE
See Also:
Constant Field Values

STL_MIN_PHASE_ANGLE

public static final String STL_MIN_PHASE_ANGLE
See Also:
Constant Field Values

CRISM_COORDINATION

public static final String CRISM_COORDINATION
See Also:
Constant Field Values

STL_CRISM_COORDINATION

public static final String STL_CRISM_COORDINATION
See Also:
Constant Field Values

STL_HIGH_STABILITY_NADIR

public static final String STL_HIGH_STABILITY_NADIR
See Also:
Constant Field Values

STL_MUST_HAVE

public static final String STL_MUST_HAVE
See Also:
Constant Field Values

STL_NONINTERACTIVE

public static final String STL_NONINTERACTIVE
See Also:
Constant Field Values

STL_NUMBER_OF_OBSERVATIONS

public static final String STL_NUMBER_OF_OBSERVATIONS
See Also:
Constant Field Values

STL_OFF_NADIR_IO

public static final String STL_OFF_NADIR_IO
See Also:
Constant Field Values

STL_STEREO

public static final String STL_STEREO
See Also:
Constant Field Values

LAST_UPDATE

public static final String LAST_UPDATE
See Also:
Constant Field Values

STEREO_PRIORITIES

public static final String[] STEREO_PRIORITIES
Stereo priorities.


COLOR_PRIORITIES

public static final String[] COLOR_PRIORITIES
Color priorities.


OVERALL_PRIORITIES

public static final String[] OVERALL_PRIORITIES
Overall priorities.


HIGHRES_PRIORITIES

public static final String[] HIGHRES_PRIORITIES
Overall priorities.


ALLOWED_BINNING

public static final String[] ALLOWED_BINNING
Maximum allowed binning.


UNPRIORITIZED

public static final String UNPRIORITIZED
The value in the PRIORITY list that indicates a suggestion has not been prioritized. This value translates to a NULL in the database.

See Also:
Constant Field Values

PRIORITIES_HICAT

public static final String[] PRIORITIES_HICAT
Suggestion priorities as represented in HiCat. HiCat treats the PRIORITY field as an enum of verbose values. This string array includes those enums as they appear, with an additional value of UNPRIORITIZED to stand in for Null.

Note: The index of this array is not the numeric value of the priority; it's the priority value + 1.


PRIORITIES_TEXT

public static final String[] PRIORITIES_TEXT
Suggestion priorities plain text. HiCat treats the PRIORITY field as an enum of verbose values. This string array consists of less verbose values, to be mapped to the PRIORITIES_HICAT array. As with the HiCat array, this array includes an additional value of UNPRIORITIZED to stand in for Null.

Note: The index of this array is not the numeric value of the priority; it's the priority value + 1.


DEFAULT_PRIORITY

public static final String DEFAULT_PRIORITY
Default value for Priority.

See Also:
Constant Field Values

DEFAULT_PRIORITY_BACKFILL

public static final String DEFAULT_PRIORITY_BACKFILL
Default value for Priority for backfills.


NONE

public static final String NONE
Target name for no target. This target is to be used when an observation is marked as deleted by a suggester.

See Also:
Constant Field Values

TARGET_NAMES

public static final String[] TARGET_NAMES
Target names.


APPROVAL_STATUSES

public static final String[] APPROVAL_STATUSES
Approval states.


DEFAULT_THEME

public static final String DEFAULT_THEME
Default theme name.

See Also:
Constant Field Values

NULL_VALUE

public static final String NULL_VALUE
The value in a JComboBox that indicates a null should be used in the database record. Presently this value is only used by the STL_MAX_BINNING field's combo box.

See Also:
Constant Field Values

SCIENCE_THEME_ACTION_COMMAND

public static final String SCIENCE_THEME_ACTION_COMMAND
The action command associated with the science theme combo box. When the science theme changes, this command text is attached to the ActionEvent.

See Also:
Constant Field Values

SECONDARY_THEME_ACTION_COMMAND

public static final String SECONDARY_THEME_ACTION_COMMAND
The action command associated with the science theme combo box. When the science theme changes, this command text is attached to the ActionEvent.

See Also:
Constant Field Values

STL_COMMENTS_START

public static final String STL_COMMENTS_START
The start of the STL comment component of the SPECIAL_NOTES.

See Also:
Constant Field Values

STL_COMMENTS_END

public static final String STL_COMMENTS_END
The end of the STL comment component of the SPECIAL_NOTES.

See Also:
Constant Field Values
Constructor Detail

SuggestedObservation

public SuggestedObservation()
Create a new SuggestedObservation model and view with the fields initialized to default values.

Method Detail

clear

public void clear()
Clears and reinitializes the suggested observation UI elements.

Specified by:
clear in interface Map
Overrides:
clear in class HashMap

getFields

public Vector getFields()
Gets all non-empty field names.

Returns:
field names for all fiels with corresponding non-empty values.

getValues

public Vector getValues()
Gets all non-empty values.

Returns:
all non-empty values.

getValue

public Object getValue(String key)
Gets the value given a field name. Text fields have leading and trailing whitespace trimmed from their values.

If a field name isn't valid, an empty string is returned.

Parameters:
key - the field name in question.
Returns:
the value from the component representing that field in the UI.

setValue

public void setValue(String key,
                     Object val)
              throws ParseException
Set the value for a particular field (given by the key, which is the field name).

Parameters:
key - Field name
val - Value to Set
Throws:
ParseException - Invalid value

suggester

public String suggester()
Gets the value of the suggester field. This field is not part of the set of fields available to the getFields() method (or related methods).

Returns:
the suggester.

scienceTheme

public String scienceTheme()
Gets the value of the science theme field. This field is not part of the set of fields available to the getFields() method (or related methods).

Returns:
the science theme.

secondaryTheme

public String secondaryTheme()
Gets the value of the secondary science theme field. This field is not part of the set of fields available to the getFields() method (or related methods).

Returns:
the secondary science theme.

id

public Integer id()
Gets the suggestion ID. If the suggestion has no ID yet, a null is returned.

Returns:
the suggestion ID or null.

centerLatitude

public Double centerLatitude()
Gets the center planetocentric latitude of the suggestion. If the suggestion has no center latitude, a null is returned instead.

Returns:
the center planetocentric latitude or null.

centerLongitude

public Double centerLongitude()
Gets the center east-leading longitude of the suggestion. If the suggestion has no center longitude, a null is returned instead.

Returns:
the center east-leading longitude or null.

minimumLatitude

public Double minimumLatitude()

maximumLatitude

public Double maximumLatitude()

minimumLongitude

public Double minimumLongitude()

maximumLongitude

public Double maximumLongitude()

roiVertices

public String roiVertices()

targetName

public String targetName()

targetName

public void targetName(String targetName)

enableOwnerFields

public void enableOwnerFields(boolean enabled)
Enables or disables those fields that the owner of a suggestion is allowed to change. Text fields are made editable or non-editable instead.

Parameters:
enabled - if true, the owner fields are enabled; otherwise they're disabled.

enableOwnerHitsFields

public void enableOwnerHitsFields(boolean enabled)
Enables or disables those fields that the owner of a suggestion or the targeting specialists are allowed to change. Text fields are made editable or non-editable instead.

Parameters:
enabled - if true, the owner-HiTS fields are enabled; otherwise they're disabled.

enableStlFields

public void enableStlFields(boolean enabled)
Enables or disables those fields that an STL of a suggestion is allowed to change. Text fields are made editable or non-editable instead.

Parameters:
enabled - if true, the STL fields are enabled; otherwise they're disabled.

enableEditorFields

public void enableEditorFields(boolean enabled)
Enables or disables those fields that an editor of a suggestion is allowed to change. Text fields are made editable or non-editable instead. Presently only the STL description field qualifies.

Parameters:
enabled - if true, the editor fields are enabled; otherwise they're disabled.

enableAllEditableFields

public void enableAllEditableFields(boolean enabled)

clone

public Object clone()
Returns a clone of this suggestion.

Overrides:
clone in class HashMap
Returns:
a clone of this suggestion.

equals

public boolean equals(Object object)
Indicates whether some other object is equal to this suggestion. This method returns true if and only if the following are true:
  1. the given object is also a SuggestedObservation,
  2. the two suggestions have the same number of fields, and
  3. each suggestion has the same value for each field.

If any of these is false, this method returns false.

Fields that are in the skipFields(java.lang.String...) set are skipped in the comparison.

Note that this class does not override the AbstractMap.hashCode() method as of this release, so it is in violation of the AbstractMap.hashCode() contract that states that equal objects must have equal hash codes.

Specified by:
equals in interface Map
Overrides:
equals in class AbstractMap
Parameters:
object - the reference object with which to compare.
Returns:
true if this object is the same as the object argument (see above); false otherwise.

skipFields

public static void skipFields(String... field_names)
Sets the collection of fields to be skipped during the equals(java.lang.Object) comparison. No effort is made to ensure that the field names are valid suggestion field names; if a name is not valid, it simply is not checked during the comparison.

The collection of field names to skip is cleared with each invocation of this method; if no input fields names are supplied, then the collection is empty and no fields will be skipped during the comparison.

Parameters:
field_names - the names of the fields to skip.

parameter

public Parameter parameter()
Gets the suggestion record as a PVL parameter.

Returns:
a parameter representing the suggestion.

isYesNoField

public static boolean isYesNoField(String field_name)
Determines whether a given field name is a field defined as a "yes/no" field in the Suggested_Observations table. Such a field is of type ENUM("NO","YES"). Some fields that might logically be represented as JCheckBox GUI elements are "yes/no" fields, and some are defined as TINYINT fields, and it is necessary to distinguish between the two.

Parameters:
field_name - the name of the field in question; it will be coerced to uppercase for comparison.
Returns:
true if the field named is a "yes/no" field, false if not.

isNumericField

public static boolean isNumericField(String field_name)
Determines whether a given field name is a field defined as a numeric field in the Suggest_Observations table. Such fields are allowed to have blank values in the UI, which are represented as null values in the database.


numericFields

public static Vector<String> numericFields()
Gets the collection of numeric field names.

Returns:
the collection of numeric field names.

HiRISE

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