public class SsrState extends java.lang.Object implements java.lang.Comparable<SsrState>
The label
field is optional and not significant. It is
not considered in the equals(Object)
, hashCode()
, or
compareTo(SsrState)
methods.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ID
Class identification name with source code version and date.
|
static java.lang.String |
INITIAL_STATE_LABEL
The label for the SSR initial state when created by the
makeInitialState(Date,long) or makeInitialState(long,long)
methods. |
Constructor and Description |
---|
SsrState(java.util.Date date,
long bits)
Creates a new SSR state at the given sample time and with the given number
of bits in storage.
|
SsrState(java.util.Date date,
long bits,
java.lang.String label)
Creates a new SSR state at the given sample time, with the given number of
bits in storage, and with the given label.
|
SsrState(long dateMillis,
long bits)
Creates a new SSR state at the given time and with the given number of bits
in storage.
|
SsrState(long dateMillis,
long bits,
java.lang.String label)
Creates a new SSR state with the given sample time, with the given number of
bits in storage, and with the given label.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(SsrState s)
Compares one SSR state to another.
|
boolean |
equals(java.lang.Object o)
Indicates whether some other object is "equal to" this one.
|
long |
getBits()
Gets this SSR state's number of bits in storage.
|
java.util.Date |
getDate()
Gets the sample date of this SSR state.
|
long |
getDateMillis()
Gets this SSR state's sample date in milliseconds.
|
java.lang.String |
getLabel()
Gets this SSR state's optional label.
|
int |
hashCode()
Returns a hash code value for this SSR state.
|
static SsrState |
makeInitialState(java.util.Date date,
long bits)
Produces an SSR state with the given sample date and number of bits.
|
static SsrState |
makeInitialState(long millis,
long bits)
Produces an SSR state with the given sample date in milliseconds and number
of bits.
|
java.lang.String |
toString()
Gets a string representation of this SSR state.
|
public static final java.lang.String ID
public static final java.lang.String INITIAL_STATE_LABEL
makeInitialState(Date,long)
or makeInitialState(long,long)
methods.public SsrState(java.util.Date date, long bits, java.lang.String label)
date
- the sample date for this particular SSR state.bits
- the number of bits in storage.label
- an optional label; may be null.public SsrState(java.util.Date date, long bits)
date
- the sample date for this particular SSR state.bits
- the number of bits in storage.public SsrState(long dateMillis, long bits, java.lang.String label)
dateMillis
- the sample date for this particular SSR state, in
milliseconds as defined by Date
.bits
- the number of bits in storage.label
- an optional label; may be null.public SsrState(long dateMillis, long bits)
dateMillis
- the sample date for this particular SSR state, in
milliseconds as defined by Date
.bits
- the number of bits in storage.public long getDateMillis()
Date
.public long getBits()
public java.lang.String getLabel()
public java.util.Date getDate()
getDateMillis()
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 states with identical sample dates and number of bits
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 SSR states are equal if and only if they have the same sample date and
number of bits. Note that because the getLabel()
field is not
significant, it is not included in the determination. Two SSR states with
identical sample dates and number of bits 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(SsrState s)
getDateMillis()
is less than the other's. If the values are the
same, the getBits()
values are compared. If these are the same,
then the two SSR states 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<SsrState>
s
- the SSR state to be compared.public static SsrState makeInitialState(java.util.Date date, long bits)
Initial State
.date
- the sample date for the initial SSR state.bits
- the number of bits.public static SsrState makeInitialState(long millis, long bits)
Initial State
.millis
- the sample date for the initial SSR state in milliseconds as
defined by Date
.bits
- the number of bits.Copyright \ (C) Arizona Board of Regents on behalf of the \ Planetary Image Research Laboratory, Lunar and \ Planetary Laboratory at the University of Arizona