Interface IHierarchKeyFormatter

All Known Implementing Classes:
BlanksDotHierarchKeyFormatter, StandardIHierarchKeyFormatter

public interface IHierarchKeyFormatter
Interface for formatting HIERARCH-style header keywords. Our own standard is to define such keywords internally as starting with the string HIERARCH. followed by a dot-separated hierarchy, or just an unusually long FITS keywords that cannot be represented by a standard 8-byte keyword. The HIERARCH formatted will take such string keywords and will format them according to its rules when writing them to FITS headers.
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    append(String key, nom.tam.fits.utilities.FitsLineAppender buffer)
    Appends the formatted HIERARCH keyword to the Fits line buffer.
    default String
    Returns the assignment string that separates the hierarchical key and value components, for the given amount of space available.
    int
    Returns the extra spaces required when printing the key, relative to a space separated components following "HIERARCH " and the "= " prior to the value.
    default int
    Returns the minimum length of the sequence that separates keywords from values.
    boolean
    Checks if this formatter allows support for case-sensitive (mixed-case) hierarchical keywords.
    void
    setCaseSensitive(boolean value)
    Sets whether case-sensitive (mixed-case) HIERARCH keywords are supported.
    Returns the string reppresentation of the specified HIERARCH keyword in the FITS header
  • Method Details

    • toHeaderString

      String toHeaderString(String key)
      Returns the string reppresentation of the specified HIERARCH keyword in the FITS header
      Parameters:
      key - the HIERARCH keyword, in the dot separated convention of this library
      Returns:
      how this key looks in the FITS header with this formatting convention.
      Since:
      1.16
    • append

      void append(String key, nom.tam.fits.utilities.FitsLineAppender buffer)
      Appends the formatted HIERARCH keyword to the Fits line buffer. For example as a step towards builing up the header card for this keyword.
      Parameters:
      key - The HIERARCH keyword in out own internal representation (HIERARCH. followed by the dot-sepatated hierarchical components).
      buffer - The FITS line buffer to which we want the formatted HIERARCH-style keyword to be appended.
    • getExtraSpaceRequired

      int getExtraSpaceRequired(String key)
      Returns the extra spaces required when printing the key, relative to a space separated components following "HIERARCH " and the "= " prior to the value.
      Parameters:
      key - the HIERARCH-style header key.
      Returns:
      the number of extra spaces relative to the most compact notation for the components.
      Since:
      1.16
    • setCaseSensitive

      void setCaseSensitive(boolean value)
      Sets whether case-sensitive (mixed-case) HIERARCH keywords are supported.
      Parameters:
      value - If false (default), then all HIERARCH keywords will be converted to upper-case. Otherwise, case will be preserved.
      Since:
      1.16
      See Also:
    • isCaseSensitive

      boolean isCaseSensitive()
      Checks if this formatter allows support for case-sensitive (mixed-case) hierarchical keywords.
      Returns:
      If false (default), then all HIERARCH keywords will be converted to upper-case. Otherwise, case will be preserved.
      Since:
      1.16
    • getAssignStringForSpace

      default String getAssignStringForSpace(int space)
      Returns the assignment string that separates the hierarchical key and value components, for the given amount of space available. For example, the ESO HIERARCH convention just requires an '=' character (1 byte), but it is common to surround it with spaces before and after (3 bytes). As the spaces before an after are optional, the assignment can occupy anywhere between 1 to 3 bytes in the header card. So we can use the 3-byte version if there is room, or squeeze it down as needed.
      Parameters:
      space - (bytes) Number of characters available for the assignment marker to separate the keyword from the value part.
      Returns:
      The string to use for the assignment marker. If the space is smaller than the minimum assignment string length, then it returns the minimal assignment string.
      Since:
      1.20.2
      See Also:
    • getMinAssignLength

      default int getMinAssignLength()
      Returns the minimum length of the sequence that separates keywords from values.
      Returns:
      the length of the minimal key/value separator string.
      Since:
      1.20.2
      See Also: