uk.ac.bristol.star.cdf.record
Enum NumericEncoding

java.lang.Object
  extended by java.lang.Enum<NumericEncoding>
      extended by uk.ac.bristol.star.cdf.record.NumericEncoding
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<NumericEncoding>

public enum NumericEncoding
extends java.lang.Enum<NumericEncoding>

Enumeration of numeric encoding values supported by CDF.

Since:
20 Jun 2013

Enum Constant Summary
ALPHAOSF1
           
ALPHAVMSd
           
ALPHAVMSg
           
ALPHAVMSi
           
DECSTATION
           
HP
           
IBMPC
           
IBMRS
           
MAC
           
NETWORK
           
NeXT
           
SGi
           
SUN
           
VAX
           
 
Method Summary
static NumericEncoding getEncoding(int code)
          Returns the encoding corresponding to the value of the encoding field of the CDF Descriptor Record.
 java.lang.Boolean isBigendian()
          Gives the big/little-endianness of this encoding, if that's all the work that has to be done.
static NumericEncoding valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static NumericEncoding[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

NETWORK

public static final NumericEncoding NETWORK

SUN

public static final NumericEncoding SUN

NeXT

public static final NumericEncoding NeXT

MAC

public static final NumericEncoding MAC

HP

public static final NumericEncoding HP

SGi

public static final NumericEncoding SGi

IBMRS

public static final NumericEncoding IBMRS

DECSTATION

public static final NumericEncoding DECSTATION

IBMPC

public static final NumericEncoding IBMPC

ALPHAOSF1

public static final NumericEncoding ALPHAOSF1

ALPHAVMSi

public static final NumericEncoding ALPHAVMSi

VAX

public static final NumericEncoding VAX

ALPHAVMSd

public static final NumericEncoding ALPHAVMSd

ALPHAVMSg

public static final NumericEncoding ALPHAVMSg
Method Detail

values

public static NumericEncoding[] 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 (NumericEncoding c : NumericEncoding.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static NumericEncoding 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 name
java.lang.NullPointerException - if the argument is null

isBigendian

public java.lang.Boolean isBigendian()
Gives the big/little-endianness of this encoding, if that's all the work that has to be done. If the return value is non-null, then numeric values are encoded the same way that java does it (two's complement for integers and IEEE754 for floating point) with big- or little-endian byte ordering, according to the return value. Otherwise, some unspecified encoding is in operation.

Returns:
TRUE for simple big-endian, FALSE for simple little-endian, null for something weird

getEncoding

public static NumericEncoding getEncoding(int code)
                                   throws CdfFormatException
Returns the encoding corresponding to the value of the encoding field of the CDF Descriptor Record.

Parameters:
code - encoding code
Returns:
encoding object
Throws:
CdfFormatException - if code is unknown