Package uk.me.nxg.unity
Enum Syntax
- java.lang.Object
-
- java.lang.Enum<Syntax>
-
- uk.me.nxg.unity.Syntax
-
-
Enum Constant Summary
Enum Constants Enum Constant Description ALLA wildcard ‘syntax’, denoting all available syntaxes.CDSThe syntax for CDS-format strings.DEBUGThe formatter (not parser) for debugging output.FITSThe syntax for FITS-format strings.LATEXThe formatter (not parser) for LaTeX/siunitx output.OGIPThe syntax for OGIP-format strings.VOUNITSThe syntax for VOUnit-format strings.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanisReadable()Indicates whether the syntax is a readable one.booleanisWritable()Indicates whether the syntax is a writable one.static Syntaxlookup(java.lang.String name)Look up a syntax enumeration from a string name.java.lang.StringtoString()Returns a string version of the syntax namestatic SyntaxvalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static Syntax[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
VOUNITS
public static final Syntax VOUNITS
The syntax for VOUnit-format strings. This is intended to be as nearly as possible in the intersection of the various other grammars. It is a strict subset of the FITS and CDS grammars (in the sense that any VOUnit unit string is a valid FITS and CDS string, too), and it is almost a subset of the OGIP grammar, except that it uses the dot for multiplication rather than star. See IVOA VOUnits Proposed Recommendation.
-
FITS
public static final Syntax FITS
The syntax for FITS-format strings. Parses unit strings according to the prescriptions in the FITS specification, v3.0, section 4.3 (W.D. Pence et al., A&A 524, A42, 2010. doi:10.1051/0004-6361/201015362).
-
OGIP
public static final Syntax OGIP
The syntax for OGIP-format strings. The format defined in OGIP memo OGIP/93-001, 1993 (postscript via FTP)
-
CDS
public static final Syntax CDS
The syntax for CDS-format strings. A syntax based on the CDS document Standards for Astronomical Catalogues, Version 2.0, 2000, specifically section 3.2. Seehttp://cdsweb.u-strasbg.fr/doc/catstd-3.2.htx
-
LATEX
public static final Syntax LATEX
The formatter (not parser) for LaTeX/siunitx output.
-
DEBUG
public static final Syntax DEBUG
The formatter (not parser) for debugging output. This is intended to display the results of a parse unambiguously. The format of the output is not specified, and may change without notice.
-
ALL
public static final Syntax ALL
A wildcard ‘syntax’, denoting all available syntaxes. This syntax is neither readable nor writable.
-
-
Method Detail
-
values
public static Syntax[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (Syntax c : Syntax.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static Syntax valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException- if this enum type has no constant with the specified namejava.lang.NullPointerException- if the argument is null
-
toString
public java.lang.String toString()
Returns a string version of the syntax name- Overrides:
toStringin classjava.lang.Enum<Syntax>
-
isReadable
public boolean isReadable()
Indicates whether the syntax is a readable one. The LaTeX and ‘debug’ syntaxes, for example, are write-only.- Returns:
- true if the syntax is readable
-
isWritable
public boolean isWritable()
Indicates whether the syntax is a writable one. At present, all the syntaxes are writable, except forALL.- Returns:
- true if the syntax is writable
-
lookup
public static Syntax lookup(java.lang.String name)
Look up a syntax enumeration from a string name.- Parameters:
name- the name of a syntax- Returns:
- a Syntax, or null if the name was not recognised
-
-