public class CardFactory
extends java.lang.Object
Attempts to construct illegal FITS headers will generally provoke RuntimeExceptions.
Modifier and Type | Class and Description |
---|---|
static interface |
CardFactory.Config
CardFactory configuration.
|
Modifier and Type | Field and Description |
---|---|
static CardFactory |
CLASSIC
Instance with silent value trimming and no HIERARCH.
|
static CardFactory |
DEFAULT
Default instance.
|
static CardImage |
END_CARD
CardImage for terminating header ("END").
|
static CardFactory |
HIERARCH
Instance with value trimming and HIERARCH support.
|
static CardFactory |
STRICT
Instance with no value trimming and no HIERARCH.
|
Constructor and Description |
---|
CardFactory(CardFactory.Config config)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
CardImage |
createCommentCard(java.lang.String txt)
Constructs a COMMENT card with the given comment.
|
CardImage |
createIntegerCard(java.lang.String key,
long value,
java.lang.String comment)
Constructs a key-value card with integer content.
|
CardImage |
createLiteralCard(java.lang.String key,
java.lang.String literal,
java.lang.String comment)
Constructs a key-value card with given literal text for the value part.
|
CardImage |
createLogicalCard(java.lang.String key,
boolean value,
java.lang.String comment)
Constructs a key-value card with logical content
|
CardImage |
createPlainCard(java.lang.String txt)
Constructs a card containing the given exact text.
|
CardImage |
createRealCard(java.lang.String key,
double value,
java.lang.String comment)
Constructs a key-value card with floating point content.
|
CardImage |
createStringCard(java.lang.String key,
java.lang.String value,
java.lang.String comment)
Constructs a key-value card with string content.
|
CardFactory.Config |
getConfig()
Returns the configuration state of this factory.
|
public static final CardFactory CLASSIC
public static final CardFactory HIERARCH
public static final CardFactory STRICT
public static final CardFactory DEFAULT
public static final CardImage END_CARD
public CardFactory(CardFactory.Config config)
config
- factory configurationpublic CardFactory.Config getConfig()
public CardImage createPlainCard(java.lang.String txt)
txt
- literal card content, <=80 characterspublic CardImage createCommentCard(java.lang.String txt)
txt
- comment textpublic CardImage createStringCard(java.lang.String key, java.lang.String value, java.lang.String comment)
key
- header keywordvalue
- header valuecomment
- comment text, or nullpublic CardImage createIntegerCard(java.lang.String key, long value, java.lang.String comment)
key
- header keywordvalue
- header valuecomment
- comment text, or nullpublic CardImage createRealCard(java.lang.String key, double value, java.lang.String comment)
key
- header keywordvalue
- header valuecomment
- comment text, or nullpublic CardImage createLogicalCard(java.lang.String key, boolean value, java.lang.String comment)
key
- header keywordvalue
- header valuecomment
- comment text, or nullpublic CardImage createLiteralCard(java.lang.String key, java.lang.String literal, java.lang.String comment)
key
- header keywordliteral
- formatted value textcomment
- comment text, or null