uk.ac.starlink.fits
Class HeaderCards

java.lang.Object
  extended by uk.ac.starlink.fits.HeaderCards

public class HeaderCards
extends java.lang.Object

Controlled access to a collection of FITS header cards. Currently decorates the Header class, but could be implemented on top of some other (possibly custom) header cards parser implementation.

Since:
12 Nov 2007

Field Summary
 java.lang.String[] BORING_KEYS
          Keywords which are never used as table parameters.
 
Constructor Summary
HeaderCards(nom.tam.fits.Header hdr)
          Constructor.
 
Method Summary
 boolean containsKey(java.lang.String key)
          Indicates whether the header collection contains a card with the given keyword.
 java.lang.Double getDoubleValue(java.lang.String key)
          Returns the double value for a card with a given key.
 java.lang.Integer getIntValue(java.lang.String key)
          Returns the integer value for a card with a given key.
 java.lang.Long getLongValue(java.lang.String key)
          Returns the long value for a card with a given key.
 java.lang.String getStringValue(java.lang.String key)
          Returns the string value for a card with a given key.
 DescribedValue[] getUnusedParams()
          Returns an array of DescribedValue objects suitable for use as items of per-table metadata derived from this FITS header.
 void useKey(java.lang.String key)
          Marks a given keyword as used.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BORING_KEYS

public final java.lang.String[] BORING_KEYS
Keywords which are never used as table parameters.

Constructor Detail

HeaderCards

public HeaderCards(nom.tam.fits.Header hdr)
Constructor.

Parameters:
hdr - FITS header object
Method Detail

getIntValue

public java.lang.Integer getIntValue(java.lang.String key)
Returns the integer value for a card with a given key.

Parameters:
key - header keyword
Returns:
integer value, or null

getLongValue

public java.lang.Long getLongValue(java.lang.String key)
Returns the long value for a card with a given key.

Parameters:
key - header keyword
Returns:
long value, or null

getDoubleValue

public java.lang.Double getDoubleValue(java.lang.String key)
Returns the double value for a card with a given key.

Parameters:
key - header keyword
Returns:
double value, or null

getStringValue

public java.lang.String getStringValue(java.lang.String key)
Returns the string value for a card with a given key.

Parameters:
key - header keyword
Returns:
string value, or null

useKey

public void useKey(java.lang.String key)
Marks a given keyword as used. This is invoked by all the get*Value methods.

Parameters:
key - header keyword

containsKey

public boolean containsKey(java.lang.String key)
Indicates whether the header collection contains a card with the given keyword.

Parameters:
key - header keyword
Returns:
true iff key is present

getUnusedParams

public DescribedValue[] getUnusedParams()
Returns an array of DescribedValue objects suitable for use as items of per-table metadata derived from this FITS header. This contains entries for every card which has not already been queried within this object (for which useKey(java.lang.String) has not been explicitly or implicitly called. Certain standard structural FITS keywords (BORING_KEYS) are ignored as well.

The idea is that keywords which have already been read to determine table structure do not need to be recorded separately since their meaning is implicitly included in the table metadata already.

Returns:
array of table parameters relating to this object