Class HeaderCardAccess
- All Implemented Interfaces:
IHeaderAccess
(for internal use) Access to a specific FITS header card with runtime exceptions only. Regular modifications
to HeaderCard may throw HeaderCardExceptions, 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 a header card converting any HeaderCardExceptions to
IllegalArgumentException.
Unlike HeaderAccess this class operates on single cards. Methods that specify a keywords are applied to the
selected card if and only if the keyword matches that of the card's keyword.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionHeaderCardAccess(IFitsHeader headerCard, String value) Creates a new access to modifying aHeaderCardwithout the hard exceptions thatHeaderCardmay throw. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddValue(IFitsHeader key, int value) Sets a new integer value for the specified FITS keyword, adding it to the FITS header if necessary.voidaddValue(IFitsHeader key, String value) Sets a new string value for the specified FITS keyword, adding it to the FITS header if necessary.Returns the FITS header card for the given FITS keyword.findCard(IFitsHeader key) Returns the FITS header card for the given FITS keyword.
-
Constructor Details
-
HeaderCardAccess
Creates a new access to modifying a
HeaderCardwithout the hard exceptions thatHeaderCardmay throw.Unlike
HeaderAccessthis class operates on single cards. Methods that specify a keywords are applied to the selected card if and only if the keyword matches that of the card's keyword.- Parameters:
headerCard- the FITS keyword of the card we will provide access tovalue- the initial string value for the card (assuming the keyword allows string values).
-
-
Method Details
-
addValue
Description copied from interface:IHeaderAccessSets a new integer value for the specified FITS keyword, adding it to the FITS header if necessary.- Specified by:
addValuein interfaceIHeaderAccess- Parameters:
key- the standard or conventional FITS header keywordvalue- the integer value to assign to the keyword
-
addValue
Description copied from interface:IHeaderAccessSets a new string value for the specified FITS keyword, adding it to the FITS header if necessary.- Specified by:
addValuein interfaceIHeaderAccess- Parameters:
key- the standard or conventional FITS header keywordvalue- the string value to assign to the keyword
-
findCard
Description copied from interface:IHeaderAccessReturns the FITS header card for the given FITS keyword.- Specified by:
findCardin interfaceIHeaderAccess- Parameters:
key- the standard or conventional FITS header keyword- Returns:
- the matching FITS header card, or
nullif there is no such card within out grasp.
-
findCard
Description copied from interface:IHeaderAccessReturns the FITS header card for the given FITS keyword.- Specified by:
findCardin interfaceIHeaderAccess- Parameters:
key- the FITS header keyword- Returns:
- the matching FITS header card, or
nullif there is no such card within out grasp.
-