public final class SsrDrain extends AbstractSsrTransaction implements java.lang.Comparable<SsrDrain>
The label
field is optional and not significant. It is
not considered in the equals(Object)
, hashCode()
, or
compareTo(SsrDrain)
methods.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_LABEL
The default label for SSR drains.
|
static java.lang.String |
ID
Class identification name with source code version and date.
|
static SsrDrain |
LAST_DRAIN
An SSR drain at the end of Java time.
|
Constructor and Description |
---|
SsrDrain(edu.asu.jmars.layer.obs.mro.DLinkRec dlink,
double dlinkFraction)
Creates a new SSR drain from an MTT downlink record.
|
SsrDrain(DLinkRecord dlinkRecord,
double dlinkFraction)
Creates a new SSR drain from a HiPlan downlink record.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(SsrDrain s)
Compares one SSR drain 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.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 drain'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.
|
java.lang.String |
toString()
Gets a string representation of this transaction.
|
getDuration, getRate
public static final java.lang.String ID
public static final SsrDrain LAST_DRAIN
Long.MAX_VALUE
, it has no bits (0L), and its label is
INVALID.public static final java.lang.String DEFAULT_LABEL
public SsrDrain(edu.asu.jmars.layer.obs.mro.DLinkRec dlink, double dlinkFraction)
The SSR drain is assigned the label SSR Drain
.
dlink
- the MTT downlink record.dlinkFraction
- the fraction of the downlink record's downlink bits
to be used by this SSR drain.java.lang.NullPointerException
- if the downlink record is null.java.lang.IllegalArgumentException
- if the downlink record's start or end
times are invalid.public SsrDrain(DLinkRecord dlinkRecord, double dlinkFraction)
The SSR drain is assigned the label SSR Drain
.
dlinkRecord
- the HiPlan downlink record.dlinkFraction
- the fraction of the downlink record's downlink bits
to be used by this SSR drain.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.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 drains 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 drains 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(SsrDrain 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 drains 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<SsrDrain>
s
- the SSR drain 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