uk.ac.starlink.hds
Class HDSType

java.lang.Object
  extended by uk.ac.starlink.hds.HDSType

public class HDSType
extends Object

Enumeration of the numeric data types available within the HDS system.

Author:
Mark Taylor (Starlink)

Field Summary
static HDSType _BYTE
          Signed byte type.
static HDSType _DOUBLE
          Double precision (8-byte floating point) type.
static HDSType _INTEGER
          Signed integer (4-byte) type.
static HDSType _REAL
          Real (4-byte floating point) type.
static HDSType _UBYTE
          Unsigned byte type.
static HDSType _UWORD
          Unsigned word (2-byte) type.
static HDSType _WORD
          Signed word (2-byte) type.
 
Method Summary
static HDSType fromJavaType(Type javaType)
          Gets the HDSType object most naturally associated with a given java primitive numeric type.
static HDSType fromName(String name)
          Gets an HDSType from its HDS name.
 Number getBadValue()
          Returns the magic bad value used within the HDS/ARY/NDF system for this data type.
 Type getJavaType()
          Returns the java type most naturally associated with this HDS type.
 String getName()
          Returns the name of this type.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_BYTE

public static HDSType _BYTE
Signed byte type.


_UBYTE

public static HDSType _UBYTE
Unsigned byte type.


_WORD

public static HDSType _WORD
Signed word (2-byte) type.


_UWORD

public static HDSType _UWORD
Unsigned word (2-byte) type.


_INTEGER

public static HDSType _INTEGER
Signed integer (4-byte) type.


_REAL

public static HDSType _REAL
Real (4-byte floating point) type.


_DOUBLE

public static HDSType _DOUBLE
Double precision (8-byte floating point) type.

Method Detail

getName

public String getName()
Returns the name of this type.

Returns:
type name (upper case, including prepended underscore)

getBadValue

public Number getBadValue()
Returns the magic bad value used within the HDS/ARY/NDF system for this data type.

Returns:
bad value representation

getJavaType

public Type getJavaType()
Returns the java type most naturally associated with this HDS type.

Returns:
primitive data type representation

toString

public String toString()
Overrides:
toString in class Object

fromJavaType

public static HDSType fromJavaType(Type javaType)
Gets the HDSType object most naturally associated with a given java primitive numeric type.

Parameters:
javaType - object representing a java primitive type
Returns:
an appropriate HDSType object

fromName

public static HDSType fromName(String name)
Gets an HDSType from its HDS name. This does the opposite of the getName() method. Returns null if name does not refer to a supported HDS numeric type; note this will apply to _LOGICAL, _CHAR and structure types (ones not starting with an underscore).

Parameters:
name - name of the HDS type, including prepended underscore. Not case sensitive.
Returns:
the numeric HDS type corresponding to name, or null if it is not one


Copyright © 2015 Central Laboratory of the Research Councils. All Rights Reserved.