public static class Observer.Builder
extends java.lang.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.
Constructor and Description |
---|
Builder(int naifID,
java.lang.String referenceFrame)
Creates a new observer builder with the indicated NAIF ID and reference
frame.
|
Modifier and Type | Method and Description |
---|---|
Observer |
build()
Instantiates a new, immutable observer from this builder.
|
Observer.Builder |
comment(java.lang.String comment)
Sets the optional observer comment for this observer builder.
|
Observer.Builder |
label(java.lang.String label)
Sets the optional observer label for this observer builder.
|
public Builder(int naifID, java.lang.String referenceFrame)
naifID
- the NAIF ID of the observer.referenceFrame
- the observer's reference frame; must not be
null.java.lang.NullPointerException
- if the reference frame is null.public Observer.Builder label(java.lang.String label)
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.
label
- the observer's optional label.public Observer.Builder comment(java.lang.String comment)
comment
- the observer's optional comment.public Observer build()
Copyright \ (C) Arizona Board of Regents on behalf of the \ Planetary Image Research Laboratory, Lunar and \ Planetary Laboratory at the University of Arizona