# Class CardType<T>

java.lang.Object
uk.ac.starlink.fits.CardType<T>

public class CardType<T> extends 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 final List<CardType<?>>`
`CARD_TYPES`
Unmofifiable list of all known card types.
`static final CardType<Void>`
`COMMENT`
COMMENT card type.
`static final CardType<Void>`
`COMMENT_BLANK`
Card type with nothing in the keyword field.
`static final CardType<Void>`
`COMMENT_OTHER`
Non-standard comment card (no value indicator).
`static final CardType<double[]>`
`COMPLEX`
Standard key/value card with complex content.
`static final CardType<double[]>`
`COMPLEX_HIER`
HIERARCH key/value card with complex content.
`static final CardType<String>`
`CONTINUE`
CONTINUE card type.
`static final CardType<Void>`
`END`
END card type.
`static final CardType<Void>`
`HISTORY`
HISTORY card type.
`static final CardType<BigInteger>`
`INTEGER`
Standard key/value card with integer content.
`static final CardType<BigInteger>`
`INTEGER_HIER`
HIERARCH key/value card with integer content.
`static final CardType<Boolean>`
`LOGICAL`
Standard key/value card with logical content.
`static final CardType<Boolean>`
`LOGICAL_HIER`
HIERARCH key/value card with logical content.
`static final CardType<Double>`
`REAL`
Standard key/value card with floating point content.
`static final CardType<Double>`
`REAL_HIER`
HIERARCH key/value card with floating point content.
`static final CardType<String>`
`STRING`
Standard key/value card with string content.
`static final CardType<String>`
`STRING_HIER`
HIERARCH key/value card with string content.
`static final CardType<Void>`
`UNKNOWN`
Catch-all card type - apparently not legal FITS.

## Method Summary

Modifier and Type
Method
Description
`Class<T>`
`getValueClass()`
Returns the type of values yielded by this CardType.
`ParsedCard<T>`
`toCard(String txt80)`
Parses an 80-character string as a FITS header card.
`String`
`toString()`

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Field Details

### HISTORY

public static final CardType<Void> HISTORY
HISTORY card type.

### COMMENT

public static final CardType<Void> COMMENT
COMMENT card type.

### COMMENT_BLANK

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

### CONTINUE

public static final CardType<String> CONTINUE
CONTINUE card type.

### END

public static final CardType<Void> END
END card type.

### STRING

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

### STRING_HIER

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

### LOGICAL

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

### LOGICAL_HIER

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

### INTEGER

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

### INTEGER_HIER

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

### REAL

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

### REAL_HIER

public static final CardType<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<Void> COMMENT_OTHER
Non-standard comment card (no value indicator).

### UNKNOWN

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

### CARD_TYPES

public static final List<CardType<?>> CARD_TYPES
Unmofifiable list of all known card types.

## Method Details

### toString

public String toString()

Overrides:
  `toString` in class `Object`

### getValueClass

public Class<T> getValueClass()
Returns the type of values yielded by this CardType.

Returns:
  value class

### toCard

public ParsedCard<T> toCard(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