Class CardType<T>


  • public class CardType<T>
    extends java.lang.Object
    Defines different types of FITS header card. Each instance knows how to parse an 80-byte card.
    Since:
    4 Mar 2022
    Author:
    Mark Taylor
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.util.List<CardType<?>> CARD_TYPES
      Unmofifiable list of all known card types.
      static CardType<java.lang.Void> COMMENT
      COMMENT card type.
      static CardType<java.lang.Void> COMMENT_BLANK
      Card type with nothing in the keyword field.
      static CardType<java.lang.Void> COMMENT_OTHER
      Non-standard comment card (no value indicator).
      static CardType<double[]> COMPLEX
      Standard key/value card with complex content.
      static CardType<double[]> COMPLEX_HIER
      HIERARCH key/value card with complex content.
      static CardType<java.lang.String> CONTINUE
      CONTINUE card type.
      static CardType<java.lang.Void> END
      END card type.
      static CardType<java.lang.Void> HISTORY
      HISTORY card type.
      static CardType<java.math.BigInteger> INTEGER
      Standard key/value card with integer content.
      static CardType<java.math.BigInteger> INTEGER_HIER
      HIERARCH key/value card with integer content.
      static CardType<java.lang.Boolean> LOGICAL
      Standard key/value card with logical content.
      static CardType<java.lang.Boolean> LOGICAL_HIER
      HIERARCH key/value card with logical content.
      static CardType<java.lang.Double> REAL
      Standard key/value card with floating point content.
      static CardType<java.lang.Double> REAL_HIER
      HIERARCH key/value card with floating point content.
      static CardType<java.lang.String> STRING
      Standard key/value card with string content.
      static CardType<java.lang.String> STRING_HIER
      HIERARCH key/value card with string content.
      static CardType<java.lang.Void> UNKNOWN
      Catch-all card type - apparently not legal FITS.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Class<T> getValueClass()
      Returns the type of values yielded by this CardType.
      ParsedCard<T> toCard​(java.lang.String txt80)
      Parses an 80-character string as a FITS header card.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • HISTORY

        public static final CardType<java.lang.Void> HISTORY
        HISTORY card type.
      • COMMENT

        public static final CardType<java.lang.Void> COMMENT
        COMMENT card type.
      • COMMENT_BLANK

        public static final CardType<java.lang.Void> COMMENT_BLANK
        Card type with nothing in the keyword field.
      • CONTINUE

        public static final CardType<java.lang.String> CONTINUE
        CONTINUE card type.
      • END

        public static final CardType<java.lang.Void> END
        END card type.
      • STRING

        public static final CardType<java.lang.String> STRING
        Standard key/value card with string content.
      • STRING_HIER

        public static final CardType<java.lang.String> STRING_HIER
        HIERARCH key/value card with string content.
      • LOGICAL

        public static final CardType<java.lang.Boolean> LOGICAL
        Standard key/value card with logical content.
      • LOGICAL_HIER

        public static final CardType<java.lang.Boolean> LOGICAL_HIER
        HIERARCH key/value card with logical content.
      • INTEGER

        public static final CardType<java.math.BigInteger> INTEGER
        Standard key/value card with integer content.
      • INTEGER_HIER

        public static final CardType<java.math.BigInteger> INTEGER_HIER
        HIERARCH key/value card with integer content.
      • REAL

        public static final CardType<java.lang.Double> REAL
        Standard key/value card with floating point content.
      • REAL_HIER

        public static final CardType<java.lang.Double> REAL_HIER
        HIERARCH key/value card with floating point content.
      • COMPLEX

        public static final CardType<double[]> COMPLEX
        Standard key/value card with complex content.
      • COMPLEX_HIER

        public static final CardType<double[]> COMPLEX_HIER
        HIERARCH key/value card with complex content.
      • COMMENT_OTHER

        public static final CardType<java.lang.Void> COMMENT_OTHER
        Non-standard comment card (no value indicator).
      • UNKNOWN

        public static final CardType<java.lang.Void> UNKNOWN
        Catch-all card type - apparently not legal FITS.
      • CARD_TYPES

        public static final java.util.List<CardType<?>> CARD_TYPES
        Unmofifiable list of all known card types.
    • Method Detail

      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getValueClass

        public java.lang.Class<T> getValueClass()
        Returns the type of values yielded by this CardType.
        Returns:
        value class
      • toCard

        public ParsedCard<T> toCard​(java.lang.String txt80)
        Parses an 80-character string as a FITS header card.
        Parameters:
        txt80 - 80-character string, should be ASCII-clean
        Returns:
        parsed header card of this type, or null if card cannot be parsed as this type