Class Header
- All Implemented Interfaces:
FitsElement
Access and manipulate the header of a HDU. FITS headers serve more than a single purpose:
- provide an essential description of the type, size, and layout of the HDUs data segment
- describe the data as completely as possible via standardized (or conventional) keywords
- provide storage for additional user-specific key / value pairs
- allow for comments to aid human readability
First and foremost headers provide a description of the data object that follows the header in the HDU. Some of that
description is essential and critical to the integrity of the FITS file, such as the header keywords that describe
the type, size, and layout of the data segment. This library will automatically populate the header with appropriate
information using the mandatory keywords (such as SIMPLE
or XTENSION
, BITPIX
,
NAXIS
, NAXIS
n, PCOUNT
, GCOUNT
keywords, as well as
essential table column format descriptions). Users of the library should avoid overwriting these mandatory keywords
manually, since they may corrupt the FITS file, rendering it unreadable.
Beyond the keywords that describe the type, shape, and size of data, the library will not add further information to
the header. The users of the library are responsible to complete the header description as necessary. This includes
non-enssential data descriptions (such as EXTNAME
, BUNIT
, OBSERVER
, or
optional table column descriptors TTYPE
n, TUNIT
n, coordinate systems via the
appropriate WCS keywords, or checksums). Users of the library are responsible for completing the data description
using whatever standard or conventional keywords are available and appropriate. Please refer to the
FITS Standard documentation to see what typical
descriptions of data you might want to use.
Last but not least, the header is also a place where FITS creators can store (nearly) arbitrary key/value pairs. In
earlier versions of the FITS standard, header keywords were restricted to max. 8 upper case letters and numbers (plus
hyphen and underscore), and no more than 70 character value fields. However, as of FITS 4.0 (and even before as a
registered convention), string values of arbitrary length may be stored using the OGIP 1.0 long string convention,
while the ESO HIERARCH convention allows
keywords with more than 8 characters and hierarchical keywords. Support, conformance, and compliance to these
conventions can be toggled by static settings in FitsFactory
to user preference.
As of version 1.16, we also support reserving space in headers for future additions using the
ensureCardSpace(int)
method, also part of the FITS 4.0 standard. It allows users to finish populating
headers after data that follows the header is already written -- a useful feature for recording data from
streaming sources.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Keyword checking mode when adding standardized keywords via theIFitsHeader
interface. -
Field Summary
Modifier and TypeFieldDescriptionstatic final int
The default character position to which comments should be aligned if possible (zero-based).static final Header.KeywordCheck
The keyword checking mode used by the library until the user changes it it.static final int
Deprecated.We will disable changing alignment in the future because it may violate the standard for 'fixed-format' header entries, and result in files that are unreadable by some other software.static final int
Deprecated.We will disable changing alignment in the future because it may violate the standard for 'fixed-format' header entries, and result in files that are unreadable by some other software. -
Constructor Summary
ConstructorDescriptionHeader()
Create a new header with the required default keywords for a standalone header.Create a header and initialize it with a vector of strings.Create a header which points to the given data object.Header
(ArrayDataInput is) Create a header and populate it from the input stream -
Method Summary
Modifier and TypeMethodDescriptionaddHexValue
(String key, long val, String comment) Deprecated.Not supported by the FITS standard, so do not use.void
addLine
(HeaderCard fcard) Insert a new header card at the current position, deleting any prior occurence of the same card while maintaining the current position to point to after the newly inserted card.Add or replace a key with the given boolean value and comment.Add or replace a key with the given number value and comment, using up to the specified decimal places after the leading figure.Add or replace a key with the given number value and comment.Add or replace a key with the given string value and comment.addValue
(String key, ComplexValue val, int decimals, String comment) Add or replace a key with the given complex number value and comment, using up to the specified decimal places after the leading figure.addValue
(String key, ComplexValue val, String comment) Add or replace a key with the given complex number value and comment.addValue
(IFitsHeader key, Boolean val) Add or replace a key with the given boolean value and its standardized comment.addValue
(IFitsHeader key, Number val) Add or replace a key with the given double value and its standardized comment.addValue
(IFitsHeader key, String val) Add or replace a key with the given string value and its standardized comment.addValue
(IFitsHeader key, ComplexValue val) Add or replace a key with the given complex value and its standardized comment.card
(IFitsHeader key) get a builder for filling the header cards using the builder pattern.final boolean
containsKey
(String key) Tests if the specified keyword is present in this table.final boolean
containsKey
(IFitsHeader key) Tests if the specified keyword is present in this table.void
Delete the card associated with the given key.void
deleteKey
(IFitsHeader key) Delete the card associated with the given key.void
Print the header to a given stream.void
ensureCardSpace
(int nCards) Reserves header card space for populating at a later time.Finds the card associated with a given key, and returns it.findCard
(IFitsHeader key) Find the card associated with a given key.brief Collect the header cards that match a regular expression.Deprecated.UsefindCard(String)
orgetCard(String)
instead.final BigDecimal
getBigDecimalValue
(String key) Deprecated.The FITS header does not support decimal types beyond those that can be represented by a 64-bit IEEE double-precision floating point value.getBigDecimalValue
(String key, BigDecimal dft) Deprecated.The FITS header does not support decimal types beyond those that can be represented by a 64-bit IEEE double-precision floating point value.final BigDecimal
Deprecated.The FITS header does not support decimal types beyond those that can be represented by a 64-bit IEEE double-precision floating point value.final BigDecimal
getBigDecimalValue
(IFitsHeader key, BigDecimal dft) Deprecated.The FITS header does not support decimal types beyond those that can be represented by a 64-bit IEEE double-precision floating point value.final BigInteger
getBigIntegerValue
(String key) Deprecated.The FITS header does not support integer types beyond those that can be represented by a 64-bit integer.getBigIntegerValue
(String key, BigInteger dft) Deprecated.The FITS header does not support integer types beyond those that can be represented by a 64-bit integer.final BigInteger
Deprecated.The FITS header does not support integer types beyond those that can be represented by a 64-bit integer.final BigInteger
getBigIntegerValue
(IFitsHeader key, BigInteger dft) Deprecated.The FITS header does not support integer types beyond those that can be represented by a 64-bit integer.final boolean
getBooleanValue
(String key) Get theboolean
value associated with the given key.boolean
getBooleanValue
(String key, boolean dft) Get theboolean
value associated with the given key.final boolean
Get theboolean
value associated with the given key.final boolean
getBooleanValue
(IFitsHeader key, boolean dft) Get theboolean
value associated with the given key.getCard
(int n) Deprecated.An iterator fromiterator(int)
oriterator()
should be used for sequential access to the header.Returns the card associated with a given key.getCard
(IFitsHeader key) Returns the card associated with a given key.static int
Returns the current preferred alignment character position of inline header comments.final ComplexValue
getComplexValue
(String key) Get the complex number value associated with the given key.getComplexValue
(String key, ComplexValue dft) Get the complex number value associated with the given key, or return a default value.long
Return the size of the data including any needed padding.final double
getDoubleValue
(String key) Get thedouble
value associated with the given key.double
getDoubleValue
(String key, double dft) Get thedouble
value associated with the given key, or return a default value.final double
Get thedouble
value associated with the given key.final double
getDoubleValue
(IFitsHeader key, double dft) Get thedouble
value associated with the given key, or return a default value.Returns the set of keywords that had more than one value assignment in the parsed header.Returns the list of duplicate cards in the order they appeared in the parsed header.long
Returns the byte offset at which this element starts ina file.final float
getFloatValue
(String key) Get thefloat
value associated with the given key.float
getFloatValue
(String key, float dft) Get thefloat
value associated with the given key, or return a default value.final float
getFloatValue
(IFitsHeader key) Get thefloat
value associated with the given key.final float
getFloatValue
(IFitsHeader key, float dft) Get thefloat
value associated with the given key, or return a default value.final long
getHexValue
(String key) Deprecated.Not supported by the FITS standard, so do not use.long
getHexValue
(String key, long dft) Deprecated.Not supported by the FITS standard, so do not use.final int
getIntValue
(String key) Get theint
value associated with the given key.int
getIntValue
(String key, int dft) Get theint
value associated with the given key, or return a default value.final int
getIntValue
(IFitsHeader key) Get theint
value associated with the given key.final int
getIntValue
(IFitsHeader key, int dft) Get theint
value associated with the given key, or return a default value.getKey
(int n) Deprecated.An iterator fromiterator(int)
oriterator()
should be used for sequential access to the header.final Header.KeywordCheck
Returns the current keyword checking mode.final long
getLongValue
(String key) Get thelong
value associated with the given key.long
getLongValue
(String key, long dft) Get thelong
value associated with the given key, or return a default value.final long
getLongValue
(IFitsHeader key) Get thelong
value associated with the given key.final long
getLongValue
(IFitsHeader key, long dft) Get thelong
value associated with the given key, or return a default value.long
Returns the minimum number of bytes that will be written by this header, either as the original byte size of a header that was read, or else the minimum preallocated capacity after settingensureCardSpace(int)
.int
Returns the nominal number of currently defined cards in this header.int
Returns the number of 80-character header records in this header, including an END marker (whether or not it is currently contained).final long
Deprecated.for internal use) It should be a private method in the future.final long
getSize()
Returns the size of this elements in the FITS representation.final String
getStringValue
(String key) Get theString
value associated with the given key.getStringValue
(String key, String dft) Get theString
value associated with the given key, or return a default value.final String
Get theString
value associated with the given standard key.final String
getStringValue
(IFitsHeader key, String dft) Get theString
value associated with the given standard key, or return a default value.boolean
Checks if the header had duplicate assignments in the FITS.void
Adds a blank card into the header.int
insertComment
(String value) Adds one or more consecutive COMMENT records, wrapping the comment text as necessary.insertCommentStyle
(String key, String comment) Adds a line to the header using the COMMENT style, i.e., no '=' in column 9.int
insertCommentStyleMultiline
(String key, String comment) Adds a line to the header using the COMMENT style, i.e., no '=' in column 9.int
insertHistory
(String value) Adds one or more consecutive a HISTORY records, wrapping the comment text as necessary.int
insertUnkeyedComment
(String value) Adds one or more consecutive comment records with no keyword (bytes 1-9 left blank), wrapping the comment text as necessary.boolean
isEmpty()
Checks if the header is empty, that is if it contains no cards at all.static boolean
Checks whether warnings about FITS standard violations are logged when a header is being read (parsed).iterator()
Returns a cursor-based iterator for this header's entries starting at the first entry.iterator
(int index) Deprecated.We should never use indexed access to the header.makeData()
Deprecated.(for internal use) Normally we either want to write a Java object to FITS (in which case we have the dataand want to make a header for it), or we read some data from a FITS input.void
mergeDistinct
(Header source) Merges copies of all cards from another header, provided they are not readily present in this header.nextCard()
Returns the header card at the currently set mark position and increments the mark position by one.void
pointToData
(Data o) Deprecated.Use the appropriateHeader
constructor instead.prevCard()
Returns the header card prior to the currently set mark position and decrements the mark position by one.void
read
(ArrayDataInput dis) Reads new header data from an input, discarding any prior content.static Header
readHeader
(ArrayDataInput dis) Create a header by reading the information from the input stream.void
removeCard
(String key) Deprecated.(duplicate method) UsedeleteKey(String)
instead.boolean
reset()
Reset the input stream to point to the beginning of this elementfinal void
Deprecated.UseensureCardSpace(int)
with 1 as the argument instead.void
rewrite()
Rewrite the contents of the element in place.boolean
Checks if we can write this element back to its source.seekHead()
Move the cursor to the end of the header.seekTail()
Move the cursor to the end of the header.void
setBitpix
(int val) Deprecated.Use the safersetBitpix(Bitpix)
instead.void
Deprecated.(for internall use) Visibility will be reduced to the package level in the future.static void
setCommentAlignPosition
(int pos) Deprecated.Not recommended as it may violate the FITS standart for 'fixed-format' header entries, and make our FITS files unreadable by software that expects strict adherence to the standard.static void
Sets the default mode of built-in standard keyword checking mode for new headers.void
setHeaderSorter
(Comparator<String> headerSorter) Overwite the default header card sorter.void
Sets the built-in standard keyword checking mode.static void
setLongStringsEnabled
(boolean flag) Deprecated.void
setNaxes
(int val) Deprecated.(for internal use) Visibility will be reduced to the package level in the future.void
setNaxis
(int axis, int dim) Deprecated.(for internal use) Visibility will be reduced to the package level in the future.static void
setParserWarningsEnabled
(boolean value) Sets whether warnings about FITS standard violations are logged when a header is being read (parsed).void
setSimple
(boolean val) Deprecated.(for internall use) Visibility will be reduced to the package level in the future.void
setXtension
(String val) Deprecated.(for internall use) Visibility will be reduced to the package level in the future.int
size()
Deprecated.usegetNumberOfCards()
.final void
updateLine
(String key, HeaderCard card) Update an existing card in situ, without affecting the current position, or else add a new card at the current position.void
updateLine
(IFitsHeader key, HeaderCard card) Update a valued entry in the header, or adds a new header entry.void
updateLines
(Header newHdr) Overwrite the lines in the header.void
validate
(boolean asPrimary) Validates this header by making it a proper primary or extension header.void
write
(ArrayDataOutput out) Writes the contents of the element to a data sink, adding padding as necessary if the element (such as a header or data segment) is expected to complete the FITS block of 2880 bytes.void
(for internal use) Similar towrite(ArrayDataOutput)
, but writes the header as is, without ensuring that mandatory keys are present, and in the correct order, or that checksums are updated.
-
Field Details
-
DEFAULT_COMMENT_ALIGN
public static final int DEFAULT_COMMENT_ALIGNThe default character position to which comments should be aligned if possible (zero-based). The fITS standard requires that 'fixed-format' values are right-justified to byte 30 (index 29 in Java), and recommends a space after that before the comment. As such, comments should normally start at byte 30 (counted from 0). (We will add a space at that position before the '/' indicating the comment start)- See Also:
-
MIN_COMMENT_ALIGN
public static final int MIN_COMMENT_ALIGNDeprecated.We will disable changing alignment in the future because it may violate the standard for 'fixed-format' header entries, and result in files that are unreadable by some other software. This constant will be obsoleted and removed.The earliest position (zero-based) at which a comment may start for a regular key/value entry.- See Also:
-
MAX_COMMENT_ALIGN
public static final int MAX_COMMENT_ALIGNDeprecated.We will disable changing alignment in the future because it may violate the standard for 'fixed-format' header entries, and result in files that are unreadable by some other software. This constant will be obsoleted and removed.The largest (zero-based) comment alignment allowed that can still contain some meaningful comment (word)- See Also:
-
DEFAULT_KEYWORD_CHECK_POLICY
The keyword checking mode used by the library until the user changes it it.- Since:
- 1.19
-
-
Constructor Details
-
Header
public Header()Create a new header with the required default keywords for a standalone header. -
Header
Create a header and populate it from the input stream- Parameters:
is
- The input stream where header information is expected.- Throws:
IOException
- if the header could not be read.TruncatedFileException
- if the stream ended prematurely
-
Header
Create a header which points to the given data object.- Parameters:
o
- The data object to be described.- Throws:
FitsException
- if the data was not valid for this header.
-
Header
Create a header and initialize it with a vector of strings.- Parameters:
newCards
- Card images to be placed in the header.
-
-
Method Details
-
readHeader
Create a header by reading the information from the input stream.- Parameters:
dis
- The input stream to read the data from.- Returns:
null
if there was a problem with the header; otherwise return the header read from the input stream.- Throws:
TruncatedFileException
- if the stream ended prematurelyIOException
- if the header could not be read.
-
setLongStringsEnabled
Deprecated.please useFitsFactory.setLongStringsEnabled(boolean)
instead.- Parameters:
flag
- the new value for long-string enabling.
-
ensureCardSpace
public void ensureCardSpace(int nCards) Reserves header card space for populating at a later time. When written to a stream, the header will be large enough to hold at least the specified number of cards. If the header has fewer physical cards then the remaining space will be padded with blanks, leaving space for future additions, as specified by the FITS 4.0 standard for preallocated header space.
This method is also called by
read(ArrayDataInput)
, with the number of cards (including reserved blank space) contained in the header input stream, in order to ensure that the header remains rewritable even if it is shortened by the removal of cards (explicitly, or because they were duplicates).A new setting always overrides prior ones. For example, calling this method with an argument that is %lt;=1 will eliminate (reset) any prior preallocated header space.
- Parameters:
nCards
- the mimimum number of 80-character header records that is header must be able to support when written to a stream, including preallocated blank header space.- Since:
- 1.16
- See Also:
-
mergeDistinct
Merges copies of all cards from another header, provided they are not readily present in this header. That is, it merges only the non-conflicting or distinct header entries from the designated source (in contrast toupdateLines(Header)
). All comment cards are merged also (since these can always appear multiple times, so they do not conflict). The merged entries are added at the end of the header, in the same order as they appear in the source. The merged entries will be copies of the cards in the original, such that subsequent modifications to the source will not affect this header or vice versa.- Parameters:
source
- The header from which to inherit non-conflicting entries- Since:
- 1.19
- See Also:
-
addLine
Insert a new header card at the current position, deleting any prior occurence of the same card while maintaining the current position to point to after the newly inserted card.- Parameters:
fcard
- The card to be inserted.- Throws:
IllegalArgumentException
- if the current keyword checking mode does not allow the headercard with its standard keyword in the header.- See Also:
-
setKeywordChecking
Sets the built-in standard keyword checking mode. When populating the header using
IFitsHeader
keywords the library will check if the given keyword is appropriate for the type of HDU that the header represents, and will throw anIllegalArgumentException
if the specified keyword is not allowed for that type of HDU.This method changes the keyword checking mode for this header instance only. If you want to change the mode for all newly created headers globally, use
setDefaultKeywordChecking(KeywordCheck)
instead.- Parameters:
mode
- The keyword checking mode to use.- Since:
- 1.19
- See Also:
-
setDefaultKeywordChecking
Sets the default mode of built-in standard keyword checking mode for new headers. When populating the header usingIFitsHeader
keywords the library will check if the given keyword is appropriate for the type of HDU that the header represents, and will throw anIllegalArgumentException
if the specified keyword is not allowed for that type of HDU.- Parameters:
mode
- The keyword checking policy to use.- Since:
- 1.19
- See Also:
-
getKeywordChecking
Returns the current keyword checking mode.- Returns:
- the current keyword checking mode
- Since:
- 1.19
- See Also:
-
addValue
public HeaderCard addValue(IFitsHeader key, Boolean val) throws HeaderCardException, IllegalArgumentException Add or replace a key with the given boolean value and its standardized comment. If the value is not compatible with the convention of the keyword, a warning message is logged but no exception is thrown (at this point). The new card will be placed at the current mark position, as set e.g. byfindCard(IFitsHeader)
.- Parameters:
key
- The header key.val
- The boolean value.- Returns:
- the new card that was added.
- Throws:
HeaderCardException
- If the parameters cannot build a valid FITS card.IllegalArgumentException
- If the keyword is invalid- See Also:
-
addValue
public HeaderCard addValue(IFitsHeader key, Number val) throws HeaderCardException, IllegalArgumentException Add or replace a key with the given double value and its standardized comment. If the value is not compatible with the convention of the keyword, a warning message is logged but no exception is thrown (at this point). The new card will be placed at the current mark position, as set e.g. byfindCard(IFitsHeader)
.- Parameters:
key
- The header key.val
- The double value.- Returns:
- the new card that was added.
- Throws:
HeaderCardException
- If the parameters cannot build a valid FITS card.IllegalArgumentException
- If the keyword is invalid- See Also:
-
addValue
public HeaderCard addValue(IFitsHeader key, String val) throws HeaderCardException, IllegalArgumentException Add or replace a key with the given string value and its standardized comment. If the value is not compatible with the convention of the keyword, a warning message is logged but no exception is thrown (at this point). The new card will be placed at the current mark position, as set e.g. byfindCard(IFitsHeader)
.- Parameters:
key
- The header key.val
- The string value.- Returns:
- the new card that was added.
- Throws:
HeaderCardException
- If the parameters cannot build a valid FITS card.IllegalArgumentException
- If the keyword is invalid- See Also:
-
addValue
public HeaderCard addValue(IFitsHeader key, ComplexValue val) throws HeaderCardException, IllegalArgumentException Add or replace a key with the given complex value and its standardized comment. If the value is not compatible with the convention of the keyword, a warning message is logged but no exception is thrown (at this point). The new card will be placed at the current mark position, as set e.g. byfindCard(IFitsHeader)
.- Parameters:
key
- The header key.val
- The complex value.- Returns:
- the new card that was added.
- Throws:
HeaderCardException
- If the parameters cannot build a valid FITS card.IllegalArgumentException
- If the keyword is invalid- Since:
- 1.17
- See Also:
-
addValue
Add or replace a key with the given boolean value and comment. The new card will be placed at the current mark position, as set e.g. byfindCard(String)
.- Parameters:
key
- The header key.val
- The boolean value.comment
- A comment to append to the card.- Returns:
- the new card that was added.
- Throws:
HeaderCardException
- If the parameters cannot build a valid FITS card.- See Also:
-
addValue
Add or replace a key with the given number value and comment. The value will be represented in the header card with use the native precision of the value or at leastFlexFormat.DOUBLE_DECIMALS
, whichever fits in the available card space. Trailing zeroes will be ommitted. The new card will be placed at the current mark position, as set e.g. byfindCard(String)
.- Parameters:
key
- The header key.val
- The number value.comment
- A comment to append to the card.- Returns:
- the new card that was added.
- Throws:
HeaderCardException
- If the parameters cannot build a valid FITS card.- See Also:
-
addValue
public HeaderCard addValue(String key, Number val, int decimals, String comment) throws HeaderCardException Add or replace a key with the given number value and comment, using up to the specified decimal places after the leading figure. Trailing zeroes will be ommitted. The new card will be placed at the current mark position, as set e.g. byfindCard(String)
.- Parameters:
key
- The header key.val
- The number value.decimals
- The number of decimal places to show after the leading figure, orFlexFormat.AUTO_PRECISION
to use the native precision of the value or at leastFlexFormat.DOUBLE_DECIMALS
, whichever fits in the available card space.comment
- A comment to append to the card.- Returns:
- the new card that was added.
- Throws:
HeaderCardException
- If the parameters cannot build a valid FITS card.- See Also:
-
addValue
Add or replace a key with the given complex number value and comment. Trailing zeroes will be ommitted. The new card will be placed at the current mark position, as set e.g. byfindCard(String)
.- Parameters:
key
- The header keyword.val
- The complex number value.comment
- A comment to append to the card.- Returns:
- the new card that was added.
- Throws:
HeaderCardException
- If the parameters cannot build a valid FITS card.- Since:
- 1.16
- See Also:
-
addValue
public HeaderCard addValue(String key, ComplexValue val, int decimals, String comment) throws HeaderCardException Add or replace a key with the given complex number value and comment, using up to the specified decimal places after the leading figure. Trailing zeroes will be ommitted. The new card will be placed at the current mark position, as set e.g. byfindCard(String)
.- Parameters:
key
- The header keyword.val
- The complex number value.decimals
- The number of decimal places to show after the leading figure, orFlexFormat.AUTO_PRECISION
to use the native precision of the value, or at leastFlexFormat.DOUBLE_DECIMALS
, whichever fits in the available card space.comment
- A comment to append to the card.- Returns:
- the new card that was added.
- Throws:
HeaderCardException
- If the parameters cannot build a valid FITS card.- Since:
- 1.16
- See Also:
-
addHexValue
@Deprecated public HeaderCard addHexValue(String key, long val, String comment) throws HeaderCardException Deprecated.Not supported by the FITS standard, so do not use. It was included due to a misreading of the standard itself. We will remove this method in the future.- Parameters:
key
- The header key.val
- The integer value.comment
- A comment to append to the card.- Returns:
- the new card that was added.
- Throws:
HeaderCardException
- If the parameters cannot build a valid FITS card.- Since:
- 1.16
- See Also:
-
addValue
Add or replace a key with the given string value and comment. The new card will be placed at the current mark position, as set e.g. byfindCard(String)
.- Parameters:
key
- The header key.val
- The string value.comment
- A comment to append to the card.- Returns:
- the new card that was added.
- Throws:
HeaderCardException
- If the parameters cannot build a valid FITS card.- See Also:
-
card
get a builder for filling the header cards using the builder pattern.- Parameters:
key
- the key for the first card.- Returns:
- the builder for header cards.
-
containsKey
Tests if the specified keyword is present in this table.- Parameters:
key
- the keyword to be found.- Returns:
true
if the specified keyword is present in this table;false
otherwise.
-
containsKey
Tests if the specified keyword is present in this table.- Parameters:
key
- the keyword to be found.- Returns:
true
if the specified keyword is present in this table;false
otherwise.
-
deleteKey
Delete the card associated with the given key. Nothing occurs if the key is not found.- Parameters:
key
- The header key.
-
deleteKey
Delete the card associated with the given key. Nothing occurs if the key is not found.- Parameters:
key
- The header key.
-
dumpHeader
Print the header to a given stream. Note that this method does not show reserved card space before the END keyword, and thus does not necessarily show the same layout as what would appear in a file.- Parameters:
ps
- the stream to which the card images are dumped.- See Also:
-
getCard
Returns the card associated with a given key. UnlikefindCard(IFitsHeader)
, it does not alter the mark position at which new cards are added.- Parameters:
key
- the header key.- Returns:
null
if the keyword could not be found; return the HeaderCard object otherwise.- Since:
- 1.18.1
- See Also:
-
findCard
Find the card associated with a given key. If found this sets the mark (cursor) to the card, otherwise it unsets the mark. The mark is where new cards will be added to the header by default. If you do not want to change the mark position, usegetCard(IFitsHeader)
instead.- Parameters:
key
- The header key.- Returns:
null
if the keyword could not be found; return the HeaderCard object otherwise.- See Also:
-
getCard
Returns the card associated with a given key. UnlikefindCard(String)
, it does not alter the mark position at which new cards are added.- Parameters:
key
- the header key.- Returns:
null
if the keyword could not be found; return the HeaderCard object otherwise.- Since:
- 1.18.1
- See Also:
-
findCard
Finds the card associated with a given key, and returns it. If found this sets the mark (cursor) to just before the card, such thatnextCard()
will return that very same card on the first subsequent call. If the header contains no matching entry, the mark is reset to the tail of the header (the same asseekTail()
). The mark determines where new cards will be added to the header by default. If you do not want to alter the mark position, usegetCard(String)
instead.- Parameters:
key
- the header key.- Returns:
- Returns the header entry for the given keyword, or
null
if the header has no such entry. - See Also:
-
findCards
brief Collect the header cards that match a regular expression. This is useful if one needs to search for a keyword that is buried under some HIERARCH string conventions of unspecified depth. So to search for some key like "HIERARCH OBO SUBOBO MYOBO", which would appear with the key HIERARCH.OBO.SUBOBO.MYOBO in this FITS implementation, one could search with regex="HIER.*MYOBO" and find it, supposed FitsFactory.setUseHierarch(true) was called before creating the header.- Parameters:
regex
- The generalized regular expression for the keyword search- Returns:
- The list of header cards that match the regular expression.
- Since:
- 1.19.1
-
findKey
Deprecated.UsefindCard(String)
orgetCard(String)
instead. Find the card associated with a given key.- Parameters:
key
- The header key.- Returns:
null
if the keyword could not be found; return the card image otherwise.
-
getBigDecimalValue
Deprecated.The FITS header does not support decimal types beyond those that can be represented by a 64-bit IEEE double-precision floating point value.Get the bid decimal value associated with the given key.- Parameters:
key
- The header key.- Returns:
- The associated value or 0.0 if not found.
-
getBigDecimalValue
Deprecated.The FITS header does not support decimal types beyond those that can be represented by a 64-bit IEEE double-precision floating point value.Get the big decimal value associated with the given key.- Parameters:
key
- The header key.dft
- The default value to return if the key cannot be found.- Returns:
- the associated value.
-
getBigDecimalValue
Deprecated.The FITS header does not support decimal types beyond those that can be represented by a 64-bit IEEE double-precision floating point value.Get the big decimal value associated with the given key.- Parameters:
key
- The header key.- Returns:
- The associated value or 0.0 if not found.
-
getBigDecimalValue
Deprecated.The FITS header does not support decimal types beyond those that can be represented by a 64-bit IEEE double-precision floating point value.Get the big decimal value associated with the given key.- Parameters:
key
- The header key.dft
- The default value to return if the key cannot be found.- Returns:
- the associated value.
-
getBigIntegerValue
Deprecated.The FITS header does not support integer types beyond those that can be represented by a 64-bit integer.Get the big integer value associated with the given key.- Parameters:
key
- The header key.- Returns:
- the associated value or 0 if not found.
-
getBigIntegerValue
Deprecated.The FITS header does not support integer types beyond those that can be represented by a 64-bit integer.Get the big integer value associated with the given key, or return a default value.- Parameters:
key
- The header key.dft
- The default value to be returned if the key cannot be found.- Returns:
- the associated value.
-
getBigIntegerValue
Deprecated.The FITS header does not support integer types beyond those that can be represented by a 64-bit integer.Get the big integer value associated with the given key.- Parameters:
key
- The header key.- Returns:
- The associated value or 0 if not found.
-
getBigIntegerValue
Deprecated.The FITS header does not support integer types beyond those that can be represented by a 64-bit integer.Get the big integer value associated with the given key.- Parameters:
key
- The header key.dft
- The default value to be returned if the key cannot be found.- Returns:
- the associated value.
-
getComplexValue
Get the complex number value associated with the given key.- Parameters:
key
- The header key.- Returns:
- The associated value or
ComplexValue.ZERO
if not found. - Since:
- 1.16
- See Also:
-
getComplexValue
Get the complex number value associated with the given key, or return a default value.- Parameters:
key
- The header key.dft
- The default value to return if the key cannot be found.- Returns:
- the associated value.
- Since:
- 1.16
- See Also:
-
getBooleanValue
Get theboolean
value associated with the given key.- Parameters:
key
- The header key.- Returns:
- The value found, or false if not found or if the keyword is not a logical keyword.
-
getBooleanValue
Get theboolean
value associated with the given key.- Parameters:
key
- The header key.dft
- The value to be returned if the key cannot be found or if the parameter does not seem to be a boolean.- Returns:
- the associated value.
-
getBooleanValue
Get theboolean
value associated with the given key.- Parameters:
key
- The header key.- Returns:
- The value found, or false if not found or if the keyword is not a logical keyword.
-
getBooleanValue
Get theboolean
value associated with the given key.- Parameters:
key
- The header key.dft
- The value to be returned if the key cannot be found or if the parameter does not seem to be a boolean.- Returns:
- the associated value.
-
getCard
Deprecated.An iterator fromiterator(int)
oriterator()
should be used for sequential access to the header.Get the n'th card image in the header- Parameters:
n
- the card index to get- Returns:
- the card image; return
null
if the n'th card does not exist.
-
getDataSize
public long getDataSize()Return the size of the data including any needed padding.- Returns:
- the data segment size including any needed padding.
-
getDoubleValue
Get thedouble
value associated with the given key.- Parameters:
key
- The header key.- Returns:
- The associated value or 0.0 if not found.
-
getDoubleValue
Get thedouble
value associated with the given key, or return a default value.- Parameters:
key
- The header key.dft
- The default value to return if the key cannot be found.- Returns:
- the associated value.
-
getDoubleValue
Get thedouble
value associated with the given key.- Parameters:
key
- The header key.- Returns:
- The associated value or 0.0 if not found.
-
getDoubleValue
Get thedouble
value associated with the given key, or return a default value.- Parameters:
key
- The header key.dft
- The default value to return if the key cannot be found.- Returns:
- the associated value.
-
getDuplicates
Returns the list of duplicate cards in the order they appeared in the parsed header. You can access the first occurence of each of every duplicated FITS keyword using the usual
Header.getValue()
, and find further occurrences in the list returned here.The FITS standared strongly discourages using the keywords multiple times with assigned values, and specifies that the values of such keywords are undefined by definitions. Our library is thus far more tolerant than the FITS standard, allowing you to access each and every value that was specified for the same keyword.
On the other hand FITS does not limit how many times you can add comment-style keywords to a header. If you must used the same keyword multiple times in your header, you should consider using comment-style entries instead.
- Returns:
- the list of duplicate cards. Note that when the header is read in, only the last entry for a given keyword is retained in the active header. This method returns earlier cards that have been discarded in the order in which they were encountered in the header. It is possible for there to be many cards with the same keyword in this list.
- See Also:
-
getDuplicateKeySet
Returns the set of keywords that had more than one value assignment in the parsed header.- Returns:
- the set of header keywords that were assigned more than once in the same header, or
null
if there were no duplicate assignments. - Since:
- 1.17
- See Also:
-
getFileOffset
public long getFileOffset()Description copied from interface:FitsElement
Returns the byte offset at which this element starts ina file. If the element was not obtained from an input, then 0 is returned.- Specified by:
getFileOffset
in interfaceFitsElement
- Returns:
- the byte at which this element begins. This is only available if the data is originally read from a random access medium. Otherwise 0 is returned.
-
getFloatValue
Get thefloat
value associated with the given key.- Parameters:
key
- The header key.- Returns:
- The associated value or 0.0 if not found.
-
getFloatValue
Get thefloat
value associated with the given key, or return a default value.- Parameters:
key
- The header key.dft
- The value to be returned if the key is not found.- Returns:
- the
float
value associated with the given key.
-
getFloatValue
Get thefloat
value associated with the given key.- Parameters:
key
- The header key.- Returns:
- The associated value or 0.0 if not found.
-
getFloatValue
Get thefloat
value associated with the given key, or return a default value.- Parameters:
key
- The header key.dft
- The value to be returned if the key is not found.- Returns:
- the
float
value associated with the given key.
-
getIntValue
Get theint
value associated with the given key.- Parameters:
key
- The header key.- Returns:
- The associated value or 0 if not found.
-
getIntValue
Get theint
value associated with the given key, or return a default value.- Parameters:
key
- The header key.dft
- The value to be returned if the key is not found.- Returns:
- the value associated with the key as an int.
-
getIntValue
Get theint
value associated with the given key.- Parameters:
key
- The header key.- Returns:
- The associated value or 0 if not found.
-
getIntValue
Get theint
value associated with the given key, or return a default value.- Parameters:
key
- The header key.dft
- The value to be returned if the key is not found.- Returns:
- the value associated with the key as an int.
-
getKey
Deprecated.An iterator fromiterator(int)
oriterator()
should be used for sequential access to the header.Get the n'th key in the header.- Parameters:
n
- the index of the key- Returns:
- the card image; return
null
if the n'th key does not exist.
-
getLongValue
Get thelong
value associated with the given key.- Parameters:
key
- The header key.- Returns:
- The associated value or 0 if not found.
-
getLongValue
Get thelong
value associated with the given key, or return a default value.- Parameters:
key
- The header key.dft
- The default value to be returned if the key cannot be found.- Returns:
- the associated value.
-
getLongValue
Get thelong
value associated with the given key.- Parameters:
key
- The header key.- Returns:
- The associated value or 0 if not found.
-
getLongValue
Get thelong
value associated with the given key, or return a default value.- Parameters:
key
- The header key.dft
- The default value to be returned if the key cannot be found.- Returns:
- the associated value.
-
getHexValue
Deprecated.Not supported by the FITS standard, so do not use. It was included due to a misreading of the standard itself.- Parameters:
key
- The header key.- Returns:
- The associated value or 0 if not found.
- Since:
- 1.16
- See Also:
-
getHexValue
Deprecated.Not supported by the FITS standard, so do not use. It was included due to a misreading of the standard itself.- Parameters:
key
- The header key.dft
- The default value to be returned if the key cannot be found.- Returns:
- the associated value.
- Since:
- 1.16
- See Also:
-
getNumberOfCards
public int getNumberOfCards()Returns the nominal number of currently defined cards in this header. Each card can consist of one or more 80-character wide header records.- Returns:
- the number of nominal cards in the header
- See Also:
-
getNumberOfPhysicalCards
public int getNumberOfPhysicalCards()Returns the number of 80-character header records in this header, including an END marker (whether or not it is currently contained).- Returns:
- the number of physical cards in the header, including the END marker.
- See Also:
-
getMinimumSize
public long getMinimumSize()Returns the minimum number of bytes that will be written by this header, either as the original byte size of a header that was read, or else the minimum preallocated capacity after settingensureCardSpace(int)
.- Returns:
- the minimum byte size for this header. The actual header may take up more space than that (but never less!), depending on the number of cards contained.
- Since:
- 1.16
- See Also:
-
getOriginalSize
Deprecated.for internal use) It should be a private method in the future. Returns the original size of the header in the stream from which it was read.- Returns:
- the size of the original header in bytes, or 0 if the header was not read from a stream.
- See Also:
-
getSize
public final long getSize()Description copied from interface:FitsElement
Returns the size of this elements in the FITS representation. This may include padding if the element (such as a header or data segment) is expected to complete a FITS block of 2880 bytes.- Specified by:
getSize
in interfaceFitsElement
- Returns:
- The size of this element in bytes, or 0 if the element is empty or invalid.
-
getStringValue
Get theString
value associated with the given standard key.- Parameters:
key
- The standard header key.- Returns:
- The associated value or null if not found or if the value is not a string.
- See Also:
-
getStringValue
Get theString
value associated with the given standard key, or return a default value.- Parameters:
key
- The standard header key.dft
- The default value.- Returns:
- The associated value or the default value if not found or if the value is not a string.
- See Also:
-
getStringValue
Get theString
value associated with the given key.- Parameters:
key
- The header key.- Returns:
- The associated value or null if not found or if the value is not a string.
- See Also:
-
getStringValue
Get theString
value associated with the given key, or return a default value.- Parameters:
key
- The header key.dft
- The default value.- Returns:
- The associated value or the default value if not found or if the value is not a string.
- See Also:
-
hadDuplicates
public boolean hadDuplicates()Checks if the header had duplicate assignments in the FITS.- Returns:
- Were duplicate header keys found when this record was read in?
-
insertCommentStyle
Adds a line to the header using the COMMENT style, i.e., no '=' in column 9. The comment text may be truncated to fit into a single record, which is returned. Alternatively, you can split longer comments among multiple consecutive cards of the same type byinsertCommentStyleMultiline(String, String)
.- Parameters:
key
- The comment style header keyword, ornull
for an empty comment line.comment
- A string comment to follow. Illegal characters will be replaced by '?' and the comment may be truncated to fit into the card-space (71 characters).- Returns:
- The new card that was inserted, or
null
if the keyword itself was invalid or the comment wasnull
. - See Also:
-
insertCommentStyleMultiline
Adds a line to the header using the COMMENT style, i.e., no '=' in column 9. If the comment does not fit in a single record, then it will be split (wrapped) among multiple consecutive records with the same keyword. Wrapped lines will end with '&' (not itself a standard) to indicate comment cards that might belong together.- Parameters:
key
- The comment style header keyword, ornull
for an empty comment line.comment
- A string comment to follow. Illegal characters will be replaced by '?' and the comment may be split among multiple records as necessary to be fully preserved.- Returns:
- The number of cards inserted.
- Since:
- 1.16
- See Also:
-
insertComment
Adds one or more consecutive COMMENT records, wrapping the comment text as necessary.- Parameters:
value
- The comment.- Returns:
- The number of consecutive COMMENT cards that were inserted
- See Also:
-
insertUnkeyedComment
Adds one or more consecutive comment records with no keyword (bytes 1-9 left blank), wrapping the comment text as necessary.- Parameters:
value
- The comment.- Returns:
- The number of consecutive comment-style cards with no keyword (blank keyword) that were inserted.
- Since:
- 1.16
- See Also:
-
insertBlankCard
public void insertBlankCard()Adds a blank card into the header.- Since:
- 1.16
- See Also:
-
insertHistory
Adds one or more consecutive a HISTORY records, wrapping the comment text as necessary.- Parameters:
value
- The history record.- Returns:
- The number of consecutive HISTORY cards that were inserted
- See Also:
-
iterator
Returns a cursor-based iterator for this header's entries starting at the first entry.- Returns:
- an iterator over the header cards
-
iterator
Deprecated.We should never use indexed access to the header. This function will be removed in 2.0.Returns a cursor-based iterator for this header's entries.- Parameters:
index
- the card index to start the iterator- Returns:
- an iterator over the header cards starting at an index
-
seekHead
Move the cursor to the end of the header. Subsequently, alladdValue()
calls will add new cards to the end of the header.- Returns:
- the cursor after it has been repositioned to the end
- Since:
- 1.18.1
- See Also:
-
seekTail
Move the cursor to the end of the header. Subsequently, alladdValue()
calls will add new cards to the end of the header.- Returns:
- the cursor after it has been repositioned to the end
- Since:
- 1.18.1
- See Also:
-
makeData
Deprecated.(for internal use) Normally we either want to write a Java object to FITS (in which case we have the dataand want to make a header for it), or we read some data from a FITS input. In either case, there is no benefit of exposing such a function as this to the user.- Returns:
- Create the data element corresponding to the current header
- Throws:
FitsException
- if the header did not contain enough information to detect the type of the data
-
nextCard
Returns the header card at the currently set mark position and increments the mark position by one. The mark position determines the location at which new entries are added to the header. The mark is set either to just prior a particular card (e.g. viafindCard(IFitsHeader)
.- Returns:
- the next card in the Header using the built-in iterator
- See Also:
-
prevCard
Returns the header card prior to the currently set mark position and decrements the mark position by one. The mark position determines the location at which new entries are added to the header. The mark is set either to just prior a particular card (e.g. viafindCard(IFitsHeader)
.- Returns:
- the next card in the Header using the built-in iterator
- Since:
- 1.18.1
- See Also:
-
pointToData
Deprecated.Use the appropriateHeader
constructor instead. Will remove in a future releae.Create a header which points to the given data object.- Parameters:
o
- The data object to be described.- Throws:
FitsException
- if the data was not valid for this header.
-
isEmpty
public boolean isEmpty()Checks if the header is empty, that is if it contains no cards at all.- Returns:
true
if the header contains no cards, otherwisefalse
.- Since:
- 1.16
-
read
Reads new header data from an input, discarding any prior content.
As of 1.16, the header is ensured to (re)write at least the same number of cards as before, padding with blanks as necessary, unless the user resets the preallocated card space with a call to
ensureCardSpace(int)
.- Specified by:
read
in interfaceFitsElement
- Parameters:
dis
- The input stream to read the data from.- Throws:
TruncatedFileException
- the the stream ended prematurelyIOException
- if the operation failed- See Also:
-
removeCard
Deprecated.(duplicate method) UsedeleteKey(String)
instead.Delete a key.- Parameters:
key
- The header key.- Throws:
HeaderCardException
- if the operation failed
-
reset
public boolean reset()Description copied from interface:FitsElement
Reset the input stream to point to the beginning of this element- Specified by:
reset
in interfaceFitsElement
- Returns:
- True if the reset succeeded.
-
resetOriginalSize
Deprecated.UseensureCardSpace(int)
with 1 as the argument instead.Resets any prior preallocated header space, such as was explicitly set by
ensureCardSpace(int)
, or when the header was read from a stream to ensure it remains rewritable, if possible.For headers read from a stream, this will affect
rewriteable()
, so users should not call this method unless they do not intend torewrite()
this header into the original FITS. -
rewrite
Description copied from interface:FitsElement
Rewrite the contents of the element in place. The data must have been originally read from a random access device, and the size of the element may not have changed.- Specified by:
rewrite
in interfaceFitsElement
- Throws:
FitsException
- if the rewrite was unsuccessful.IOException
- if the rewrite was unsuccessful.
-
rewriteable
public boolean rewriteable()Description copied from interface:FitsElement
Checks if we can write this element back to its source. An element can only be written back if it is associated to a random accessible input and the current size FITS within the old block size.- Specified by:
rewriteable
in interfaceFitsElement
- Returns:
true
if this element can be rewritten?
-
setBitpix
Deprecated.Use the safersetBitpix(Bitpix)
instead.Set the BITPIX value for the header. The following values are permitted by FITS conventions:- 8 -- signed byte data. Also used for tables.
- 16 -- signed short data.
- 32 -- signed int data.
- 64 -- signed long data.
- -32 -- IEEE 32 bit floating point numbers.
- -64 -- IEEE 64 bit floating point numbers.
- Parameters:
val
- The value set by the user.- Throws:
IllegalArgumentException
- if the value is not a valid BITPIX value.- See Also:
-
setBitpix
Deprecated.(for internall use) Visibility will be reduced to the package level in the future.Sets a standard BITPIX value for the header.- Parameters:
bitpix
- The predefined enum value, e.g.Bitpix.INTEGER
.- Since:
- 1.16
- See Also:
-
setHeaderSorter
Overwite the default header card sorter.- Parameters:
headerSorter
- the sorter tu use or null to disable sorting
-
setNaxes
Deprecated.(for internal use) Visibility will be reduced to the package level in the future.Set the value of the NAXIS keyword- Parameters:
val
- The dimensionality of the data.
-
setNaxis
Deprecated.(for internal use) Visibility will be reduced to the package level in the future.Set the dimension for a given axis.- Parameters:
axis
- The axis being set.dim
- The dimension
-
setSimple
Deprecated.(for internall use) Visibility will be reduced to the package level in the future.Set the SIMPLE keyword to the given value.- Parameters:
val
-true
for the primary header, otherwisefalse
-
setXtension
Deprecated.(for internall use) Visibility will be reduced to the package level in the future.Set the XTENSION keyword to the given value.- Parameters:
val
- The name of the extension.- Throws:
IllegalArgumentException
- if the string value contains characters that are not allowed in FITS headers, that is characters outside of the 0x20 thru 0x7E range.
-
size
Deprecated.usegetNumberOfCards()
. The units of the size of the header may be unclear.- Returns:
- the number of cards in the header
-
updateLine
Update a valued entry in the header, or adds a new header entry. If the header does not contain a prior entry for the specific keyword, or if the keyword is a comment-style key, a new entry is added at the current editing position. Otherwise, the matching existing entry is updated in situ.- Parameters:
key
- The key of the card to be replaced (or added).card
- A new card- Throws:
HeaderCardException
- if the operation failed
-
updateLine
Update an existing card in situ, without affecting the current position, or else add a new card at the current position.- Parameters:
key
- The key of the card to be replaced.card
- A new card- Throws:
HeaderCardException
- if the operation failed
-
updateLines
Overwrite the lines in the header. Add the new PHDU header to the current one. If keywords appear twice, the new value and comment overwrite the current contents. By Richard J Mathar.- Parameters:
newHdr
- the list of new header data lines to replace the current ones.- Throws:
HeaderCardException
- if the operation failed- See Also:
-
validate
Validates this header by making it a proper primary or extension header. In both cases it means adding required keywords if missing, and removing conflicting cards. Then ordering is checked and corrected as necessary and ensures that theEND
card is at the tail.- Parameters:
asPrimary
-true
if this header is to be a primary FITS header- Throws:
FitsException
- If there was an issue getting the header into proper form.- Since:
- 1.17
-
writeUnchecked
(for internal use) Similar towrite(ArrayDataOutput)
, but writes the header as is, without ensuring that mandatory keys are present, and in the correct order, or that checksums are updated.- Parameters:
out
- The output file or stream to which to write- Throws:
FitsException
- if there was a violation of the FITS standardIOException
- if the output was not accessible- Since:
- 1.20.1
- See Also:
-
write
Description copied from interface:FitsElement
Writes the contents of the element to a data sink, adding padding as necessary if the element (such as a header or data segment) is expected to complete the FITS block of 2880 bytes.- Specified by:
write
in interfaceFitsElement
- Parameters:
out
- The data sink.- Throws:
FitsException
- if the write was unsuccessful.
-
setParserWarningsEnabled
public static void setParserWarningsEnabled(boolean value) Sets whether warnings about FITS standard violations are logged when a header is being read (parsed). Enabling this feature can help identifying various standard violations in existing FITS headers, which nevertheless do not prevent the successful reading of the header by this library.
If
FitsFactory.setAllowHeaderRepairs(boolean)
is setfalse
, this will affect only minor violations (e.g. a misplaced '=', missing space after '=', non-standard characters in header etc.), which nevertheless do not interfere with the unamiguous parsing of the header information. More severe standard violations, where some guessing may be required about the intent of some malformed header record, will throw appropriate exceptions. If, however,FitsFactory.setAllowHeaderRepairs(boolean)
is settrue
, the parsing will throw fewer exceptions, and the additional issues may get logged as additional warning instead.- Parameters:
value
-true
if parser warnings about FITS standard violations when reading in existing FITS headers are to be logged, otherwisefalse
- Since:
- 1.16
- See Also:
-
isParserWarningsEnabled
public static boolean isParserWarningsEnabled()Checks whether warnings about FITS standard violations are logged when a header is being read (parsed).- Returns:
true
if parser warnings about FITS standard violations when reading in existing FITS headers are enabled and logged, otherwisefalse
- Since:
- 1.16
- See Also:
-
getCommentAlignPosition
public static int getCommentAlignPosition()Returns the current preferred alignment character position of inline header comments. This is the position at which the '/' is placed for the inline comment. #deprecated- Returns:
- The current alignment position for inline comments.
- Since:
- 1.17
- See Also:
-
setCommentAlignPosition
Deprecated.Not recommended as it may violate the FITS standart for 'fixed-format' header entries, and make our FITS files unreadable by software that expects strict adherence to the standard. We will remove this feature in the future.Sets a new alignment position for inline header comments.- Parameters:
pos
- [20:70] The character position to which inline comments should be aligned if possible.- Throws:
IllegalArgumentException
- if the position is outside of the allowed range.- Since:
- 1.17
- See Also:
-