public final class DLinkRecord extends AbstractSsrTransaction implements java.lang.Comparable<DLinkRecord>
DLinkFile
's header contains
the instrument allocations, which may be used to construct
per-instrument SsrDrain
objects from DLinkRecords.
The label
field is optional and not significant. It is
not considered in the equals(Object)
, hashCode()
, or
compareTo(DLinkRecord)
methods.
Modifier and Type | Class and Description |
---|---|
static class |
DLinkRecord.DownlinkBand
An enumeration of the MRO downlink bands.
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_LABEL
The default label for downlink volume records.
|
static java.lang.String |
ID
Class identification name with source code version and date.
|
Constructor and Description |
---|
DLinkRecord(java.lang.String recordText,
java.lang.String label)
Creates a new downlink record from a line of text from an MTT downlink
volume file.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(DLinkRecord s)
Compares one downlink record 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.
|
DLinkRecord.DownlinkBand |
getDownlinkBand()
Gets the record's downlink band.
|
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 record's label.
|
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.
|
SsrDrain |
makeSsrDrain(double dlinkFraction)
Creates an SSR drain from this downlink record.
|
java.lang.String |
toString()
Gets a string representation of this transaction.
|
getDuration, getRate
public static final java.lang.String ID
public static final java.lang.String DEFAULT_LABEL
public DLinkRecord(java.lang.String recordText, java.lang.String label)
DLink Record
is used.recordText
- the text record from the downlink volume file.label
- an optional label for the record; may be null.java.lang.NullPointerException
- if the record text is null.java.lang.IllegalArgumentException
- if the record text is empty or if the
text is not of the correct format.public java.lang.String getLabel()
public DLinkRecord.DownlinkBand getDownlinkBand()
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.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 downlink records with identical start and end times, number
of bits transferred, and downlink bands 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 downlink records are equal if and only if they have the same start date,
end date, bits transferred, and downlink bands. Note that because the getLabel()
field is not significant, it is not included in the
determination. Two downlink records with identical start and end times,
number of bits transferred, and downlink bands 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(DLinkRecord 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, the
getDownlinkBand()
values are compared. If these are the same, then
the two downlink records are considered equal.
In comparing the downlink bands, DLinkRecord.DownlinkBand.X_BAND
is considered
"less than" DLinkRecord.DownlinkBand.KA_BAND
.
Note that because the getLabel()
field is not significant, it is
not included in the calculation.
compareTo
in interface java.lang.Comparable<DLinkRecord>
s
- the downlink record to be compared.public SsrDrain makeSsrDrain(double dlinkFraction)
dlinkFraction
- the fraction of the downlink record's downlink bits
to be used by the SSR drain.Copyright \ (C) Arizona Board of Regents on behalf of the \ Planetary Image Research Laboratory, Lunar and \ Planetary Laboratory at the University of Arizona