HiRISE

HiRISE.HiPlan.HiSEAS
Class MroStereoPair.Builder

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

public static class MroStereoPair.Builder
extends Object

A builder for an immutable MRO stereo pair.

To use the builder, instantiate it with the MroObservations, optionally set a label and/or comment, and invoke the build() mthod. For example, to create a new MRO stereo pair from two observations of a Target called aramChaos, one on orbit 13071 and the other on orbit 13137, use the following code:

        MroObservation
                obs1 = new MroObservation.Builder (
                        MroObservation.OrbitalData.findData (aramChaos, 13071)
                ).label ("ESP_013071_1825").comment ("Stereo-1 of Aram Chaos").build ();
        MroObservation
                obs2 = new MroObservation.Builder (
                        MroObservation.OrbitalData.findData (aramChaos, 13137)
                ).label ("ESP_013137_1825").comment ("Stereo-2 of Aram Chaos").build ();
        MroStereoPair
                pair = new MroStereoPair.Builder (
                        obs1,
                        obs2
                ).label ("Aram Chaos Pair").comment ("Candidate").build ();

The two observations must be of the same target site or an IllegalArgumentException is thrown at construction.

Note that the builder is instantiated with MroObservations, so the resulting stereo pair's stereo-1 and stereo-2 will be MRO observations specifically.

Version:
1.7
Author:
Christian Schaller - UA/PIRL

Constructor Summary
MroStereoPair.Builder(MroObservation stereo1, MroObservation stereo2)
          Creates a new MRO stereo pair builder with the indicated MRO observations.
 
Method Summary
 MroStereoPair build()
          Instantiates a new, immutable MRO stereo pair from this builder.
 MroStereoPair.Builder comment(String comment)
          Sets the optional comment for this builder.
 MroStereoPair.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

MroStereoPair.Builder

public MroStereoPair.Builder(MroObservation stereo1,
                             MroObservation stereo2)
Creates a new MRO stereo pair builder with the indicated MRO observations. The optional lanel and comment are initially set to the empty string ("").

Note that the builder is instantiated with MroObservations, so the stereo-1 and stereo-2 observations of the pair to be built will be MRO observations specifically.

Parameters:
stereo1 - the stereo-1 MRO observation.
stereo2 - the stereo-2 MRO observation.
Throws:
NullPointerException - if either of the observations is null.
IllegalArgumentException - if the two observations are not of the same target site.
Method Detail

label

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

Parameters:
label - the stereo pair's optional label.
Returns:
the stereo pair builder.

comment

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

Parameters:
comment - the stereo pair's optional comment.
Returns:
the stereo pair builder.

build

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

Note that the builder is instantiated with MroObservations, so the resulting stereo pair's stereo-1 and stereo-2 will be MRO observations specifically.

Returns:
a new simple stereo pair.

HiRISE

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