public final class SsrInput extends AbstractSsrTransaction implements java.lang.Comparable<SsrInput>
The label
field is optional and not significant. It is
not considered in the equals(Object)
, hashCode()
, or
compareTo(SsrInput)
methods. (This exception applies to the request priority
, request category
, spare 3
, and comment
fields as well.)
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ID
Class identification name with source code version and date.
|
static SsrInput |
LAST_INPUT
An SSR input at the end of Java time.
|
Constructor and Description |
---|
SsrInput(Observation_Record observation)
Creates a new SSR input from a HiRISE observation record.
|
SsrInput(PTF_Record ptfRecord)
Creates a new SSR input from a HiPlan HiRISE PTF record.
|
SsrInput(edu.asu.jmars.layer.obs.mro.PtfObs ptfObs)
Creates a new SSR input from an MTT HiRISE PTF observation.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(SsrInput s)
Compares one SSR input to another.
|
boolean |
equals(java.lang.Object o)
Indicates whether some other object is "equal to" this one.
|
long |
getBits()
Gets the total number of bits transferred in the transaction.
|
java.lang.String |
getComment()
Gets the comment.
|
java.util.Date |
getEndDate()
Gets the end date of the transaction.
|
long |
getEndMillis()
Gets the end date of the transaction in milliseconds.
|
java.lang.String |
getLabel()
Gets the input's label.
|
java.lang.String |
getRequestCategory()
Gets the request category field.
|
java.lang.Integer |
getRequestPriority()
Gets the request priority field.
|
java.lang.Integer |
getSpare3()
Gets the instrument spare 3 field.
|
java.util.Date |
getStartDate()
Gets the start date of the transaction.
|
long |
getStartMillis()
Gets the start date of the transaction in milliseconds.
|
int |
hashCode()
Returns a hash code value for this transaction.
|
java.lang.String |
toString()
Gets a string representation of this transaction.
|
getDuration, getRate
public static final java.lang.String ID
public static final SsrInput LAST_INPUT
Long.MAX_VALUE
, it has no bits (0L), and its label is
INVALID.public SsrInput(Observation_Record observation)
The observation ID is used for the label.
This construction does not match the behavior of the LMA/JPL tool Data Tracker, which uses observation duration field to compute the start of the transaction. The differences are minute (typically around 10 seconds), however, compared to the overall duration of a typical observation.
observation
- the HiRISE observation.java.lang.NullPointerException
- if the observation is null or if
its predict time, observation duration, or delay duration are
null.public SsrInput(PTF_Record ptfRecord)
The team database ID is used for the label.
This construction closely matches the behavior of the LMA/JPL tool Data Tracker.
ptfRecord
- the HiPlan HiRISE PTF record.java.lang.NullPointerException
- if the PTF record is null.java.lang.IllegalArgumentException
- if the predict time, observation
duration, or raw data volume fields contain invalid data.public SsrInput(edu.asu.jmars.layer.obs.mro.PtfObs ptfObs)
The team database ID is used for the label.
This construction closely matches the behavior of the LMA/JPL tool Data Tracker.
ptfObs
- the MTT PTF observation.java.lang.NullPointerException
- if the PTF observation is null.java.lang.IllegalArgumentException
- if the PTF observation is not a HiRISE
observation or if the predict time is an invalid value.public java.lang.String getLabel()
public long getStartMillis()
getStartMillis
in interface SsrTransaction
Date
.public long getEndMillis()
getEndMillis
in interface SsrTransaction
Date
.public long getBits()
getBits
in interface SsrTransaction
public java.lang.Integer getRequestPriority()
public java.lang.String getRequestCategory()
public java.lang.Integer getSpare3()
public java.lang.String getComment()
public java.util.Date getStartDate()
getStartMillis()
value used in the construction of a new Date.public java.util.Date getEndDate()
getEndMillis()
value used in the construction of a new Date.public java.lang.String toString()
getLabel()
is not a significant field, it is included in the string
representation.toString
in class java.lang.Object
public int hashCode()
getLabel()
field is not significant, it is not included in the
calculation. Two SSR inputs with identical start and end times and number of
bits transferred will have identical hash codes, even if they have different
labels.hashCode
in class java.lang.Object
public boolean equals(java.lang.Object o)
Two inputs are equal if and only if they have the same start date, end date,
and bits transferred. Note that because the getLabel()
field is not
significant, it is not included in the determination. Two SSR inputs with
identical start and end times and number of bits transferred will be
"equal," even if they have different labels.
equals
in class java.lang.Object
o
- the object to which this object is compared.public int compareTo(SsrInput s)
getStartMillis()
is less than the other's. If the values are the
same, the getEndMillis()
values are compared. If these are the
same, the getBits()
values are compared. If these are the same,
then the two SSR inputs are considered equal.
Note that because the getLabel()
field is not significant, it is
not included in the calculation.
compareTo
in interface java.lang.Comparable<SsrInput>
s
- the SSR input to be compared.Copyright \ (C) Arizona Board of Regents on behalf of the \ Planetary Image Research Laboratory, Lunar and \ Planetary Laboratory at the University of Arizona