uk.me.nxg.unity
Enum Syntax

java.lang.Object
  extended by java.lang.Enum<Syntax>
      extended by uk.me.nxg.unity.Syntax
All Implemented Interfaces:
Serializable, Comparable<Syntax>

public enum Syntax
extends Enum<Syntax>

An enumeration of the allowed syntaxes within the Unity libary.


Enum Constant Summary
CDS
          The syntax for CDS-format strings.
DEBUG
          The formatter (not parser) for debugging output.
FITS
          The syntax for FITS-format strings.
LATEX
          The formatter (not parser) for LaTeX/siunitx output.
OGIP
          The syntax for OGIP-format strings.
VOUNITS
          The syntax for VOUnit-format strings.
 
Method Summary
 boolean isReadable()
          Indicates whether the syntax is a readable one.
 boolean isWritable()
          Indicates whether the syntax is a writable one.
static Syntax lookup(String name)
          Look up a syntax enumeration from a string name.
 String toString()
          Returns a string version of the syntax name
static Syntax valueOf(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.
 
Methods inherited from class java.lang.Enum
compareTo, equals, getDeclaringClass, hashCode, name, ordinal, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

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. See http://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.

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(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:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

toString

public String toString()
Returns a string version of the syntax name

Overrides:
toString in class Enum<Syntax>

isReadable

public boolean isReadable()
Indicates whether the syntax is a readable one. The LaTeX and 'debug' syntaxes, for example, are write-only.


isWritable

public boolean isWritable()
Indicates whether the syntax is a writable one. At present, all the syntaxes are writable.


lookup

public static Syntax lookup(String name)
Look up a syntax enumeration from a string name.

Returns:
a Syntax, or null if the name was not recognised