public static class PTF_Record_Table_Model.Uniqueness
extends java.lang.Object
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.
Constructor and Description |
---|
Uniqueness(PTF_Record_Table_Model.ExtendedPtfRecord extendedPtfRecord,
boolean usePointingMode)
Creates a new uniqueness measure from an extended attribute PTF record.
|
Uniqueness(PTF_Record ptfRecord,
boolean usePointingMode)
Creates a new uniqueness measure from a PTF record.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.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.
|
java.lang.Integer |
getSuggestionId()
Gets this uniqueness measure's suggestion ID.
|
int |
hashCode()
Returns a hash code for this uniqueness measure.
|
java.lang.String |
toString()
Returns a string representation of this uniqueness measure.
|
public Uniqueness(PTF_Record ptfRecord, boolean usePointingMode)
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.
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.public Uniqueness(PTF_Record_Table_Model.ExtendedPtfRecord extendedPtfRecord, boolean usePointingMode)
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.
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.public java.lang.Integer getSuggestionId()
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.public FindOrbits.PointingMode getPointingMode()
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.
#PTF_Record_Table_Model.Uniqueness(PTF_Record,boolean)
,
#PTF_Record_Table_Model.Uniqueness(PTF_Record_Table_Model.ExtendedPtfRecord,boolean)
public int hashCode()
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.
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object o)
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.
equals
in class java.lang.Object
o
- the object to compare against this uniqueness measure.#PTF_Record_Table_Model.Uniqueness(PTF_Record,boolean)
,
#PTF_Record_Table_Model.Uniqueness(PTF_Record_Table_Model.ExtendedPtfRecord,boolean)
public java.lang.String toString()
getPointingMode()
, which may be null.toString
in class java.lang.Object
Copyright \ (C) Arizona Board of Regents on behalf of the \ Planetary Image Research Laboratory, Lunar and \ Planetary Laboratory at the University of Arizona