Package nom.tam.fits
Class HeaderCardBuilder
java.lang.Object
nom.tam.fits.HeaderCardBuilder
Builder pattern implementation for easy readable header card creation.
- Author:
- nir
-
Method Summary
Modifier and TypeMethodDescriptionUse the native precision for the given number type.card()
get the current build card of the builder.card
(IFitsHeader newKey) switch focus to the card with the specified key.set the comment of the current card.header()
Returns the FITS header object that this builder is used withnoScale()
Deprecated.precision
(int decimals) Sets the number of decimals to show for the following decimal values.scale
(int decimals) Deprecated.Useprecision(int)
instead.value
(boolean newValue) set the value of the current card.If the card did not exist yet the card will be created.Sets a new number value for the current card.set the value of the current card.If the card did not exist yet the card will be created.set the value of the current card.
-
Method Details
-
card
get the current build card of the builder.- Returns:
- the current card
-
card
switch focus to the card with the specified key. If the card does not exist the card will be created when the value or the comment is set.- Parameters:
newKey
- the new card to set- Returns:
- this
-
comment
set the comment of the current card. If the card does not exist yet the card is created with a null value, if the card needs a value use the value setter first!- Parameters:
newComment
- the new comment to set.- Returns:
- this
- Throws:
HeaderCardException
- if the card creation failed.
-
value
set the value of the current card.If the card did not exist yet the card will be created.- Parameters:
newValue
- the new value to set.- Returns:
- this
- Throws:
HeaderCardException
- if the card creation failed.
-
value
set the value of the current card. If the card did not exist yet the card will be created.- Parameters:
newValue
- the new value to set.- Returns:
- this
- Throws:
HeaderCardException
- if the card creation failed.
-
value
Sets a new number value for the current card. If the card did not exist yet the card will be created.- Parameters:
value
- the new number value to set.- Returns:
- this
- Throws:
HeaderCardException
- if the card creation failed.LongValueException
- if the number value cannot be represented in the space available for it in the 80-character wide FITS header record.
-
value
set the value of the current card.If the card did not exist yet the card will be created.- Parameters:
newValue
- the new value to set.- Returns:
- this
- Throws:
HeaderCardException
- if the card creation failed.LongValueException
- if the number value cannot be represented in the space available for it in the 80-character wide FITS header record.
-
scale
Deprecated.Useprecision(int)
instead.Sets the number of decimals to show for the following decimal values. This method is now deprecated. Useprecision(int)
instead.- Parameters:
decimals
- the new number of decimal places to show.- Returns:
- this
-
precision
Sets the number of decimals to show for the following decimal values. Trailing zeroes will be ommitted.- Parameters:
decimals
- the number of decimals to show for the following decimal values.- Returns:
- this
- Since:
- 1.16
-
noScale
Deprecated.UseautoPrecision()
insteadThis method has been deprecated. Please useautoPrecision()
instead.- Returns:
- this
-
autoPrecision
Use the native precision for the given number type. Trailing zeroes will be ommitted.- Returns:
- this
- Since:
- 1.16
-
header
Returns the FITS header object that this builder is used with- Returns:
- the filled header.
-
autoPrecision()
instead