HiRISE

HiRISE.HiPlan.HiSEAS
Class Target.Builder

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

public static class Target.Builder
extends Object

A builder for an immutable target object.

To use the builder, instantiate it with the target body and coordinates, optionally set a label and/or comment, and invoke the build() method. For example, to create a new target site in the center of Aram Chaos (on Mars), use the following code:

        Target aramChaos = new Target.Builder (
                Body.getInstance (499),
                Math.toRadians (338.5),
                Math.toRadians (2.57),
                -4.5
        ).label ("Aram Chaos").comment ("The center of Aram Chaos.").build ();

499 is the NAIF body ID code for Mars.

Coordinates are planetocentric, east-leading and are in radians. Altitude is in kilometers.

Version:
1.7
Author:
Christian Schaller - UA/PIRL

Constructor Summary
Target.Builder(Body body, double longitude, double latitude, double altitude)
          Creates a new target builder with the indicated body and coordinates.
 
Method Summary
 Target build()
          Instantiates a new, immutable target site from this builder.
 Target.Builder comment(String comment)
          Sets the optional target comment for this target builder.
 Target.Builder label(String label)
          Sets the optional target label for this target builder.
 Target.Builder usingDegrees()
          Sets the builder to interpret its longitude and latitude as degrees instead of radians.
 Target.Builder usingPlanetographicLatitude()
          Sets the builder to interpret its latitude as a planetographic latitude instead of planetocentric.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Target.Builder

public Target.Builder(Body body,
                      double longitude,
                      double latitude,
                      double altitude)
Creates a new target builder with the indicated body and coordinates. The longitude will be normalized to be in the range 0..2π.

Note that the angles are presumed to be in radians and that the latitude is presumed to be planetocentric. Use the usingDegrees() and/or the usingPlanetographicLatitude() methods prior to invoking the build() method if necessary.

Parameters:
body - the target body.
longitude - the east-leading longitude of the target site in radians.
latitude - the planetocentric latitude of the target site in radians.
altitude - the altitude in km of the target site above the reference ellipsoid.
Method Detail

label

public Target.Builder label(String label)
Sets the optional target label for this target builder.

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

comment

public Target.Builder comment(String comment)
Sets the optional target comment for this target builder.

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

usingDegrees

public Target.Builder usingDegrees()
Sets the builder to interpret its longitude and latitude as degrees instead of radians.

Returns:
this target builder.

usingPlanetographicLatitude

public Target.Builder usingPlanetographicLatitude()
Sets the builder to interpret its latitude as a planetographic latitude instead of planetocentric. The builder's body parameter is used to convert the planetographic latitude to planetocentric.

Returns:
this target builder.

build

public Target build()
Instantiates a new, immutable target site from this builder.

The builder's longitude and latitude are presumed to be radians, and the latitude is further presumed to be planetocentric. Use the usingDegrees() and/or the usingPlanetographicLatitude() methods if necessary prior to invoking this method.

Returns:
a new target site.

HiRISE

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