HiRISE

HiRISE.HiPlan.HiSEAS
Class SimpleObservation.Builder

java.lang.Object
  extended by HiRISE.HiPlan.HiSEAS.SimpleObservation.Builder
Enclosing class:
SimpleObservation

public static class SimpleObservation.Builder
extends Object

A builder for an immutable simple observation.

To use the builder, instantiate it with the observer, target, and ephemeris time, optionally set a label and/or comment, and invoke the build() method. For example, to create a new observation with an Observer called mro of a Target called aramChaos, use the following code:

        SimpleObservation observation = new SimpleObservation.Builder (
                mro,
                aramChaos,
                295272514.521
        ).label ("ESP_013158_1830").comment ("Stereo-1 of Aram Chaos").build ();

If the builder's optional label (or comment) is null, the simple observation's label (or comment) will be set to the empty string ("") at construction; neither will be null.

It is assumed that all necessary SPICE kernels are loaded into the SPICE kernel pool when the observation is constructed; if not, a SpiceException will be thrown.

Version:
1.5
Author:
Christian Schaller - UA/PIRL

Constructor Summary
SimpleObservation.Builder(Observer observer, Target target, double et)
          Creates a new simple observation builder with the indicated observer, target, and ephemeris time.
 
Method Summary
 SimpleObservation build()
          Instantiates a new, immutable simple observation from this builder.
 SimpleObservation.Builder comment(String comment)
          Sets the optional comment for this builder.
 SimpleObservation.Builder label(String label)
          Sets the optional label for this builder.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleObservation.Builder

public SimpleObservation.Builder(Observer observer,
                                 Target target,
                                 double et)
Creates a new simple observation builder with the indicated observer, target, and ephemeris time. The optional label and comment are initially set to the empty string ("").

Parameters:
observer - the observation's observer.
target - the observation's target.
et - the observation's ephemeris time.
Throws:
NullPointerException - if the observer or the target is null.
edu.asu.jmars.layer.obs.mro.SpiceException - if the SPICE kernel pool lacks the necessary kernels for calculating the observation data.
Method Detail

label

public SimpleObservation.Builder label(String label)
Sets the optional label for this builder. If null, the resulting simple observation's label will be the empty string when the build() method is invoked.

Parameters:
label - the observation's optional label.
Returns:
the observation builder.

comment

public SimpleObservation.Builder comment(String comment)
Sets the optional comment for this builder. If null, the resulting simple observation's comment will be the empty string when the build() method is invoked.

Parameters:
comment - the observation's optional comment.
Returns:
the observation builder.

build

public SimpleObservation build()
Instantiates a new, immutable simple observation from this builder. If the builder's label or comment have been set to null, the observation's matching field will be the empty string, not null.

Returns:
a new simple observation.

HiRISE

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