HiRISE

HiRISE.HiPlan.HiSEAS
Class Observer.Builder

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

public static class Observer.Builder
extends Object

A builder for an immutable observer object.

To use the builder, instantiate it with the observers's NAIF ID and reference frame, optionally set a label and/or comment, and invoke the build() method. For example, to create a new MRO observer in the IAU-defined body-fixed Mars reference frame, use the following code:

        Observer mro = new Observer.Builder (
                -74,
                "IAU_MARS"
        ).label ("MRO").comment ("MRO in the IAU body-fixed Mars frame.").build ();

-74 is the NAIF ID code for MRO.

If the label is not set, or if it is null, it will be set to the observer's name, which is derived from its NAIF ID when this builder's build method is invoked.

Version:
1.4
Author:
Christian Schaller - UA/PIRL

Constructor Summary
Observer.Builder(int naifID, String referenceFrame)
          Creates a new observer builder with the indicated NAIF ID and reference frame.
 
Method Summary
 Observer build()
          Instantiates a new, immutable observer from this builder.
 Observer.Builder comment(String comment)
          Sets the optional observer comment for this observer builder.
 Observer.Builder label(String label)
          Sets the optional observer label for this observer builder.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Observer.Builder

public Observer.Builder(int naifID,
                        String referenceFrame)
Creates a new observer builder with the indicated NAIF ID and reference frame.

Parameters:
naifID - the NAIF ID of the observer.
referenceFrame - the observer's reference frame; must not be null.
Throws:
NullPointerException - if the reference frame is null.
Method Detail

label

public Observer.Builder label(String label)
Sets the optional observer label for this observer builder.

If this label is null, the observer that results from invocation of the build() method will have the observer's NAIF ID-derived name as its label.

Parameters:
label - the observer's optional label.
Returns:
this observer builder.

comment

public Observer.Builder comment(String comment)
Sets the optional observer comment for this observer builder.

Parameters:
comment - the observer's optional comment.
Returns:
this observer builder.

build

public Observer build()
Instantiates a new, immutable observer from this builder.

Returns:
a new observer.

HiRISE

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