HiRISE

HiRISE.HiPlan.HiSEAS
Class MroObservation.Orbit

java.lang.Object
  extended by HiRISE.HiPlan.HiSEAS.MroObservation.Orbit
All Implemented Interfaces:
Comparable<MroObservation.Orbit>
Enclosing class:
MroObservation

public static final class MroObservation.Orbit
extends Object
implements Comparable<MroObservation.Orbit>

An immutable MRO orbit. An MRO orbit is characterized by the orbit number and the orbit pass: 13071a, for example, is orbit 13071 on the ascending pass.

The orbit number is simply a positive integer count of the number of times MRO has orbited Mars since orbital insertion.

The pass indicates whether MRO is moving from the south pole north ("ascending") or from the north pole south ("descending"). An ascending pass is indicated with a lowercase a, and a descending pass with a lowercase d.

To instantiate an orbit object, use one of the valueOf static methods.

Version:
1.9
Author:
Christian Schaller - UA/PIRL

Method Summary
 int compareTo(MroObservation.Orbit o)
          Compares this orbit to another orbit.
 boolean equals(Object o)
          Indicates whether some other object is "equal to" this one.
 int getOrbitNumber()
          Gets the orbit number.
 MroObservation.OrbitPass getOrbitPass()
          Gets the orbit pass
 int hashCode()
          Returns a hash code value for this orbit.
 String toString()
          Gets a string representation of this orbit.
static MroObservation.Orbit valueOf(int orbitNumber, MroObservation.OrbitPass orbitPass)
          Creates a new, immutable orbit from a non-negative integer orbit number and an orbit pass.
static MroObservation.Orbit valueOf(String text)
          Creates a new, immutable orbit from an element of text.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

getOrbitNumber

public int getOrbitNumber()
Gets the orbit number.

Returns:
the orbit number.

getOrbitPass

public MroObservation.OrbitPass getOrbitPass()
Gets the orbit pass

Returns:
the orbit pass.

toString

public String toString()
Gets a string representation of this orbit. The string consists of the orbit number followed by a lowercase character indicating the pass: a for an ascending pass and d for a descending pass.

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

hashCode

public int hashCode()
Returns a hash code value for this orbit.

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

equals

public boolean equals(Object o)
Indicates whether some other object is "equal to" this one. Two orbits are equal if they have the same orbit number and the same orbit pass.

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(MroObservation.Orbit o)
Compares this orbit to another orbit. This orbit is less than the other orbit if its orbit number is less than the other's. If the orbit numbers are the same, this orbit is less than the other if its orbit pass is MroObservation.OrbitPass.ASCENDING and the other's is MroObservation.OrbitPass.DESCENDING.

Specified by:
compareTo in interface Comparable<MroObservation.Orbit>
Parameters:
o - the orbit to be compared.
Returns:
-1, 0, or 1 as this orbit is less than, equal to, or greater than the specified orbit.

valueOf

public static MroObservation.Orbit valueOf(int orbitNumber,
                                           MroObservation.OrbitPass orbitPass)
Creates a new, immutable orbit from a non-negative integer orbit number and an orbit pass.

Parameters:
orbitNumber - the orbit number, which must be non-negative.
orbitPass - the orbit pass.
Returns:
a new orbit.
Throws:
IllegalArgumentException - if the orbit number is negative.

valueOf

public static MroObservation.Orbit valueOf(String text)
Creates a new, immutable orbit from an element of text. The text must consist of a positive integer (orbit number) followed by either an "a" or a "d" (orbit pass).

Parameters:
text - the orbit text to parse.
Returns:
a new orbit.
Throws:
IllegalArgumentException - if the text does not parse to a valid orbit (a positive integer followed by an "a" or a "d").

HiRISE

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