HiRISE

HiRISE.HiPlan.PTF
Class PTF_Record_Table_Model.Uniqueness

java.lang.Object
  extended by HiRISE.HiPlan.PTF.PTF_Record_Table_Model.Uniqueness
Enclosing class:
PTF_Record_Table_Model

public static class PTF_Record_Table_Model.Uniqueness
extends Object

A measure of uniqueness for a PTF record. This measure uses the HiRISE suggestion ID and—optionally—whether the observation is nadir or off-nadir. Two HiRISE PTF records with the same uniqueness measure may be considered duplicates of one another, even if other fields are different.

Note that if a record's uniqueness has been measured without considering its pointing, then the value for getPointingMode() is null. If such a uniqueness is then compared to a uniqueness measure that does include its pointing, that comparison (equals(Object)) will be false, regardless of the other values. If pointing is to be considered, it should thus be considered for all records in a set.

Non-HiRISE records will have a non-null uniqueness, but each attribute of that uniqueness will be null. All non-HiRISE records are therefore "duplicates" of one another by this measure—their uniqueness values are the same. This uniqueness measure is really not intended for use with non-HiRISE records.

Version:
1.24
Author:
Christian Schaller - UA/PIRL

Constructor Summary
PTF_Record_Table_Model.Uniqueness(PTF_Record_Table_Model.ExtendedPtfRecord extendedPtfRecord, boolean usePointingMode)
          Creates a new uniqueness measure from an extended attribute PTF record.
PTF_Record_Table_Model.Uniqueness(PTF_Record ptfRecord, boolean usePointingMode)
          Creates a new uniqueness measure from a PTF record.
 
Method Summary
 boolean equals(Object o)
          Compares this uniqueness measure to the specified object.
 FindOrbits.PointingMode getPointingMode()
          Returns the pointing mode (nadir or off-nadir) of this uniqueness measure.
 Integer getSuggestionId()
          Gets this uniqueness measure's suggestion ID.
 int hashCode()
          Returns a hash code for this uniqueness measure.
 String toString()
          Returns a string representation of this uniqueness measure.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PTF_Record_Table_Model.Uniqueness

public PTF_Record_Table_Model.Uniqueness(PTF_Record ptfRecord,
                                         boolean usePointingMode)
Creates a new uniqueness measure from a PTF record. If the record is null or if it is a non-HiRISE record, the individual elements of the measure will be null.

The measure's suggestion ID is taken preferentially from the PTF_Record.team_database_id() field. If the field does not contain a suggestion ID, it is taken from the PTF_Record.comment() field instead. If it, too, has no suggestion ID, the measure's ID is set to null.

If usePointingMode is true, the value of getPointingMode() is taken from the PTF_Record.observation_type() field. If the observation type is 0 or 5, its value is FindOrbits.PointingMode.NADIR. If it is 1, 2, 3, or 4, its value is FindOrbits.PointingMode.TARGETED. If the field is empty or cannot be parsed as a number, the value is null. If usePointingMode is false, then the value of getPointingMode() is null.

Parameters:
ptfRecord - a standard PTF record, which may be null.
usePointingMode - if true, a record's nadir vs. off-nadir pointing will be included; if false, it will not.

PTF_Record_Table_Model.Uniqueness

public PTF_Record_Table_Model.Uniqueness(PTF_Record_Table_Model.ExtendedPtfRecord extendedPtfRecord,
                                         boolean usePointingMode)
Creates a new uniqueness measure from an extended attribute PTF record. If the record is null or if it is a non-HiRISE record, the individual elements of the measure will be null.

The measure's suggestion ID is taken preferentially from the PTF_Record.team_database_id() field. If the field does not contain a suggestion ID, it is taken from the PTF_Record.comment() field instead. If it, too, has no suggestion ID, the measure's ID is set to null.

If usePointingMode is true, the value of getPointingMode() is taken from the PTF_Record.observation_type() field. If the observation type is 0 or 5, its value is FindOrbits.PointingMode.NADIR. If it is 1, 2, 3, or 4, its value is FindOrbits.PointingMode.TARGETED. If the field is empty or cannot be parsed as a number, the value is null. If usePointingMode is false, then the value of getPointingMode() is null.

Parameters:
extendedPtfRecord - an extended attribute PTF record, which may be null.
usePointingMode - if true, a record's nadir vs. off-nadir pointing will be included; if false, it will not.
Method Detail

getSuggestionId

public Integer getSuggestionId()
Gets this uniqueness measure's suggestion ID. The suggestion ID is taken preferentially from the PTF_Record.team_database_id() field of the PTF record from which this uniqueness measure was constructed. If the field does not contain a suggestion ID, it is taken from the PTF_Record.comment() field instead. If it, too, has no suggestion ID, this method returns null.

Returns:
the suggestion ID, which may be null.

getPointingMode

public FindOrbits.PointingMode getPointingMode()
Returns the pointing mode (nadir or off-nadir) of this uniqueness measure. An observation is nadir (FindOrbits.PointingMode.NADIR) if the PTF_Record.observation_type() field is 0 or 5. An observation is off-nadir (FindOrbits.PointingMode.TARGETED) if the observation type is 1, 2, 3, or 4.

This method returns null if the observation type field is empty or cannot be parsed for the PTF record from which this uniqueness was constructed. This method also returns null if this uniqueness was constructed with usePointingMode set to false, regardless of the contents of the observation type field.

Returns:
the pointing mode, which may be null.
See Also:
PTF_Record_Table_Model.Uniqueness(PTF_Record,boolean), PTF_Record_Table_Model.Uniqueness(PTF_Record_Table_Model.ExtendedPtfRecord,boolean)

hashCode

public int hashCode()
Returns a hash code for this uniqueness measure. The hash code is based on the values for getSuggestionId() and getPointingMode().

Note that a non-HiRISE PTF record will have a non-null uniqueness, but that each of the aforementioned fields will be null. Consequently, the hash code for any given non-HiRISE PTF record's uniqueness will be the same as the hash code for any other non-HiRISE PTF record's uniqueness. This uniqueness measure is really not intended for use with non-HiRISE records.

Overrides:
hashCode in class Object
Returns:
a hash code value for this object.

equals

public boolean equals(Object o)
Compares this uniqueness measure to the specified object. The result is true if and only if the argument is not null and is a uniqueness measure with the same suggestion ID and nadir/off-nadir pointing (getPointingMode()).

Note that if this uniqueness measure was constructed with usePointingMode set to false, then the pointing value is null regardless of whether the observation is nadir or off-nadir. That is, if uniqueness alpha is constructed from suggestion ID 10240 without considering pointing, and if uniqueness beta is constructed from suggestion ID 10240 but with pointing included, then alpha.equals(beta) is false, even if each source observation is a nadir observation.

Two uniqueness measures should therefore be compared only if they both considered pointing or if neither considered pointing. In other words, if pointing is considered, it should be considered for all records in a set.

Note also that a non-HiRISE observation will have a non-null uniqueness measure, but that each field is null. All non-HiRISE observations thus have the same uniqueness measure. For nadir ELECTRA observation gamma and off-nadir CTX observation delta, gamma.equals(delta) is true. This uniqueness measure is really not intended for use with non-HiRISE records.

Overrides:
equals in class Object
Parameters:
o - the object to compare against this uniqueness measure.
Returns:
true if the objects are equal, false otherwise.
See Also:
PTF_Record_Table_Model.Uniqueness(PTF_Record,boolean), PTF_Record_Table_Model.Uniqueness(PTF_Record_Table_Model.ExtendedPtfRecord,boolean)

toString

public String toString()
Returns a string representation of this uniqueness measure. The string displays the suggestion ID, the longitude, the latitude, and the value of getPointingMode(), which may be null.

Overrides:
toString in class Object
Returns:
a string representation of this measure.

HiRISE

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