Class HeaderAccess

java.lang.Object
nom.tam.fits.compression.provider.param.api.HeaderAccess
All Implemented Interfaces:
IHeaderAccess

public class HeaderAccess extends Object implements IHeaderAccess
(for internal use) Access to FITS header values with runtime exceptions only. Regular header access throws 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 headers converting any HeaderCardExceptions to IllegalArgumentException.
See Also:
  • Constructor Details

    • HeaderAccess

      public HeaderAccess(Header header)

      Creates a new access to modifying a HeaderCard without the hard exceptions that HeaderCard may throw.

      Parameters:
      header - the FITS header we wish to access and modify
  • Method Details

    • addValue

      public void addValue(IFitsHeader key, int value)
      Description copied from interface: IHeaderAccess
      Sets a new integer value for the specified FITS keyword, adding it to the FITS header if necessary.
      Specified by:
      addValue in interface IHeaderAccess
      Parameters:
      key - the standard or conventional FITS header keyword
      value - the integer value to assign to the keyword
    • addValue

      public void addValue(IFitsHeader key, String value)
      Description copied from interface: IHeaderAccess
      Sets a new string value for the specified FITS keyword, adding it to the FITS header if necessary.
      Specified by:
      addValue in interface IHeaderAccess
      Parameters:
      key - the standard or conventional FITS header keyword
      value - the string value to assign to the keyword
    • findCard

      public HeaderCard findCard(IFitsHeader key)
      Description copied from interface: IHeaderAccess
      Returns the FITS header card for the given FITS keyword.
      Specified by:
      findCard in interface IHeaderAccess
      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

      public HeaderCard findCard(String key)
      Description copied from interface: IHeaderAccess
      Returns the FITS header card for the given FITS keyword.
      Specified by:
      findCard in interface IHeaderAccess
      Parameters:
      key - the FITS header keyword
      Returns:
      the matching FITS header card, or null if there is no such card within out grasp.