HiRISE

HiRISE.HiPlan.Data_Slacker
Class SsrInput

java.lang.Object
  extended by HiRISE.HiPlan.Data_Slacker.AbstractSsrTransaction
      extended by HiRISE.HiPlan.Data_Slacker.SsrInput
All Implemented Interfaces:
SsrTransaction, Comparable<SsrInput>

public final class SsrInput
extends AbstractSsrTransaction
implements Comparable<SsrInput>

A representation of an input into the MRO SSR, such as an observation. This input does not distinguish between transactions between the MRO raw and framed partitions.

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.)

Version:
1.9
Author:
Christian Schaller - UA/PIRL

Field Summary
static 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 Summary
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.
 
Method Summary
 int compareTo(SsrInput s)
          Compares one SSR input to another.
 boolean equals(Object o)
          Indicates whether some other object is "equal to" this one.
 long getBits()
          Gets the total number of bits transferred in the transaction.
 String getComment()
          Gets the comment.
 Date getEndDate()
          Gets the end date of the transaction.
 long getEndMillis()
          Gets the end date of the transaction in milliseconds.
 String getLabel()
          Gets the input's label.
 String getRequestCategory()
          Gets the request category field.
 Integer getRequestPriority()
          Gets the request priority field.
 Integer getSpare3()
          Gets the instrument spare 3 field.
 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.
 String toString()
          Gets a string representation of this transaction.
 
Methods inherited from class HiRISE.HiPlan.Data_Slacker.AbstractSsrTransaction
getDuration, getRate
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ID

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

See Also:
Constant Field Values

LAST_INPUT

public static final SsrInput LAST_INPUT
An SSR input at the end of Java time. The start and end values are Long.MAX_VALUE, it has no bits (0L), and its label is INVALID.

Constructor Detail

SsrInput

public SsrInput(Observation_Record observation)
Creates a new SSR input from a HiRISE observation record. The input uses the HOGG's model for start and end times: the SSR transaction starts immediately after exposure ends, accounting for actual exposure and delay durations.

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.

Parameters:
observation - the HiRISE observation.
Throws:
NullPointerException - if the observation is null or if its predict time, observation duration, or delay duration are null.

SsrInput

public SsrInput(PTF_Record ptfRecord)
Creates a new SSR input from a HiPlan HiRISE PTF record. The input uses the PTF model for start and end times: the SSR transaction starts half the observation duration after the predict time; HiRISE delay and actual exposure duration are not accounted for in this model.

The team database ID is used for the label.

This construction closely matches the behavior of the LMA/JPL tool Data Tracker.

Parameters:
ptfRecord - the HiPlan HiRISE PTF record.
Throws:
NullPointerException - if the PTF record is null.
IllegalArgumentException - if the predict time, observation duration, or raw data volume fields contain invalid data.

SsrInput

public SsrInput(edu.asu.jmars.layer.obs.mro.PtfObs ptfObs)
Creates a new SSR input from an MTT HiRISE PTF observation. The input uses the PTF model for start and end times: the SSR transaction starts half the observation duration after the predict time; HiRISE delay and actual exposure duration are not accounted for in this model.

The team database ID is used for the label.

This construction closely matches the behavior of the LMA/JPL tool Data Tracker.

Parameters:
ptfObs - the MTT PTF observation.
Throws:
NullPointerException - if the PTF observation is null.
IllegalArgumentException - if the PTF observation is not a HiRISE observation or if the predict time is an invalid value.
Method Detail

getLabel

public String getLabel()
Gets the input's label. Note that the label field is optional and may be null. It is not significant.

Returns:
the label; may be null.

getStartMillis

public long getStartMillis()
Gets the start date of the transaction in milliseconds.

Specified by:
getStartMillis in interface SsrTransaction
Returns:
the transaction start date in milliseconds as defined by Date.

getEndMillis

public long getEndMillis()
Gets the end date of the transaction in milliseconds.

Specified by:
getEndMillis in interface SsrTransaction
Returns:
the transaction end date in milliseconds as defined by Date.

getBits

public long getBits()
Gets the total number of bits transferred in the transaction.

Specified by:
getBits in interface SsrTransaction
Returns:
the number of bits transferred.

getRequestPriority

public Integer getRequestPriority()
Gets the request priority field.

Returns:
the request priorty field; may be null.

getRequestCategory

public String getRequestCategory()
Gets the request category field.

Returns:
the request category field; may be null.

getSpare3

public Integer getSpare3()
Gets the instrument spare 3 field.

Returns:
the instrument spare 3 field; may be null.

getComment

public String getComment()
Gets the comment.

Returns:
the comment; may be null.

getStartDate

public Date getStartDate()
Gets the start date of the transaction. This value is simply the getStartMillis() value used in the construction of a new Date.

Returns:
the transaction's start date.

getEndDate

public Date getEndDate()
Gets the end date of the transaction. This value is simply the getEndMillis() value used in the construction of a new Date.

Returns:
the transaction's end date.

toString

public String toString()
Gets a string representation of this transaction. Although the getLabel() is not a significant field, it is included in the string representation.

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

hashCode

public int hashCode()
Returns a hash code value for this transaction. Note that because the 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.

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

equals

public boolean equals(Object o)
Indicates whether some other object is "equal to" this one.

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.

Overrides:
equals in class Object
Parameters:
o - the object to which this object is compared.
Returns:
true if the objects are equal; false otherwise.

compareTo

public int compareTo(SsrInput s)
Compares one SSR input to another. This input is less than the other if its 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.

Specified by:
compareTo in interface Comparable<SsrInput>
Parameters:
s - the SSR input to be compared.
Returns:
-1, 0, or 1 as this input is less than, equal to, or greater than the specified input.

HiRISE

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