Package dap4.dap4lib.cdm
Class CDMTypeFcns
- java.lang.Object
-
- dap4.dap4lib.cdm.CDMTypeFcns
-
public abstract class CDMTypeFcns extends Object
This Class is used to isolate as many as possible of the switch statements using TypeSort enums (Or in somecase DapType.getTypeSort()) Singleton
-
-
Constructor Summary
Constructors Constructor Description CDMTypeFcns()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Array
arrayify(DapType type, Object o)
static Array
arrayify(DataType datatype, Object o)
static Object
attributeParse(DataType cdmtype, EnumTypedef en, Object o)
convert a string to a specified cdmtype Note that if en is defined, then we attempt to convert the string as enum conststatic Object
bytesAsTypeVec(DapType daptype, byte[] bytes)
static Class
cdmElementClass(DataType dt)
static DapType
cdmtype2daptype(DataType datatype)
static Object
convert(TypeSort dstsort, TypeSort srcsort, Object src)
static Object
createVector(DapType type, long count)
static Object
createVector(DataType type, long count)
static DataType
daptype2cdmtype(DapType type)
static int
daptypeSize(TypeSort atomtype)
Conmpute the size, in databuffer, of the daptype wrt to a serialization; 0 if undefined.static void
decodebytes(ByteOrder remoteorder, DapType daptype, byte[] bytes, Object vector)
static DataType
enumTypeFor(DapType type)
static long
extract(TypeSort sort, Object value)
static boolean
isPrimitiveVector(DataType type, Object o)
static List
listify(Object vector)
static boolean
signify(DapType type)
static void
vectorcopy(DapType datatype, Object src, Object dst, long srcoffset, long dstoffset)
-
-
-
Method Detail
-
signify
public static boolean signify(DapType type)
-
daptypeSize
public static int daptypeSize(TypeSort atomtype)
Conmpute the size, in databuffer, of the daptype wrt to a serialization; 0 if undefined.- Parameters:
atomtype
- The type of interest- Returns:
- the size, in databuffer
-
vectorcopy
public static void vectorcopy(DapType datatype, Object src, Object dst, long srcoffset, long dstoffset) throws DapException
- Throws:
DapException
-
attributeParse
public static Object attributeParse(DataType cdmtype, EnumTypedef en, Object o)
convert a string to a specified cdmtype Note that if en is defined, then we attempt to convert the string as enum const- Parameters:
cdmtype
-en
-o
-- Returns:
- parsed attribute
-
-