HiRISE

HiRISE.HiPlan.HiSEAS
Class SimpleStereoPair.Builder

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

public static class SimpleStereoPair.Builder
extends Object

A builder for an immutable simple stereo pair.

To use the builder, instantiate it with the two observations, optionally set a label and/or comment, and invoke the build() method. For example, to create a new simple stereo pair from the observations obs1 and obs2 (both of a Target called aramChaos), use the following code:

        SimpleStereoPair pair = new SimpleStereoPair.Builder (
                obs1,
                obs2
        ).label ("Aram Chaos Pair").comment ("Candidate pair of Aram Chaos").build ();

The two observations must be of the same target site or an IllegalArgumentException will be thrown.

Version:
1.3
Author:
Christian Schaller - UA/PIRL

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

SimpleStereoPair.Builder

public SimpleStereoPair.Builder(Observation stereo1,
                                Observation stereo2)
Creates a new simple stereo pair builder with the indicated observations. The optional label and comment are initially set to the empty string ("").

Parameters:
stereo1 - the stereo-1 observation.
stereo2 - the stereo-2 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 SimpleStereoPair.Builder label(String label)
Sets the optional label for this builder. If null, the resulting simple 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 SimpleStereoPair.Builder comment(String comment)
Sets the optional comment for this builder. If null, the resulting simple 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 SimpleStereoPair build()
Instantiates a new, immutable simple 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.

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