public class HeaderCardDescriptor extends Object implements Serializable
| Modifier and Type | Class and Description |
|---|---|
static class |
HeaderCardDescriptor.Type
How the string descriptor should be converted into a value.
|
| Modifier and Type | Field and Description |
|---|---|
private String |
describe |
private static DateFormat |
FITSDATE
The formatter for fits dates.
|
private HeaderCardDescriptor.Type |
how |
private String |
key |
private String |
rem |
private static long |
serialVersionUID |
| Constructor and Description |
|---|
HeaderCardDescriptor(String k,
String value,
String comment) |
HeaderCardDescriptor(String k,
String value,
String comment,
HeaderCardDescriptor.Type parse) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object that)
Equal, key, descriptor and how.
|
static List<HeaderCardDescriptor> |
fromProperty(String t)
Convenience method that parses a property string into a list of
header card descriptos.
|
static List<HeaderCardDescriptor> |
fromProperty(String t,
HeaderCardDescriptor.Type def)
Convenience method that parses a property string into a list of
header card descriptos.
|
String |
getComment()
Returns the comment, if any.
|
String |
getDescription()
Returns the value descriptor part of this object.
|
String |
getKey()
Returns the key, not trimmed to any required length.
|
int |
hashCode()
Hash code of key.
|
static HeaderCardDescriptor |
parse(String p)
Parses a header card description from a single string.
|
static HeaderCardDescriptor |
parse(String p,
HeaderCardDescriptor.Type deftype)
Parses a header card description from a single string.
|
private static Object |
probe(Object value)
Tries to convert a string value into a fits-header key
understandable object.
|
MHeaderCard |
toCard(GlobalGrouping set,
Map<String,Object> extern)
Converts the header card descriptor to a valid herader card
reference at run-time, allowing filling in of values for sysmbols.
|
String |
toString()
Reveresers the parse operation.
|
private static final long serialVersionUID
private static final DateFormat FITSDATE
private final String key
private final String describe
private final String rem
private final HeaderCardDescriptor.Type how
public HeaderCardDescriptor(String k, String value, String comment, HeaderCardDescriptor.Type parse)
public String getDescription()
public String getKey()
public String getComment()
public MHeaderCard toCard(GlobalGrouping set, Map<String,Object> extern) throws HeaderFieldException
getDescription() part
of the descriptor. If this parameter is found, and has a
none-null value, we probe(java.lang.Object) for its run-time class before
converting the parameter value to the header card. If the type is
EXTERNAL, the external map is used to find a value according to
the descriptors name. Again, the return value is probed for
its type. A PROBE type means the the string descriptor itself is
probed for conversion to any of the HeaderCard supported classes
Long, Double, or Boolean (fallback is String), a type of
NONE always returns the desriptor as a string value header card.HeaderFieldExceptionprivate static Object probe(Object value)
public boolean equals(Object that)
public String toString()
public static HeaderCardDescriptor parse(String p) throws ParseException
ParseExceptionpublic static HeaderCardDescriptor parse(String p, HeaderCardDescriptor.Type deftype) throws ParseException
ParseExceptionpublic static List<HeaderCardDescriptor> fromProperty(String t)
public static List<HeaderCardDescriptor> fromProperty(String t, HeaderCardDescriptor.Type def)