org.jlab.coda.jevio
Enum DataType

java.lang.Object
  extended by java.lang.Enum<DataType>
      extended by org.jlab.coda.jevio.DataType
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<DataType>

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

This an enum used to convert data type numerical values to a more meaningful name. For example, the data type with value 0xe corresponds to the enum BANK. Mostly this is used for printing. In this version of evio, the ALSOTAGSEGMENT (0x40) value was removed from this enum because the upper 2 bits of a byte containing the datatype are now used to store padding data.

Author:
heddle, timmer

Enum Constant Summary
ALSOBANK
           
ALSOSEGMENT
           
BANK
           
CHAR8
           
CHARSTAR8
           
COMPOSITE
           
DOUBLE64
           
FLOAT32
           
HOLLERIT
           
INT32
           
LONG64
           
NVALUE
           
SEGMENT
           
SHORT16
           
TAGSEGMENT
           
UCHAR8
           
UINT32
           
ULONG64
           
UNKNOWN32
           
USHORT16
           
 
Method Summary
static DataType getDataType(int value)
          Obtain the enum from the value.
static java.lang.String getName(int value)
          Obtain the name from the value.
 int getValue()
          Get the enum's value.
 boolean isStructure()
          Convenience routine to see if "this" data type is a structure (a container.)
static DataType valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static DataType[] 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, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

UNKNOWN32

public static final DataType UNKNOWN32

UINT32

public static final DataType UINT32

FLOAT32

public static final DataType FLOAT32

CHARSTAR8

public static final DataType CHARSTAR8

SHORT16

public static final DataType SHORT16

USHORT16

public static final DataType USHORT16

CHAR8

public static final DataType CHAR8

UCHAR8

public static final DataType UCHAR8

DOUBLE64

public static final DataType DOUBLE64

LONG64

public static final DataType LONG64

ULONG64

public static final DataType ULONG64

INT32

public static final DataType INT32

TAGSEGMENT

public static final DataType TAGSEGMENT

SEGMENT

public static final DataType SEGMENT

BANK

public static final DataType BANK

COMPOSITE

public static final DataType COMPOSITE

ALSOBANK

public static final DataType ALSOBANK

ALSOSEGMENT

public static final DataType ALSOSEGMENT

HOLLERIT

public static final DataType HOLLERIT

NVALUE

public static final DataType NVALUE
Method Detail

values

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

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

valueOf

public static DataType 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

getValue

public int getValue()
Get the enum's value.

Returns:
the value, e.g., 0xe for a BANK

getName

public static java.lang.String getName(int value)
Obtain the name from the value.

Parameters:
value - the value to match.
Returns:
the name, or "UNKNOWN".

getDataType

public static DataType getDataType(int value)
Obtain the enum from the value.

Parameters:
value - the value to match.
Returns:
the matching enum, or null.

isStructure

public boolean isStructure()
Convenience routine to see if "this" data type is a structure (a container.)

Returns:
true if the data type corresponds to one of the structure types: BANK, SEGMENT, or TAGSEGMENT.