Interface IHeaderAccess
- All Known Implementing Classes:
HeaderAccess
,HeaderCardAccess
(for internal use) Interface for accessing FITS header values with runtime exceptions only. Regular header
access throws HeaderCardException
s, which are hard exceptions. They really should have been softer runtime
exceptions from the start, but unfortunately that was choice this library made a very long time ago, and we therefore
stick to it, at least until the next major code revision (major version 2 at the earliest). So this class provides an
alternative access to headers converting any HeaderCardException
s to IllegalArgumentException
.
This is really just a rusty rail implementation, and rather incopmlete at it too. It has very limited support for header access, geared very specifically towards supporting the compression classes of this library, and not mean for use beyond.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
addValue
(IFitsHeader key, int value) Deprecated.Just add values to the header directlydefault void
addValue
(IFitsHeader key, String value) Deprecated.Just add values to the header directlydefault HeaderCard
Deprecated.UseHeader.getCard(String)
instead.default HeaderCard
findCard
(IFitsHeader key) Deprecated.UseHeader.getCard(IFitsHeader)
instead.Deprecated.Returns the header that this class is providing access to.
-
Method Details
-
getHeader
Header getHeader()Deprecated.Returns the header that this class is providing access to.- Returns:
- the Header that we access through this class
- Since:
- 1.19
-
addValue
Deprecated.Just add values to the header directlySets a new integer value for the specified FITS keyword, adding it to the FITS header if necessary.- Parameters:
key
- the standard or conventional FITS header keywordvalue
- the integer value to assign to the keyword- Throws:
IllegalArgumentException
- if the value could not be set as requested.
-
addValue
Deprecated.Just add values to the header directlySets a new string value for the specified FITS keyword, adding it to the FITS header if necessary.- Parameters:
key
- the standard or conventional FITS header keywordvalue
- the string value to assign to the keyword- Throws:
IllegalArgumentException
- if the value could not be set as requested.
-
findCard
Deprecated.UseHeader.getCard(IFitsHeader)
instead.Returns the FITS header card for the given FITS keyword. It does not set a mark in the header for new additions, making it more similar toHeader.getCard(IFitsHeader)
.- Parameters:
key
- the standard or conventional FITS header keyword- Returns:
- the matching FITS header card, or
null
if there is no such card within out grasp.
-
findCard
Deprecated.UseHeader.getCard(String)
instead.Returns the FITS header card for the given FITS keyword. It does not set a mark in the header for new additions, making it more similar toHeader.getCard(String)
.- Parameters:
key
- the FITS header keyword- Returns:
- the matching FITS header card, or
null
if there is no such card within out grasp.
-
Header
threw hardHeaderCardException
, and this class was added so we can convert these into softIllegalArgumentException
instead. However, now that we demotedHeaderCardException
to be soft exceptions itself, there is no reason to convert. It just adds confusion.